public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* RE: Dwarf-2 problem in Insight GDB
       [not found] <762C0A863A7674478671627FEAF584812C357F@hqmail01.powertv.com>
@ 2002-08-15 11:26 ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2002-08-15 11:26 UTC (permalink / raw)
  To: Cheng, Cheuk; +Cc: insight

On Thu, 15 Aug 2002, Cheng, Cheuk wrote:

> Hi Keith, I had compiled test.c into test.o by using "sparc-elf-gcc -c
> -gdwarf-2 test.c" (and then loader test.o inside sparc-elf-gdb.exe which
> I built).  I have to admit that my knowledge of GDB and debug info is
> very little.  Please let me know if you need further information in
> addition to the following.
> 
> The following is the output from "sparc-elf-readelf --syms test.o".

[snip]

I don't really know a whole lot about DWARF(-2), but I wonder if using an 
unlinked object file is causing you problems. Hmmm... I just tried this 
with linux:

  gcc -gdwarf-2 -c test.c
  gdb test.o

and it "worked" -- source was displayed, could set breakpoints.

Here's what I would do... Try setting breakpoints, examining code, etc, 
with the console version (gdb -nw). If that also fails to work, send a 
note to gdb@sources.redhat.com asking for help (make sure you tell them 
how you compiled your object file and include a sample session).

If everything works fine with the console, let me know. Something goofy is
going on (and I already erased your zip file). 

Keith


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dwarf-2 problem in Insight GDB
  2002-08-14 13:46 Cheng, Cheuk
@ 2002-08-15 11:02 ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2002-08-15 11:02 UTC (permalink / raw)
  To: Cheng, Cheuk; +Cc: insight

On Wed, 14 Aug 2002, Cheng, Cheuk wrote:

> I had tried downloading Insight GDB sources dated 07-18-2002 and built a
> sparc-elf version successfully.  Then I compiled a small C program using
> my sparc-elf compiler.  But when I loaded the compiled .o file into GDB,
> it shows only the assembly language window while the "Current function
> name" listbox shows the name "main" and the "Current file name" listbox
> is empty.  If I select the name of the source file from the "Current
> file name" listbox, then the source code will be displayed in full on
> the screen.  However, when I click on the "-" next to a source line to
> set a breakpoint, no red circle breakpoint market appears.  I am not
> sure whether my compiler is generating the wrong dwarf-2 info in the .o
> file or whether my GDB is not working (or built) properly.  The same
> problem happens if I compile my test file with -gdwarf instead of
> -gdwarf while simply using -g will not have this problem.  I have
> attached my small source and .o file here.

Hmmm... You compiled a small C program, or an object file? Your test.zip 
shows:

test.c
test.o

When I load test.o into gdb, I get:

(gdb) p main
$1 = {<text variable, no debug info>} 0

How did you compile this? There appears to be no (usable?) debug info in 
the file. (Is this really linked?? There's no printf in the executable.)

Keith

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Dwarf-2 problem in Insight GDB
@ 2002-08-14 13:46 Cheng, Cheuk
  2002-08-15 11:02 ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Cheng, Cheuk @ 2002-08-14 13:46 UTC (permalink / raw)
  To: insight

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

I had tried downloading Insight GDB sources dated 07-18-2002 and built a
sparc-elf version successfully.  Then I compiled a small C program using
my sparc-elf compiler.  But when I loaded the compiled .o file into GDB,
it shows only the assembly language window while the "Current function
name" listbox shows the name "main" and the "Current file name" listbox
is empty.  If I select the name of the source file from the "Current
file name" listbox, then the source code will be displayed in full on
the screen.  However, when I click on the "-" next to a source line to
set a breakpoint, no red circle breakpoint market appears.  I am not
sure whether my compiler is generating the wrong dwarf-2 info in the .o
file or whether my GDB is not working (or built) properly.  The same
problem happens if I compile my test file with -gdwarf instead of
-gdwarf while simply using -g will not have this problem.  I have
attached my small source and .o file here.

Regards,
cheng@powertv.com

[-- Attachment #2: test.zip --]
[-- Type: application/x-zip-compressed, Size: 2499 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-15 18:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <762C0A863A7674478671627FEAF584812C357F@hqmail01.powertv.com>
2002-08-15 11:26 ` Dwarf-2 problem in Insight GDB Keith Seitz
2002-08-14 13:46 Cheng, Cheuk
2002-08-15 11:02 ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).