OSDN Git Service

* thread-db.c (thread_db_set_thread_reg): Don't allow a successful
authorkevinb <kevinb>
Thu, 18 Nov 2004 21:40:02 +0000 (21:40 +0000)
committerkevinb <kevinb>
Thu, 18 Nov 2004 21:40:02 +0000 (21:40 +0000)
return without first initializing ``reg''.

rda/unix/ChangeLog
rda/unix/thread-db.c

index 2210ffb..7c84743 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-18  Kevin Buettner  <kevinb@redhat.com>
+
+       * thread-db.c (thread_db_set_thread_reg): Don't allow a successful
+       return without first initializing ``reg''.
+
 2004-10-20  Jim Blandy  <jimb@redhat.com>
 
        Use the libthread_db 'td_symbol_list' function to look up all the
index 2aea4f0..d65f688 100644 (file)
@@ -2117,6 +2117,10 @@ thread_db_set_thread_reg (struct gdbserv *serv,
   GREGSET_T gregset;
   td_err_e ret;
 
+  /* Initialize reg to 0 in the event that we return early due to a
+     register being unsupported.  */
+  gdbserv_ulonglong_to_reg (serv, 0LL, reg);
+
   if (thread == NULL)
     thread = process->event_thread;    /* Default to the event thread. */