summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-04-17 19:12:19 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-04-17 19:12:19 +0000
commitfea1bf7eb2568918733232c055f4e2fc35d59b0d (patch)
tree8b32eb950ca6d5a491ca08cdc4c70217e2366350
parent77a09311dcf970abae1acbeb8f15649beec610d7 (diff)
downloadgdb-fea1bf7eb2568918733232c055f4e2fc35d59b0d.tar.gz
gdb/
* 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.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/corelow.c3
-rw-r--r--gdb/wrapper.c22
-rw-r--r--gdb/wrapper.h2
4 files changed, 34 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 492082b6163..9a862b129c5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
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
even if !TARGET_HAS_EXECUTION.
diff --git a/gdb/corelow.c b/gdb/corelow.c
index f34b8e1b9d9..33b96ae5fc1 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -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)
diff --git a/gdb/wrapper.c b/gdb/wrapper.c
index db3af3fb41c..951e6722b52 100644
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -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;
+}
diff --git a/gdb/wrapper.h b/gdb/wrapper.h
index 068f17cbb31..d50aab753f0 100644
--- a/gdb/wrapper.h
+++ b/gdb/wrapper.h
@@ -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 */