LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-25-2011, 08:32 PM   #1
evilwolf125
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
I can't debug libc after intall libc6-dbg .who may help me?


1 system info:
root@yes-desktop:/usr/src/eglibc-2.11.1/malloc# uname -a
Linux yes-desktop 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
2 gcc version
root@yes-desktop:/usr/src/eglibc-2.11.1/malloc# gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
3 instal libc6-dbg
sudo apt-get install libc6-dbg

root@yes-desktop:/usr/lib/debug# ls
lib lib64 sbin usr

4 test operator new
#include <iostream>
2
3 class X
4 {
5 public:
6 virtual void f(){std::cout << "x::x()" << std::endl;}
7 ~X(){}
8 private:
9 int m_x;
10 };
11
12 class Y : public X
13 {
14 public:
15 void f(){std::cout << "Y::Y" << std::endl;}
16 private:
17 int m_y;
18 };
19
20 int main()
21 {
22 X *px = new Y;
23
24 delete px;
25 px = NULL;
26 return 0;
27 }
root@yes-desktop:/home/yes/myprograme# g++ -g -o test test.c
root@yes-desktop:/home/yes/myprograme# ls
a.out dns framework help-dummy.o learn_assembly main main.cpp tags test test.c tt-v4.7.zip
root@yes-desktop:/home/yes/myprograme# ldd test
linux-gate.so.1 => (0x00efb000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00be2000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00446000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x006e0000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x004cb000)
/lib/ld-linux.so.2 (0x00b1e000)

question:
1 why cann't i debug the test? because i cann't step into the "operator new" function.
 
Old 07-25-2011, 11:16 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
operator new is a C++ function; it's not a part of libc. I assume it's just a template expansion with calls to functions in libc and/or libstdc++. What can you step through between lines 21 and 23? You might also set a breakpoint in Y::Y() (e.g. raise(SIGTRAP);) and see what the backtrace shows.
Kevin Barry
 
Old 07-28-2011, 12:29 AM   #3
evilwolf125
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
the test doesn't link to :/usr/lib/debug/libc,why?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
libc6-debug or glibc-debug fibreoptique Linux - Newbie 2 01-20-2011 07:52 AM
c dbg front-end kpachopoulos Linux - Software 1 06-09-2007 11:59 AM
libc6-dev version conflicts with libc6 in Dapper peppill Ubuntu 2 12-04-2006 01:13 PM
Is it posible to intall FC5 with just 3 intall CD's ponky2x Fedora - Installation 1 07-26-2006 10:08 AM
dcom98.exe and wine-dbg tarheel92x Linux - Software 0 10-24-2003 10:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration