]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 17 Apr 2011 19:12:20 +0000 (19:12 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 17 Apr 2011 19:12:20 +0000 (19:12 +0000)
* corelow.c: Include wrapper.h.
(core_open): Call now gdb_target_find_new_threads.
* wrapper.c: Include target.h.
(gdb_target_find_new_threads): New.
* wrapper.h (gdb_target_find_new_threads): New declaration.

gdb/ChangeLog
gdb/corelow.c
gdb/wrapper.c
gdb/wrapper.h

index 492082b61633312d38aee4ace0026bfa8405fcd0..9a862b129c5b9d6e545c94c55888881ca06c106f 100644 (file)
@@ -1,3 +1,11 @@
+2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * corelow.c: Include wrapper.h.
+       (core_open): Call now gdb_target_find_new_threads.
+       * wrapper.c: Include target.h.
+       (gdb_target_find_new_threads): New.
+       * wrapper.h (gdb_target_find_new_threads): New declaration.
+
 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * linux-thread-db.c (find_new_threads_callback): Exit on zero TI_TID
index f34b8e1b9d9eb69004144b82e56329211aef2f9e..33b96ae5fc128eccea64fe1860d4ed58bcbf35a8 100644 (file)
@@ -47,6 +47,7 @@
 #include "filenames.h"
 #include "progspace.h"
 #include "objfiles.h"
+#include "wrapper.h"
 
 
 #ifndef O_LARGEFILE
@@ -428,7 +429,7 @@ core_open (char *filename, int from_tty)
      may be a thread_stratum target loaded on top of target core by
      now.  The layer above should claim threads found in the BFD
      sections.  */
-  target_find_new_threads ();
+  gdb_target_find_new_threads ();
 
   p = bfd_core_file_failing_command (core_bfd);
   if (p)
index db3af3fb41cee0170fdee505135559a5a4a80307..951e6722b52c524323d9469be552dfdb63489822 100644 (file)
@@ -21,6 +21,7 @@
 #include "exceptions.h"
 #include "wrapper.h"
 #include "ui-out.h"
+#include "target.h"
 
 int
 gdb_parse_exp_1 (char **stringptr, struct block *block, int comma,
@@ -161,3 +162,24 @@ gdb_value_struct_elt (struct ui_out *uiout, struct value **result,
     return GDB_RC_FAIL;
   return GDB_RC_OK;
 }
+
+/* Call target_find_new_threads without throwing exception.  Exception is
+   printed if it got thrown.  */
+
+int
+gdb_target_find_new_threads (void)
+{
+  volatile struct gdb_exception except;
+
+  TRY_CATCH (except, RETURN_MASK_ERROR)
+    {
+      target_find_new_threads ();
+    }
+
+  if (except.reason < 0)
+    {
+      exception_print (gdb_stderr, except);
+      return 0;
+    }
+  return 1;
+}
index 068f17cbb3182e3d730acf3ca3e691f43a012be9..d50aab753f07a009346a231f9063431acbc6d8cc 100644 (file)
@@ -48,4 +48,6 @@ extern int gdb_value_ind (struct value *val, struct value ** rval);
 
 extern int gdb_parse_and_eval_type (char *, int, struct type **);
 
+extern int gdb_target_find_new_threads (void);
+
 #endif /* wrapper.h */