|
From: | Vickie Eigel-Danielson |
Subject: | [Gdb] Debugging Symbols Question |
Date: | Mon, 26 Mar 2001 14:34:06 -0700 |
Hi all. I am a GDB novice developing
embedded ARM software using a host i686 Linux PC and the GNU tool chain. For some reason when I cross-compile my
embedded program on the PC and link it with the ARM C run-time library (which
was apparently compiled without debugging symbols) I get a bunch of bogus
symbols in my minimal symbol table.
The bogus symbols are all compiler-generated line labels for my source
files such as “L2” and “L5”. The problem I am having is as follows: for ( i = 0; i < nLoops; i++ ) {
printf( “%d\n”, i ); } This source code generates a line label (“L5”) for the line that
contains the printf() call. Upon
return from the call to printf(), the GDB function
find_pc_sect_partial_function() looks the current PC value up both in the
symbol table and in the minimal symbol table. In my case, the symbol table says that the PC is in the
function “main” (which is correct) but the minimal symbol table says that the
PC is in the function “L5” (which is incorrect). GDB compares the addresses for the conflicting “functions”
and chooses “L5”! Yikes! Things go steadily downhill from there
as GDB proceeds to execute the “prologue” at the address of “L5”… My question is: why/how are these bogus symbols being added to my
minimal symbol table? I have temporarily
“patched” this problem by hacking my copy of dbxread.c so that the function
record_minimal_symbol() refuses to record any mst_file_text symbols! Rut-Row George! Obviously, this “solution” worries me
greatly. Thanks, Vickie |
[Prev in Thread] | Current Thread | [Next in Thread] |