From 6545c6a085d88cf4b42740ddc3a41840631b0e06 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Fri, 21 Jan 1994 17:53:57 +0000 Subject: [PATCH] * dbxread.c (end_psymtab): Only patch psymtab textlow and texthigh if N_SO_ADDRESS_MAYBE_MISSING is defined. * config/sparc/tm-sun4sol2.h: Define it. --- gdb/ChangeLog | 6 ++++++ gdb/config/sparc/tm-sun4sol2.h | 3 +++ gdb/dbxread.c | 9 +++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dbb61145ff..e03c519595 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Fri Jan 21 12:47:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * dbxread.c (end_psymtab): Only patch psymtab textlow and texthigh + if N_SO_ADDRESS_MAYBE_MISSING is defined. + * config/sparc/tm-sun4sol2.h: Define it. + Thu Jan 20 15:04:24 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * printcmd.c (print_address_symbolic): Unconditionally use msymbol diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h index 0c3b7c1468..5e3c0bc41e 100644 --- a/gdb/config/sparc/tm-sun4sol2.h +++ b/gdb/config/sparc/tm-sun4sol2.h @@ -51,3 +51,6 @@ get_longjmp_target PARAMS ((CORE_ADDR *)); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) #endif /* 0 */ + +/* The SunPRO compiler puts out 0 instead of the address in an N_SO symbol. */ +#define N_SO_ADDRESS_MAYBE_MISSING diff --git a/gdb/dbxread.c b/gdb/dbxread.c index d91c67e8a0..b2bcb32ea6 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -453,7 +453,8 @@ record_minimal_symbol (name, address, type, objfile) prim_record_minimal_symbol (obsavestring (name, strlen (name), &objfile -> symbol_obstack), address, - ms_type); + ms_type, + objfile); } /* Scan and build partial symbols for a symbol file. @@ -1034,6 +1035,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset, LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst); pst->texthigh = capping_text; +#ifdef N_SO_ADDRESS_MAYBE_MISSING /* Under Solaris, the N_SO symbols always have a value of 0, instead of the usual address of the .o file. Therefore, we have to do some tricks to fill in texthigh and textlow. @@ -1100,6 +1102,9 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset, /* this test will be true if the last .o file is only data */ if (pst->textlow == 0) + /* This loses if the text section really starts at address zero + (generally true when we are debugging a .o file, for example). + That is why this whole thing is inside N_SO_ADDRESS_MIGHT_LIE. */ pst->textlow = pst->texthigh; /* If we know our own starting text address, then walk through all other @@ -1119,7 +1124,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset, } /* End of kludge for patching Solaris textlow and texthigh. */ - +#endif /* NO_SO_ADDRESS_MAYBE_MISSING. */ pst->n_global_syms = objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset);