This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/621: problem with macro tables for automatically generated source files
- From: carlton at math dot stanford dot edu
- To: gdb-gnats at sources dot redhat dot com
- Date: 31 Jul 2002 00:10:30 -0000
- Subject: gdb/621: problem with macro tables for automatically generated source files
- Reply-to: carlton at math dot stanford dot edu
>Number: 621
>Category: gdb
>Synopsis: problem with macro tables for automatically generated source files
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Jul 30 17:18:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: carlton@math.stanford.edu
>Release: GNU gdb 2002-07-30-cvs
>Organization:
>Environment:
uname -a:
Linux jackfruit.Stanford.EDU 2.4.18-5 #1 Mon Jun 10 15:31:48 EDT 2002 i686 unknown
gcc -v:
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --enable-languages=c++
Thread model: single
gcc version 3.1
This GDB was configured as "i686-pc-linux-gnu".
>Description:
I've compiled a program,one of whose source files, 'main.cc', was generating automatically from another file 'main.k' by some sort of magic tool. It's compiled with GCC 3.1 with -g3 (and with -gdwarf-2, but I think that's automatic on my system.)
When I run GDB on this and try to do much of anything, I get an internal error complaining that:
macroscope.c:48: gdb-internal-error:
the symtab `main.k' refers to a preprocessor macro table which doesn't
have any record of processing a file by that name.
An internal GDB error was detected. This may make further
debugging unreliable. Quit this debugging session? (y or n) y
Basically, as far as I can tell, the code in GDB for inspecting macro tables assumes that all files referenced are either the original source code or files that were #included; files that are referenced via directives like
#line 28 "main.k"
make the macro table code in GDB unhappy.
I don't know what tool was used to generate "main.cc" out of "main.k"; I doubt it would be hard to reproduce this using examples from flex or bison or whatever.
>How-To-Repeat:
Unpack the files from PR gdb/574. Then, using GCC-3.1 as your compiler, do:
$ g++ -gdwarf-2 -g3 *.cc
$ gdb a.out
(gdb) b main
(gdb) r
(gdb) n
(gdb) p *e
You should get an error message saying:
macroscope.c:48: gdb-internal-error:
the symtab `main.k' refers to a preprocessor macro table which doesn't
have any record of processing a file by that name.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: