2002-10-02 Andrew Cagney <ac131313@redhat.com>

* infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C.
	* gdbarch.sh (CANNOT_STEP_BREAKPOINT): Add.
	* gdbarch.h, gdbarch.c: Re-generate.
This commit is contained in:
Andrew Cagney 2002-10-02 23:28:54 +00:00
parent cef4f5dd72
commit c4ed33b99b
5 changed files with 59 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2002-10-02 Andrew Cagney <ac131313@redhat.com>
* infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C.
* gdbarch.sh (CANNOT_STEP_BREAKPOINT): Add.
* gdbarch.h, gdbarch.c: Re-generate.
2002-10-02 Daniel Jacobowitz <drow@mvista.com>
Fix PR gdb/778

View File

@ -269,6 +269,7 @@ struct gdbarch
gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
const char * name_of_malloc;
int cannot_step_breakpoint;
};
@ -427,6 +428,7 @@ struct gdbarch startup_gdbarch =
0,
0,
"malloc",
0,
/* startup_gdbarch() */
};
@ -804,6 +806,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
/* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
/* Skip verify of name_of_malloc, invalid_p == 0 */
/* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@ -993,6 +996,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->cannot_fetch_register
/*CANNOT_FETCH_REGISTER ()*/);
#endif
#ifdef CANNOT_STEP_BREAKPOINT
fprintf_unfiltered (file,
"gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
XSTRING (CANNOT_STEP_BREAKPOINT));
fprintf_unfiltered (file,
"gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
CANNOT_STEP_BREAKPOINT);
#endif
#ifdef CANNOT_STORE_REGISTER
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@ -5024,6 +5035,23 @@ set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
gdbarch->name_of_malloc = name_of_malloc;
}
int
gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
/* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
return gdbarch->cannot_step_breakpoint;
}
void
set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
int cannot_step_breakpoint)
{
gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
}
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */

View File

@ -2579,6 +2579,22 @@ extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * na
#endif
#endif
/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT)
#define CANNOT_STEP_BREAKPOINT (0)
#endif
extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
#error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
#endif
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT)
#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
#endif
#endif
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);

View File

@ -662,6 +662,7 @@ F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile
f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0
v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
EOF
}

View File

@ -870,13 +870,14 @@ resume (int step, enum target_signal sig)
resume_ptid = inferior_ptid;
}
#ifdef CANNOT_STEP_BREAKPOINT
/* Most targets can step a breakpoint instruction, thus executing it
normally. But if this one cannot, just continue and we will hit
it anyway. */
if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
step = 0;
#endif
if (CANNOT_STEP_BREAKPOINT)
{
/* Most targets can step a breakpoint instruction, thus
executing it normally. But if this one cannot, just
continue and we will hit it anyway. */
if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
step = 0;
}
target_resume (resume_ptid, step, sig);
}