emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new gdb/gdba code has bug with absolute source filenames


From: Bruce Stephens
Subject: Re: new gdb/gdba code has bug with absolute source filenames
Date: Thu, 08 Jan 2004 00:46:06 +0000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

Nick Roberts <address@hidden> writes:

[...]

> I've not considered word wrapping. I can see that this would create
> problems but I don't think this fixes the problem stated above as it
> happens before execution has started, when "info frame" just gives
> "No stack." The source code is located for Emacs with the GDB
> command "info source".

Actually, it did seem to fix the problem for the test example.  But
didn't seem to for a real program with a much longer file name.

> Bruce, when you see the assembler code for main rather than C source code
> what does GDB say when you type "info source" in the GUD buffer?

It says:

(gdb) info source
Current source file is /tmp/hello.c
Located in /tmp/hello.c
Contains 6 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Includes preprocessor macro info.

> I can't duplicate this problem. What operating system, version of
> GDB, gcc etc are you using?

Debian GNU/Linux unstable, i386, gdb 6.0-debian, gcc version 3.3.3
20031229 (prerelease) (Debian).

> Andreas, I imagine other handlers in gdb-ui.el can't handle word
> wrapping so I guess that running GDB command, "set width 0", on
> initialisation will help.

True.  As you suggest, though, it's probably not enough: show width
shows that width is 80, so probably that's enough for this example.

I used edebug on gdb-source-info.  When it starts,
*partial-output-hello* contains:

Current source file is /tmp/hello.c
Located in /tmp/hello.c
Contains 6 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Includes preprocessor macro info.

For a hello.c compiled with "gcc -g3 -o hello hello.c" (i.e., some
relative path, I guess), it contains:

Current source file is hello.c
Compilation directory is /tmp
Located in /tmp/hello.c
Contains 6 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Includes preprocessor macro info.

Perhaps I'm being naive, but it looks to me like gdb-source-info ought
to be looking at "Located in ..." and just believing it.  (Possibly
this wouldn't work for Windows or older gdbs or something.)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]