2003-10-31 Andrew Cagney <cagney@redhat.com>
* rs6000-tdep.c (rs6000_gdbarch_init): For 64-bit ABI, set adjust_breakpoint_address. * Makefile.in (ppc-sysv-tdep.o): Add $(target_h). * ppc-tdep.h (ppc64_sysv_abi_adjust_breakpoint_address): Declare. * ppc-sysv-tdep.c: Include "target.h". Update copyright. (ppc64_sysv_abi_adjust_breakpoint_address): New function.
This commit is contained in:
parent
4b8a223fcb
commit
6066c3de51
5 changed files with 42 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2003-10-31 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
|
* rs6000-tdep.c (rs6000_gdbarch_init): For 64-bit ABI, set
|
||||||
|
adjust_breakpoint_address.
|
||||||
|
* Makefile.in (ppc-sysv-tdep.o): Add $(target_h).
|
||||||
|
* ppc-tdep.h (ppc64_sysv_abi_adjust_breakpoint_address): Declare.
|
||||||
|
* ppc-sysv-tdep.c: Include "target.h". Update copyright.
|
||||||
|
(ppc64_sysv_abi_adjust_breakpoint_address): New function.
|
||||||
|
|
||||||
2003-10-31 Andrew Cagney <cagney@redhat.com>
|
2003-10-31 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
* target.h (struct target_ops): Replace "to_read_partial" and
|
* target.h (struct target_ops): Replace "to_read_partial" and
|
||||||
|
|
|
@ -2126,7 +2126,8 @@ ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
|
||||||
$(target_h) $(breakpoint_h) $(value_h) $(osabi_h) $(ppc_tdep_h) \
|
$(target_h) $(breakpoint_h) $(value_h) $(osabi_h) $(ppc_tdep_h) \
|
||||||
$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
|
$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
|
||||||
ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
|
ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
|
||||||
$(regcache_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) $(ppc_tdep_h)
|
$(regcache_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) \
|
||||||
|
$(ppc_tdep_h) $(target_h)
|
||||||
printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
|
printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
|
||||||
$(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \
|
$(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \
|
||||||
$(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \
|
$(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Target-dependent code for PowerPC systems using the SVR4 ABI
|
/* Target-dependent code for PowerPC systems using the SVR4 ABI
|
||||||
for GDB, the GNU debugger.
|
for GDB, the GNU debugger.
|
||||||
|
|
||||||
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
|
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
#include "gdb_assert.h"
|
#include "gdb_assert.h"
|
||||||
#include "ppc-tdep.h"
|
#include "ppc-tdep.h"
|
||||||
|
#include "target.h"
|
||||||
|
|
||||||
/* Pass the arguments in either registers, or in the stack. Using the
|
/* Pass the arguments in either registers, or in the stack. Using the
|
||||||
ppc sysv ABI, the first eight words of the argument list (that might
|
ppc sysv ABI, the first eight words of the argument list (that might
|
||||||
|
@ -1013,3 +1014,21 @@ ppc64_sysv_abi_store_return_value (struct type *valtype,
|
||||||
if (!ppc64_sysv_abi_return_value (valtype, regbuf, valbuf, NULL))
|
if (!ppc64_sysv_abi_return_value (valtype, regbuf, valbuf, NULL))
|
||||||
error ("Function return value location unknown");
|
error ("Function return value location unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CORE_ADDR
|
||||||
|
ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch,
|
||||||
|
CORE_ADDR bpaddr)
|
||||||
|
{
|
||||||
|
/* PPC64 SYSV specifies that the minimal-symbol "FN" should point at
|
||||||
|
a function-descriptor while the corresponding minimal-symbol
|
||||||
|
".FN" should point at the entry point. Consequently, a command
|
||||||
|
like "break FN" applied to an object file with only minimal
|
||||||
|
symbols, will insert the breakpoint into the descriptor at "FN"
|
||||||
|
and not the function at ".FN". Avoid this confusion by adjusting
|
||||||
|
any attempt to set a descriptor breakpoint into a corresponding
|
||||||
|
function breakpoint. Note that GDB warns the user when this
|
||||||
|
adjustment is applied - that's ok as otherwise the user will have
|
||||||
|
no way of knowing why their breakpoint at "FN" resulted in the
|
||||||
|
program stopping at ".FN". */
|
||||||
|
return gdbarch_convert_from_func_ptr_addr (gdbarch, bpaddr, ¤t_target);
|
||||||
|
}
|
||||||
|
|
|
@ -61,6 +61,8 @@ CORE_ADDR ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
struct value **args, CORE_ADDR sp,
|
struct value **args, CORE_ADDR sp,
|
||||||
int struct_return,
|
int struct_return,
|
||||||
CORE_ADDR struct_addr);
|
CORE_ADDR struct_addr);
|
||||||
|
CORE_ADDR ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch,
|
||||||
|
CORE_ADDR bpaddr);
|
||||||
int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
|
int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
|
||||||
struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
|
struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
|
||||||
void ppc_linux_supply_gregset (char *buf);
|
void ppc_linux_supply_gregset (char *buf);
|
||||||
|
|
|
@ -2895,6 +2895,15 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||||
set_gdbarch_function_start_offset (gdbarch, 0);
|
set_gdbarch_function_start_offset (gdbarch, 0);
|
||||||
set_gdbarch_breakpoint_from_pc (gdbarch, rs6000_breakpoint_from_pc);
|
set_gdbarch_breakpoint_from_pc (gdbarch, rs6000_breakpoint_from_pc);
|
||||||
|
|
||||||
|
/* Handle the 64-bit SVR4 minimal-symbol convention of using "FN"
|
||||||
|
for the descriptor and ".FN" for the entry-point -- a user
|
||||||
|
specifying "break FN" will unexpectedly end up with a breakpoint
|
||||||
|
on the descriptor and not the function. This architecture method
|
||||||
|
transforms any breakpoints on descriptors into breakpoints on the
|
||||||
|
corresponding entry point. */
|
||||||
|
if (sysv_abi && wordsize == 8)
|
||||||
|
set_gdbarch_adjust_breakpoint_address (gdbarch, ppc64_sysv_abi_adjust_breakpoint_address);
|
||||||
|
|
||||||
/* Not sure on this. FIXMEmgo */
|
/* Not sure on this. FIXMEmgo */
|
||||||
set_gdbarch_frame_args_skip (gdbarch, 8);
|
set_gdbarch_frame_args_skip (gdbarch, 8);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue