Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] fix error reporting for td_ta_event_addr calls
Date: Wed, 03 Dec 2003 02:52:00 -0000	[thread overview]
Message-ID: <200312030251.hB32pxHO021802@magilla.sf.frob.com> (raw)

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, &notify);
   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
 					      &current_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));


             reply	other threads:[~2003-12-03  2:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-03  2:52 Roland McGrath [this message]
2003-12-03 17:24 ` Mark Kettenis
2003-12-04 23:04   ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312030251.hB32pxHO021802@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox