* gdbarch.sh (memory_insert_breakpoint, memory_remove_breakpoint): Add

gdbarch as parameter.

	* gdbarch.{c,h}: Regenerate.

	* ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Add gdbarch as
	parameter.
	* mem-break.c (default_memory_insert_breakpoint)
	(default_memory_remove_breakpoint): Likewise.
	* target.h (default_memory_remove_breakpoint)
	(default_memory_insert_breakpoint): Likewise.

	* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Add gdbarch as
	parameter. Replace current_gdbarch by gdbarch.
	* m32r-tdep.c (m32r_memory_insert_breakpoint)
	(m32r_memory_remove_breakpoint): Likewise.
This commit is contained in:
Markus Deuling 2008-02-20 14:31:40 +00:00
parent 7f6ef0c0b8
commit ae4b228419
10 changed files with 48 additions and 22 deletions

View File

@ -1,3 +1,22 @@
2008-02-20 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (memory_insert_breakpoint, memory_remove_breakpoint): Add
gdbarch as parameter.
* gdbarch.{c,h}: Regenerate.
* ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Add gdbarch as
parameter.
* mem-break.c (default_memory_insert_breakpoint)
(default_memory_remove_breakpoint): Likewise.
* target.h (default_memory_remove_breakpoint)
(default_memory_insert_breakpoint): Likewise.
* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Add gdbarch as
parameter. Replace current_gdbarch by gdbarch.
* m32r-tdep.c (m32r_memory_insert_breakpoint)
(m32r_memory_remove_breakpoint): Likewise.
2008-02-19 Daniel Jacobowitz <dan@codesourcery.com>
* MAINTAINERS: Add Vladimir Prus as MI maintainer.

View File

@ -309,8 +309,8 @@ struct gdbarch startup_gdbarch =
0, /* inner_than */
0, /* breakpoint_from_pc */
0, /* adjust_breakpoint_address */
0, /* memory_insert_breakpoint */
0, /* memory_remove_breakpoint */
default_memory_insert_breakpoint, /* memory_insert_breakpoint */
default_memory_remove_breakpoint, /* memory_remove_breakpoint */
0, /* decr_pc_after_break */
0, /* deprecated_function_start_offset */
default_remote_register_number, /* remote_register_number */
@ -2139,7 +2139,7 @@ gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info
gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
return gdbarch->memory_insert_breakpoint (bp_tgt);
return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
}
void
@ -2156,7 +2156,7 @@ gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info
gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
return gdbarch->memory_remove_breakpoint (bp_tgt);
return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
}
void

View File

@ -388,11 +388,11 @@ typedef CORE_ADDR (gdbarch_adjust_breakpoint_address_ftype) (struct gdbarch *gdb
extern CORE_ADDR gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
extern void set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address);
typedef int (gdbarch_memory_insert_breakpoint_ftype) (struct bp_target_info *bp_tgt);
typedef int (gdbarch_memory_insert_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
typedef int (gdbarch_memory_remove_breakpoint_ftype) (struct bp_target_info *bp_tgt);
typedef int (gdbarch_memory_remove_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);

View File

@ -480,8 +480,8 @@ m:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
f:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0
m:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0:
M:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
f:int:memory_insert_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_insert_breakpoint::0
f:int:memory_remove_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_remove_breakpoint::0
m:int:memory_insert_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_insert_breakpoint::0
m:int:memory_remove_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_remove_breakpoint::0
v:CORE_ADDR:decr_pc_after_break:::0:::0
# A function can be addressed by either it's "pointer" (possibly a

View File

@ -553,7 +553,8 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
#define IA64_BREAKPOINT 0x00003333300LL
static int
ia64_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
char bundle[BUNDLE_LEN];
@ -588,7 +589,8 @@ ia64_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
}
static int
ia64_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
char bundle[BUNDLE_LEN];

View File

@ -79,7 +79,8 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
The following functions take care of this behavior. */
static int
m32r_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
m32r_memory_insert_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
int val;
@ -95,7 +96,7 @@ m32r_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
bp_tgt->placed_size = bp_tgt->shadow_len = 4;
/* Determine appropriate breakpoint contents and size for this address. */
if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if ((addr & 3) == 0)
{
@ -136,7 +137,8 @@ m32r_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
}
static int
m32r_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
m32r_memory_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
int val;
@ -149,7 +151,7 @@ m32r_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
buf[3] = contents_cache[3];
/* Remove parallel bit. */
if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if ((buf[0] & 0x80) == 0 && (buf[2] & 0x80) != 0)
buf[2] &= 0x7f;

View File

@ -41,7 +41,8 @@
BREAKPOINT_MAX). */
int
default_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
default_memory_insert_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
int val;
const unsigned char *bp;
@ -49,7 +50,7 @@ default_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
/* Determine appropriate breakpoint contents and size for this address. */
bp = gdbarch_breakpoint_from_pc
(current_gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size);
(gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size);
if (bp == NULL)
error (_("Software breakpoints not implemented for this target."));
@ -68,7 +69,8 @@ default_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
int
default_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
default_memory_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
return target_write_memory (bp_tgt->placed_address, bp_tgt->shadow_contents,
bp_tgt->placed_size);

View File

@ -273,7 +273,8 @@ ppc_linux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
regard to removing breakpoints in some potentially self modifying
code. */
int
ppc_linux_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
ppc_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
const unsigned char *bp;
@ -282,7 +283,7 @@ ppc_linux_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
gdb_byte old_contents[BREAKPOINT_MAX];
/* Determine appropriate breakpoint contents and size for this address. */
bp = gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen);
bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
if (bp == NULL)
error (_("Software breakpoints not implemented for this target."));

View File

@ -54,7 +54,7 @@ CORE_ADDR ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
CORE_ADDR struct_addr);
CORE_ADDR ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch,
CORE_ADDR bpaddr);
int ppc_linux_memory_remove_breakpoint (struct bp_target_info *bp_tgt);
int ppc_linux_memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *);
struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
const struct regset *ppc_linux_gregset (int);
const struct regset *ppc_linux_fpregset (void);

View File

@ -1177,9 +1177,9 @@ extern int memory_remove_breakpoint (struct bp_target_info *);
extern int memory_insert_breakpoint (struct bp_target_info *);
extern int default_memory_remove_breakpoint (struct bp_target_info *);
extern int default_memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *);
extern int default_memory_insert_breakpoint (struct bp_target_info *);
extern int default_memory_insert_breakpoint (struct gdbarch *, struct bp_target_info *);
/* From target.c */