diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1994-10-08 11:54:29 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1994-10-08 11:54:29 +0000 |
commit | 76212295984365ba3f767cf7c99d1d535360fb99 (patch) | |
tree | adbbde523d4e3016a6ce2b59d15eeb2997daac6e /gdb/irix5-nat.c | |
parent | 15a90f75cbf0e00e49b7900d5e317a57b46de265 (diff) | |
download | gdb-76212295984365ba3f767cf7c99d1d535360fb99.zip gdb-76212295984365ba3f767cf7c99d1d535360fb99.tar.gz gdb-76212295984365ba3f767cf7c99d1d535360fb99.tar.bz2 |
Speed up GDB startup time by not demangling partial symbols.
* symfile.h (ADD_PSYMBOL_VT_TO_LIST),
symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
No longer demangle partial symbols.
* symtab.c (lookup_symbol, list_symbols): Handle mangled
variables, e.g. C++ static members, via the minimal symbols.
Handle reordered functions in an objfile, for Irix 5.2 shared
libraries.
* objfiles.h (OBJF_REORDERED): New bit in the objfile flags,
set if the functions in an objfile are reordered.
* mdebugread.c (parse_partial_symbols): Detect reordered
functions in an objfile.
* symtab.c (find_pc_psymtab, find_pc_symtab): Use expensive
lookup algorithm if the functions in the objfile are reordered.
* xcoffexec.c (exec_close): If the current target has a copy
of the exec_ops sections, reflect the freeing of the sections
in current_target.
* valops.c (call_function_by_hand): Use `sizeof dummy1', not
`sizeof dummy', for constructing the call dummy code.
* config/sparc/tm-sparc.h: Add PARAMS declarations to all
function declarations.
* sparc-tdep.c (sparc_pop_frame): Cast result of
read_memory_integer to CORE_ADDR when passing it to PC_ADJUST.
* irix5-nat.c (enable_break): Set breakpoint at the entry point
of the executable, to handle the case where main resides in a
shared library.
* irix5-nat.c (solib_create_inferior_hook): Reset stop_soon_quietly
after shared library symbol reading, to get rid of a warning from
heuristic_proc_start if the startup code has no symbolic debug info.
* breakpoint.h (struct breakpoint): Add new fields language
and input_radix, to enable breakpoint resetting with the
proper language and radix.
* breakpoint.c (set_raw_breakpoint): Initialize them.
(breakpoint_re_set_one): Use them when resetting the breakpoint.
(breakpoint_re_set): Preserve current language and input_radix
across breakpoint_re_set_one calls.
* symtab.c (decode_line_1): Do not build a canonical line
specification for `*expr' line specifications.
* breakpoint.h (bpstat_stop_status): Fix prototype declaration.
Diffstat (limited to 'gdb/irix5-nat.c')
-rw-r--r-- | gdb/irix5-nat.c | 101 |
1 files changed, 15 insertions, 86 deletions
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 38cc094..f413738 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -194,21 +194,6 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) #include "inferior.h" #include "language.h" -/* We need to set a breakpoint at a point when we know that the - mapping of shared libraries is complete. dbx simply breaks at main - (or, for FORTRAN, MAIN__), so we do the same. We can not break at - the very beginning of main, because the startup code will jump into - main after the GP initialization instructions. SOLIB_BKPT_OFFSET - is used to skip those instructions. */ - -#define SOLIB_BKPT_OFFSET 12 - -static char *bkpt_names[] = { - "main", - "MAIN__", - NULL -}; - /* The symbol which starts off the list of shared libraries. */ #define DEBUG_BASE "__rld_obj_head" @@ -878,84 +863,22 @@ SYNOPSIS DESCRIPTION - Both the SunOS and the SVR4 dynamic linkers have, as part of their - debugger interface, support for arranging for the inferior to hit - a breakpoint after mapping in the shared libraries. This function - enables that breakpoint. - - For SunOS, there is a special flag location (in_debugger) which we - set to 1. When the dynamic linker sees this flag set, it will set - a breakpoint at a location known only to itself, after saving the - original contents of that place and the breakpoint address itself, - in it's own internal structures. When we resume the inferior, it - will eventually take a SIGTRAP when it runs into the breakpoint. - We handle this (in a different place) by restoring the contents of - the breakpointed location (which is only known after it stops), - chasing around to locate the shared libraries that have been - loaded, then resuming. - - For SVR4, the debugger interface structure contains a member (r_brk) - which is statically initialized at the time the shared library is - built, to the offset of a function (_r_debug_state) which is guaran- - teed to be called once before mapping in a library, and again when - the mapping is complete. At the time we are examining this member, - it contains only the unrelocated offset of the function, so we have - to do our own relocation. Later, when the dynamic linker actually - runs, it relocates r_brk to be the actual address of _r_debug_state(). - - The debugger interface structure also contains an enumeration which - is set to either RT_ADD or RT_DELETE prior to changing the mapping, - depending upon whether or not the library is being mapped or unmapped, - and then set to RT_CONSISTENT after the library is mapped/unmapped. - - Irix 5, on the other hand, has no such features. Instead, we - set a breakpoint at main. + This functions inserts a breakpoint at the entry point of the + main executable, where all shared libraries are mapped in. */ static int enable_break () { - int success = 0; - struct minimal_symbol *msymbol; - char **bkpt_namep; - CORE_ADDR bkpt_addr; - - /* Scan through the list of symbols, trying to look up the symbol and - set a breakpoint there. Terminate loop when we/if we succeed. */ - - breakpoint_addr = 0; - for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++) + if (symfile_objfile != NULL + && target_insert_breakpoint (symfile_objfile->ei.entry_point, + shadow_contents) == 0) { - msymbol = lookup_minimal_symbol (*bkpt_namep, symfile_objfile); - if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0)) - { - bkpt_addr = SYMBOL_VALUE_ADDRESS (msymbol); -#ifdef SOLIB_BKPT_OFFSET - /* We only want to skip if bkpt_addr is currently pointing - at a GP setting instruction. */ - { - char buf[4]; - - if (target_read_memory (bkpt_addr, buf, 4) == 0) - { - unsigned long insn; - - insn = extract_unsigned_integer (buf, 4); - if ((insn & 0xffff0000) == 0x3c1c0000) /* lui $gp,n */ - bkpt_addr += SOLIB_BKPT_OFFSET; - } - } -#endif - if (target_insert_breakpoint (bkpt_addr, shadow_contents) == 0) - { - breakpoint_addr = bkpt_addr; - success = 1; - break; - } - } + breakpoint_addr = symfile_objfile->ei.entry_point; + return 1; } - return (success); + return 0; } /* @@ -1033,7 +956,6 @@ solib_create_inferior_hook() wait_for_inferior (); } while (stop_signal != SIGTRAP); - stop_soon_quietly = 0; /* We are now either at the "mapping complete" breakpoint (or somewhere else, a condition we aren't prepared to deal with anyway), so adjust @@ -1051,7 +973,14 @@ solib_create_inferior_hook() warning ("shared library handler failed to disable breakpoint"); } + /* solib_add will call reinit_frame_cache. + But we are stopped in the startup code and we might not have symbols + for the startup code, so heuristic_proc_start could be called + and will put out an annoying warning. + Delaying the resetting of stop_soon_quietly until after symbol loading + suppresses the warning. */ solib_add ((char *) 0, 0, (struct target_ops *) 0); + stop_soon_quietly = 0; } /* |