diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1994-10-15 10:50:07 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1994-10-15 10:50:07 +0000 |
commit | 07aa9fdc6b069aa8c02333a37e5da34f19e10f8c (patch) | |
tree | bb8cf3a0a24744ae93f0bd11c81f04bbcb9dcea2 /gdb/rs6000-tdep.c | |
parent | df3cf84a351b2ea91a4b175ca5a22346cd405469 (diff) | |
download | gdb-07aa9fdc6b069aa8c02333a37e5da34f19e10f8c.zip gdb-07aa9fdc6b069aa8c02333a37e5da34f19e10f8c.tar.gz gdb-07aa9fdc6b069aa8c02333a37e5da34f19e10f8c.tar.bz2 |
* eval.c (evaluate_subexp): Make fnptr a LONGEST instead
of using longest_to_int.
* infcmd.c (run_stack_dummy): Reinstate set_current_frame call,
mips and alpha targets need the real breakpoint pc for
creating the breakpoint frame.
* stack.c (return_command): Cast return value to the return
type of the function from which we return.
* values.c (set_return_value): Pass VALUE_CONTENTS unmodified
to STORE_RETURN_VALUE.
* symtab.c (lookup_symbol): Remove search for `static mangled
symbols', the search for `static symbols' already looks for
mangled and demangled symbols via lookup_block_symbol.
* valarith.c (value_binop): Use ANSI C arithmetic conversions
when performing integral evaluations, implement BINOP_EQUAL and
BINOP_LESS.
(value_equal, value_less): Use value_binop to perform the
comparison if both operands have TYPE_CODE_INT.
* rs6000-tdep.c (pop_frame): Make sure all registers are valid,
as they are written back later. Handle sp restore for frameless
functions. Use fdata.nosavedpc instead of fdata.frameless to
determine if the pc has been saved.
(function_frame_info): Handle `mr r31,r1', which is generated by
gcc-2.6, as a synonym for `oril r31,r1,0'.
(skip_trampoline_code): Handle shared library trampolines.
* xcoffread.c (read_xcoff_symtabs): Record XMC_GL symbols with
their real name. Enables setting of breakpoints in shared libraries
before the executable is run.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r-- | gdb/rs6000-tdep.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index b5df530..757e111 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1,5 +1,6 @@ /* Target-dependent code for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994 + Free Software Foundation, Inc. This file is part of GDB. @@ -464,6 +465,9 @@ pop_frame () return; } + /* Make sure that all registers are valid. */ + read_register_bytes (0, NULL, REGISTER_BYTES); + /* figure out previous %pc value. If the function is frameless, it is still in the link register, otherwise walk the frames and retrieve the saved %pc value in the previous frame. */ @@ -471,8 +475,11 @@ pop_frame () addr = get_pc_function_start (fr->pc) + FUNCTION_START_OFFSET; function_frame_info (addr, &fdata); - prev_sp = read_memory_integer (sp, 4); if (fdata.frameless) + prev_sp = sp; + else + prev_sp = read_memory_integer (sp, 4); + if (fdata.nosavedpc) lr = read_register (LR_REGNUM); else lr = read_memory_integer (prev_sp+8, 4); @@ -666,10 +673,12 @@ function_frame_info (pc, fdata) fdata->frameless = 0; } - if (op == 0x603f0000) { /* oril r31, r1, 0x0 */ - fdata->alloca_reg = 31; - fdata->frameless = 0; - } + if (op == 0x603f0000 /* oril r31, r1, 0x0 */ + || op == 0x7c3f0b78) /* mr r31, r1 */ + { + fdata->alloca_reg = 31; + fdata->frameless = 0; + } } @@ -887,6 +896,8 @@ CORE_ADDR rs6000_struct_return_address; /* Indirect function calls use a piece of trampoline code to do context switching, i.e. to set the new TOC table. Skip such code if we are on its first instruction (as when we have single-stepped to here). + Also skip shared library trampoline code (which is different from + indirect function call trampolines). Result is desired PC to step until, or NULL if we are not in trampoline code. */ @@ -895,6 +906,7 @@ skip_trampoline_code (pc) CORE_ADDR pc; { register unsigned int ii, op; + CORE_ADDR solib_target_pc; static unsigned trampoline_code[] = { 0x800b0000, /* l r0,0x0(r11) */ @@ -907,6 +919,11 @@ CORE_ADDR pc; 0 }; + /* If pc is in a shared library trampoline, return its target. */ + solib_target_pc = find_solib_trampoline_target (pc); + if (solib_target_pc) + return solib_target_pc; + for (ii=0; trampoline_code[ii]; ++ii) { op = read_memory_integer (pc + (ii*4), 4); if (op != trampoline_code [ii]) |