mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
* config/pa/nm-hppah.h (PREPARE_TO_PROCEED): Use the generic
prepare_to_proceed procedure instead of the hppa-specific one. * hppa-tdep.c (hppa_prepare_to_proceed): Remove, no longer used.
This commit is contained in:
parent
b757528ff6
commit
4e37032562
@ -1,3 +1,9 @@
|
||||
2003-06-04 J. Brobecker <brobecker@gnat.com>
|
||||
|
||||
* config/pa/nm-hppah.h (PREPARE_TO_PROCEED): Use the generic
|
||||
prepare_to_proceed procedure instead of the hppa-specific one.
|
||||
* hppa-tdep.c (hppa_prepare_to_proceed): Remove, no longer used.
|
||||
|
||||
2003-06-04 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* acconfig.h: Add HAVE_TKILL_SYSCALL definition check.
|
||||
|
@ -55,8 +55,8 @@
|
||||
|
||||
/* While this is for use by threaded programs, it doesn't appear
|
||||
* to hurt non-threaded ones. This is used in infrun.c: */
|
||||
#define PREPARE_TO_PROCEED(select_it) hppa_prepare_to_proceed()
|
||||
extern int hppa_prepare_to_proceed (void);
|
||||
#define PREPARE_TO_PROCEED(select_it) generic_prepare_to_proceed(select_it)
|
||||
extern int generic_prepare_to_proceed (int select_it);
|
||||
|
||||
/* In infptrace.c or infttrace.c: */
|
||||
#define CHILD_PID_TO_EXEC_FILE
|
||||
|
@ -4673,92 +4673,6 @@ unwind_command (char *exp, int from_tty)
|
||||
pin (Total_frame_size);
|
||||
}
|
||||
|
||||
#ifdef PREPARE_TO_PROCEED
|
||||
|
||||
/* If the user has switched threads, and there is a breakpoint
|
||||
at the old thread's pc location, then switch to that thread
|
||||
and return TRUE, else return FALSE and don't do a thread
|
||||
switch (or rather, don't seem to have done a thread switch).
|
||||
|
||||
Ptrace-based gdb will always return FALSE to the thread-switch
|
||||
query, and thus also to PREPARE_TO_PROCEED.
|
||||
|
||||
The important thing is whether there is a BPT instruction,
|
||||
not how many user breakpoints there are. So we have to worry
|
||||
about things like these:
|
||||
|
||||
o Non-bp stop -- NO
|
||||
|
||||
o User hits bp, no switch -- NO
|
||||
|
||||
o User hits bp, switches threads -- YES
|
||||
|
||||
o User hits bp, deletes bp, switches threads -- NO
|
||||
|
||||
o User hits bp, deletes one of two or more bps
|
||||
at that PC, user switches threads -- YES
|
||||
|
||||
o Plus, since we're buffering events, the user may have hit a
|
||||
breakpoint, deleted the breakpoint and then gotten another
|
||||
hit on that same breakpoint on another thread which
|
||||
actually hit before the delete. (FIXME in breakpoint.c
|
||||
so that "dead" breakpoints are ignored?) -- NO
|
||||
|
||||
For these reasons, we have to violate information hiding and
|
||||
call "breakpoint_here_p". If core gdb thinks there is a bpt
|
||||
here, that's what counts, as core gdb is the one which is
|
||||
putting the BPT instruction in and taking it out.
|
||||
|
||||
Note that this implementation is potentially redundant now that
|
||||
default_prepare_to_proceed() has been added.
|
||||
|
||||
FIXME This may not support switching threads after Ctrl-C
|
||||
correctly. The default implementation does support this. */
|
||||
int
|
||||
hppa_prepare_to_proceed (void)
|
||||
{
|
||||
pid_t old_thread;
|
||||
pid_t current_thread;
|
||||
|
||||
old_thread = hppa_switched_threads (PIDGET (inferior_ptid));
|
||||
if (old_thread != 0)
|
||||
{
|
||||
/* Switched over from "old_thread". Try to do
|
||||
as little work as possible, 'cause mostly
|
||||
we're going to switch back. */
|
||||
CORE_ADDR new_pc;
|
||||
CORE_ADDR old_pc = read_pc ();
|
||||
|
||||
/* Yuk, shouldn't use global to specify current
|
||||
thread. But that's how gdb does it. */
|
||||
current_thread = PIDGET (inferior_ptid);
|
||||
inferior_ptid = pid_to_ptid (old_thread);
|
||||
|
||||
new_pc = read_pc ();
|
||||
if (new_pc != old_pc /* If at same pc, no need */
|
||||
&& breakpoint_here_p (new_pc))
|
||||
{
|
||||
/* User hasn't deleted the BP.
|
||||
Return TRUE, finishing switch to "old_thread". */
|
||||
flush_cached_frames ();
|
||||
registers_changed ();
|
||||
#if 0
|
||||
printf ("---> PREPARE_TO_PROCEED (was %d, now %d)!\n",
|
||||
current_thread, PIDGET (inferior_ptid));
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Otherwise switch back to the user-chosen thread. */
|
||||
inferior_ptid = pid_to_ptid (current_thread);
|
||||
new_pc = read_pc (); /* Re-prime register cache */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* PREPARE_TO_PROCEED */
|
||||
|
||||
void
|
||||
hppa_skip_permanent_breakpoint (void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user