aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-09-28 17:43:25 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-09-28 17:43:25 +0000
commit5573d7d4b1ed201ca3ac71dcdcf359d7eda8c3d3 (patch)
tree5429e7618490536ba677b2bf67d570d21d720c47 /gdb/dbxread.c
parentaca4585c94f124f8fefea4d67f3a8f6cdcf01b2e (diff)
downloadgdb-5573d7d4b1ed201ca3ac71dcdcf359d7eda8c3d3.zip
gdb-5573d7d4b1ed201ca3ac71dcdcf359d7eda8c3d3.tar.gz
gdb-5573d7d4b1ed201ca3ac71dcdcf359d7eda8c3d3.tar.bz2
Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES. Clean up problems with targets and hosts that have 64 bit longs and pointers and 32 bit ints. * breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c, ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c, expprint.c, gdbtypes.c, infcmd.c, language.c, language.h, m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h, printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c, symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c: Change all printf formats from %x to %lx if outputting an address. Change la_*_format to use long format. local_hex_string, local_hex_string_custom now take an unsigned long argument, change all callers. * coffread.c (read_coff_symtab): Remove superfluous cast for complaint output. * dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int. * findvar.c, value.h (write_register): Change register value to long. * gdbtypes.h (struct type): Change `bitsize' to long as TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer. * inferior.h (struct inferior_status): Change type of stop_pc to CORE_ADDR. * language.h (local_octal_string, local_octal_string_custom): Remove prototype, the functions are neither defined nor used. * mipsread.c (parse_symbol): Use temporary variable for bitsize as f->bitsize is a long now. * objfiles.c (add_to_objfile_sections, build_objfile_section_table): Use unsigned long casts instead of int for abusing sections_end pointer as integer. * stack.c (parse_frame_specification): Change type of `args' to CORE_ADDR for SETUP_ARBITRARY_FRAME. * printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE. * mipsread.c (parse_type): Alpha cc now supports the t->continued bit, update algorithm to match the way the compiler uses it.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c46
1 files changed, 32 insertions, 14 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index cc0c43e..3a87177 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1114,7 +1114,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
if (minsym) {
pst->texthigh = SYMBOL_VALUE_ADDRESS (minsym) +
- (int) MSYMBOL_INFO (minsym);
+ (long) MSYMBOL_INFO (minsym);
} else {
/* This file ends with a static function, and it's
difficult to imagine how hard it would be to track down
@@ -1765,6 +1765,10 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
case N_BCOMM:
if (common_block)
{
+ /* Note: this does not detect nesting if the previous N_BCOMM
+ was at the beginning of a scope (and thus common_block was
+ NULL). Not necessarily worth worrying about unless we run
+ into a compiler which actually has this bug. */
static struct complaint msg = {
"Invalid symbol data: common within common at symtab pos %d",
0, 0};
@@ -1775,11 +1779,21 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
break;
case N_ECOMM:
+
/* Symbols declared since the BCOMM are to have the common block
- start address added in when we know it. common_block points to
- the first symbol after the BCOMM in the local_symbols list;
- copy the list and hang it off the symbol for the common block name
- for later fixup. */
+ start address added in when we know it. common_block and
+ common_block_i point to the first symbol after the BCOMM in
+ the local_symbols list; copy the list and hang it off the
+ symbol for the common block name for later fixup. */
+
+ /* If there is a N_ECOMM unmatched by a N_BCOMM, we treat all
+ the local_symbols as part of the common block. It might be
+ better to just ignore the N_ECOMM, but then we'd need to
+ distinguish between a N_BCOMM at the start of a scope, or no
+ N_BCOMM at all (currently they both have common_block NULL).
+ Not necessarily worth worrying about unless we run into a
+ compiler which actually has this bug. */
+
{
int i;
struct symbol *sym =
@@ -1870,7 +1884,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
case N_NBBSS:
case N_NBSTS:
case N_NBLCS:
- complain (&unknown_symtype_complaint, local_hex_string(type));
+ complain (&unknown_symtype_complaint,
+ local_hex_string((unsigned long) type));
/* FALLTHROUGH */
/* The following symbol types don't need the address field relocated,
@@ -1919,12 +1934,13 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
/* On solaris up to 2.2, the N_FUN stab gets relocated.
On Solaris 2.3, ld no longer relocates stabs (which
is good), and the N_FUN's value is now always zero.
- We only provide this correction for functions, not for
- all N_FUN symbols, because that is easiest and all
- readonly variables seem to go in the .rodata on Solaris. */
+ The following code can't deal with this, because
+ last_pc_address depends on getting the address from a
+ N_SLINE or some such and in Solaris those are function
+ relative. Best fix is probably to create a Ttext.text symbol
+ and handle this like Ddata.data and so on. */
- if (type == N_GSYM || type == N_STSYM
- || (type == N_FUN && valu == 0))
+ if (type == N_GSYM || type == N_STSYM)
{
struct minimal_symbol *m;
int l = colon_pos - name;
@@ -2031,9 +2047,11 @@ copy_pending (beg, endi, end)
add_symbol_to_list (next->symbol[j], &new);
}
- /* Copy however much of END we need. */
- for (j = endi; j < end->nsyms; j++)
- add_symbol_to_list (end->symbol[j], &new);
+ /* Copy however much of END we need. If END is NULL, it means copy
+ all the local symbols (which we already did above). */
+ if (end != NULL)
+ for (j = endi; j < end->nsyms; j++)
+ add_symbol_to_list (end->symbol[j], &new);
return new;
}