diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-03-21 19:48:54 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-03-21 19:48:54 +0000 |
commit | a1b9830cba82d49cc509dd60f3dc2c030b987ee4 (patch) | |
tree | b7c5c6e05037560741fded5f54d308455dce9f62 /gdb/dbxread.c | |
parent | ee29b9fb005bee46f4d2504ad3a106421c4b882a (diff) | |
download | gdb-a1b9830cba82d49cc509dd60f3dc2c030b987ee4.zip gdb-a1b9830cba82d49cc509dd60f3dc2c030b987ee4.tar.gz gdb-a1b9830cba82d49cc509dd60f3dc2c030b987ee4.tar.bz2 |
2002-03-21 Daniel Jacobowitz <drow@mvista.com>
* dbxread.c (process_one_symbol): Extend the first N_SLINE
in a function to cover the entire beginning of the function
as well if it does not already.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r-- | gdb/dbxread.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 26be70c..16d0043 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2707,6 +2707,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, used to relocate these symbol types rather than SECTION_OFFSETS. */ static CORE_ADDR function_start_offset; + /* This holds the address of the start of a function, without the system + peculiarities of function_start_offset. */ + static CORE_ADDR last_function_start; + + /* If this is nonzero, we've seen an N_SLINE since the start of the current + function. Initialized to nonzero to assure that last_function_start + is never used uninitialized. */ + static int sline_found_in_function = 1; + /* If this is nonzero, we've seen a non-gcc N_OPT symbol for this source file. Used to detect the SunPRO solaris compiler. */ static int n_opt_found; @@ -2758,9 +2767,13 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, break; } + sline_found_in_function = 0; + /* Relocate for dynamic loading */ valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); valu = SMASH_TEXT_ADDRESS (valu); + last_function_start = valu; + goto define_a_symbol; case N_LBRAC: @@ -2953,7 +2966,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, #ifdef SUN_FIXED_LBRAC_BUG last_pc_address = valu; /* Save for SunOS bug circumcision */ #endif - record_line (current_subfile, desc, valu); + /* If this is the first SLINE note in the function, record it at + the start of the function instead of at the listed location. */ + if (within_function && sline_found_in_function == 0) + { + record_line (current_subfile, desc, last_function_start); + sline_found_in_function = 1; + } + else + record_line (current_subfile, desc, valu); break; case N_BCOMM: |