mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
2003-11-25 Andrew Cagney <cagney@redhat.com>
* thread-db.c (enable_thread_event): New function. Ensure that BP is a code address. (enable_thread_event_reporting): Use enable_thread_event.
This commit is contained in:
parent
3db8d52cad
commit
24557e30a9
@ -1,3 +1,9 @@
|
||||
2003-11-25 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* thread-db.c (enable_thread_event): New function. Ensure that BP
|
||||
is a code address.
|
||||
(enable_thread_event_reporting): Use enable_thread_event.
|
||||
|
||||
2003-11-25 Michael Snyder <msnyder@redhat.com>
|
||||
|
||||
* mips-tdep.c (mips_o64_extract_return_value): Correct for
|
||||
|
@ -465,6 +465,26 @@ thread_db_load (void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp)
|
||||
{
|
||||
td_notify_t notify;
|
||||
int err;
|
||||
|
||||
/* Get the breakpoint address for thread EVENT. */
|
||||
err = td_ta_event_addr_p (thread_agent, event, ¬ify);
|
||||
if (err != TD_OK)
|
||||
return 0;
|
||||
|
||||
/* Set up the breakpoint. */
|
||||
(*bp) = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
|
||||
(CORE_ADDR) notify.u.bptaddr,
|
||||
¤t_target);
|
||||
create_thread_event_breakpoint ((*bp));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
enable_thread_event_reporting (void)
|
||||
{
|
||||
@ -498,32 +518,24 @@ enable_thread_event_reporting (void)
|
||||
|
||||
/* Delete previous thread event breakpoints, if any. */
|
||||
remove_thread_event_breakpoints ();
|
||||
td_create_bp_addr = 0;
|
||||
td_death_bp_addr = 0;
|
||||
|
||||
/* Get address for thread creation breakpoint. */
|
||||
err = td_ta_event_addr_p (thread_agent, TD_CREATE, ¬ify);
|
||||
if (err != TD_OK)
|
||||
/* Set up the thread creation event. */
|
||||
if (!enable_thread_event (thread_agent, TD_CREATE, &td_create_bp_addr))
|
||||
{
|
||||
warning ("Unable to get location for thread creation breakpoint: %s",
|
||||
thread_db_err_str (err));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set up the breakpoint. */
|
||||
td_create_bp_addr = (CORE_ADDR) notify.u.bptaddr;
|
||||
create_thread_event_breakpoint (td_create_bp_addr);
|
||||
|
||||
/* Get address for thread death breakpoint. */
|
||||
err = td_ta_event_addr_p (thread_agent, TD_DEATH, ¬ify);
|
||||
if (err != TD_OK)
|
||||
/* Set up the thread death event. */
|
||||
if (!enable_thread_event (thread_agent, TD_DEATH, &td_death_bp_addr))
|
||||
{
|
||||
warning ("Unable to get location for thread death breakpoint: %s",
|
||||
thread_db_err_str (err));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set up the breakpoint. */
|
||||
td_death_bp_addr = (CORE_ADDR) notify.u.bptaddr;
|
||||
create_thread_event_breakpoint (td_death_bp_addr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user