* [PATCH] fix error reporting for td_ta_event_addr calls
@ 2003-12-03 2:52 Roland McGrath
2003-12-03 17:24 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Roland McGrath @ 2003-12-03 2:52 UTC (permalink / raw)
To: gdb-patches
As it stands, if the libthread_db function td_ta_event_addr fails,
gdb will report "warning: Unable to get location for thread creation
breakpoint: generic 'call succeeded'", having discarded the actual error
code from the function. This patch fixes that.
Approved to commit?
Thanks,
Roland
2003-12-02 Roland McGrath <roland@redhat.com>
* thread-db.c (enable_thread_event): Change return type to
td_err_e. Return TD_OK or error code.
(enable_thread_event_reporting): Update callers.
--- thread-db.c.~1.35.~ 2003-11-25 18:34:21.000000000 -0800
+++ thread-db.c 2003-12-02 18:09:55.000000000 -0800
@@ -465,16 +465,16 @@ thread_db_load (void)
return 1;
}
-static int
+static td_err_e
enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp)
{
td_notify_t notify;
- int err;
+ td_err_e err;
/* Get the breakpoint address for thread EVENT. */
err = td_ta_event_addr_p (thread_agent, event, ¬ify);
if (err != TD_OK)
- return 0;
+ return err;
/* Set up the breakpoint. */
(*bp) = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
@@ -482,7 +482,7 @@ enable_thread_event (td_thragent_t *thre
¤t_target);
create_thread_event_breakpoint ((*bp));
- return 1;
+ return TD_OK;
}
static void
@@ -522,7 +522,8 @@ enable_thread_event_reporting (void)
td_death_bp_addr = 0;
/* Set up the thread creation event. */
- if (!enable_thread_event (thread_agent, TD_CREATE, &td_create_bp_addr))
+ err = enable_thread_event (thread_agent, TD_CREATE, &td_create_bp_addr);
+ if (err != TD_OK)
{
warning ("Unable to get location for thread creation breakpoint: %s",
thread_db_err_str (err));
@@ -530,7 +531,8 @@ enable_thread_event_reporting (void)
}
/* Set up the thread death event. */
- if (!enable_thread_event (thread_agent, TD_DEATH, &td_death_bp_addr))
+ err = enable_thread_event (thread_agent, TD_DEATH, &td_death_bp_addr);
+ if (err != TD_OK)
{
warning ("Unable to get location for thread death breakpoint: %s",
thread_db_err_str (err));
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix error reporting for td_ta_event_addr calls
2003-12-03 2:52 [PATCH] fix error reporting for td_ta_event_addr calls Roland McGrath
@ 2003-12-03 17:24 ` Mark Kettenis
2003-12-04 23:04 ` Roland McGrath
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2003-12-03 17:24 UTC (permalink / raw)
To: roland; +Cc: gdb-patches
Date: Tue, 2 Dec 2003 18:51:59 -0800
From: Roland McGrath <roland@redhat.com>
As it stands, if the libthread_db function td_ta_event_addr fails,
gdb will report "warning: Unable to get location for thread creation
breakpoint: generic 'call succeeded'", having discarded the actual error
code from the function. This patch fixes that.
Approved to commit?
Looks good to me, so, yes please!
Mark
2003-12-02 Roland McGrath <roland@redhat.com>
* thread-db.c (enable_thread_event): Change return type to
td_err_e. Return TD_OK or error code.
(enable_thread_event_reporting): Update callers.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix error reporting for td_ta_event_addr calls
2003-12-03 17:24 ` Mark Kettenis
@ 2003-12-04 23:04 ` Roland McGrath
0 siblings, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2003-12-04 23:04 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
> Date: Tue, 2 Dec 2003 18:51:59 -0800
> From: Roland McGrath <roland@redhat.com>
>
> As it stands, if the libthread_db function td_ta_event_addr fails,
> gdb will report "warning: Unable to get location for thread creation
> breakpoint: generic 'call succeeded'", having discarded the actual error
> code from the function. This patch fixes that.
>
> Approved to commit?
>
> Looks good to me, so, yes please!
Committed yesterday, sorry I forgot to post then.
> Mark
>
> 2003-12-02 Roland McGrath <roland@redhat.com>
>
> * thread-db.c (enable_thread_event): Change return type to
> td_err_e. Return TD_OK or error code.
> (enable_thread_event_reporting): Update callers.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-12-04 23:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-03 2:52 [PATCH] fix error reporting for td_ta_event_addr calls Roland McGrath
2003-12-03 17:24 ` Mark Kettenis
2003-12-04 23:04 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox