This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/11704] Cannot load debugging info


------- Additional Comments From dimabarts at yahoo dot com  2010-06-14 21:22 -------
(In reply to comment #1)
> > % cc hello.o -o hello
> 
> Try changing that to:
> 
> cc hello.o -g -o hello
> 
> I think you need -g on the link line to tell the linker to preserve debuginfo.
> 
> You can always check gdb here by using readelf or something like that to
> see if the executable does in fact have debuginfo.

Thanks but no dice...

% cc hello.o -g -o hello
% ~/gdb-7.1/gdb/gdb hello
Reading symbols from /export/home/dbarts/C/hello...Can't read symbols from
/export/home/dbarts/C/hello: Invalid operation

I've checked man ld and the flag -g isn't mentioned at all (although there's the
opposite one, -s). Here's another experiment - without any executables:
% ~/gdb-7.1/gdb/gdb
(gdb) symbol-file hello.o
Reading symbols from /export/home/dbarts/C/hello.o...(no debugging symbols
found)...done.

But there is dbg info:
% ls -l hello.o
-rw-r--r--   1 dbarts   staff       1040 Jun 14 14:18 hello.o
% strip hello.o
% ls -l hello.o
-rw-r--r--   1 dbarts   staff        760 Jun 14 17:15 hello.o

So 25% of original hello.o had consisted of dbg info.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11704

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]