|
Jan Kratochvil |
5752ad0 |
http://sourceware.org/ml/gdb-patches/2011-02/msg00675.html
|
|
Jan Kratochvil |
5752ad0 |
Subject: [patch 3/3] Display core reasons even during thread error
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
[ rediff ]
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
Hi,
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
this is mostly unrelated. But after the patch 2/3 it will still FAIL:
|
|
Jan Kratochvil |
5752ad0 |
Loaded symbols for /lib64/ld-linux-x86-64.so.2
|
|
Jan Kratochvil |
5752ad0 |
Cannot find new threads: debugger service failed
|
|
Jan Kratochvil |
5752ad0 |
(gdb) FAIL: gdb.threads/gcore-thread.exp: re-load generated corefile
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
as it is a common bug I dislike for years I have fixed it here:
|
|
Jan Kratochvil |
5752ad0 |
Loaded symbols for /lib64/ld-linux-x86-64.so.2
|
|
Jan Kratochvil |
5752ad0 |
Cannot find new threads: debugger service failed
|
|
Jan Kratochvil |
5752ad0 |
Core was generated by `.../gdb/testsuite/gdb.threads/gcore-thread'.
|
|
Jan Kratochvil |
5752ad0 |
Program terminated with signal 5, Trace/breakpoint trap.
|
|
Jan Kratochvil |
5752ad0 |
#0 thread2 (arg=0xdeadbeef) at ./gdb.threads/pthreads.c:91
|
|
Jan Kratochvil |
5752ad0 |
91 int k = 0;
|
|
Jan Kratochvil |
5752ad0 |
(gdb) PASS: gdb.threads/gcore-thread.exp: re-load generated corefile
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu.
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
Thanks,
|
|
Jan Kratochvil |
5752ad0 |
Jan
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
gdb/
|
|
Jan Kratochvil |
5752ad0 |
2011-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
* corelow.c: Include wrapper.h.
|
|
Jan Kratochvil |
5752ad0 |
(core_open): Call now gdb_target_find_new_threads.
|
|
Jan Kratochvil |
5752ad0 |
* wrapper.c: Include target.h.
|
|
Jan Kratochvil |
5752ad0 |
(gdb_target_find_new_threads): New.
|
|
Jan Kratochvil |
5752ad0 |
* wrapper.h (gdb_target_find_new_threads): New declaration.
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
--- a/gdb/corelow.c
|
|
Jan Kratochvil |
5752ad0 |
+++ b/gdb/corelow.c
|
|
Jan Kratochvil |
5752ad0 |
@@ -47,6 +47,7 @@
|
|
Jan Kratochvil |
5752ad0 |
#include "auxv.h"
|
|
Jan Kratochvil |
5752ad0 |
#include "elf/common.h"
|
|
Jan Kratochvil |
5752ad0 |
#include "gdbcmd.h"
|
|
Jan Kratochvil |
5752ad0 |
+#include "wrapper.h"
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
#ifndef O_LARGEFILE
|
|
Jan Kratochvil |
5752ad0 |
@@ -428,7 +429,7 @@ core_open (char *filename, int from_tty)
|
|
Jan Kratochvil |
5752ad0 |
may be a thread_stratum target loaded on top of target core by
|
|
Jan Kratochvil |
5752ad0 |
now. The layer above should claim threads found in the BFD
|
|
Jan Kratochvil |
5752ad0 |
sections. */
|
|
Jan Kratochvil |
5752ad0 |
- target_find_new_threads ();
|
|
Jan Kratochvil |
5752ad0 |
+ gdb_target_find_new_threads ();
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
p = bfd_core_file_failing_command (core_bfd);
|
|
Jan Kratochvil |
5752ad0 |
if (p)
|
|
Jan Kratochvil |
5752ad0 |
--- a/gdb/wrapper.c
|
|
Jan Kratochvil |
5752ad0 |
+++ b/gdb/wrapper.c
|
|
Jan Kratochvil |
5752ad0 |
@@ -21,6 +21,7 @@
|
|
Jan Kratochvil |
5752ad0 |
#include "exceptions.h"
|
|
Jan Kratochvil |
5752ad0 |
#include "wrapper.h"
|
|
Jan Kratochvil |
5752ad0 |
#include "ui-out.h"
|
|
Jan Kratochvil |
5752ad0 |
+#include "target.h"
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
int
|
|
Jan Kratochvil |
5752ad0 |
gdb_parse_exp_1 (char **stringptr, struct block *block, int comma,
|
|
Jan Kratochvil |
5752ad0 |
@@ -161,3 +162,24 @@ gdb_value_struct_elt (struct ui_out *uiout, struct value **result,
|
|
Jan Kratochvil |
5752ad0 |
return GDB_RC_FAIL;
|
|
Jan Kratochvil |
5752ad0 |
return GDB_RC_OK;
|
|
Jan Kratochvil |
5752ad0 |
}
|
|
Jan Kratochvil |
5752ad0 |
+
|
|
Jan Kratochvil |
5752ad0 |
+/* Call target_find_new_threads without throwing exception. Exception is
|
|
Jan Kratochvil |
5752ad0 |
+ printed if it got thrown. */
|
|
Jan Kratochvil |
5752ad0 |
+
|
|
Jan Kratochvil |
5752ad0 |
+int
|
|
Jan Kratochvil |
5752ad0 |
+gdb_target_find_new_threads (void)
|
|
Jan Kratochvil |
5752ad0 |
+{
|
|
Jan Kratochvil |
5752ad0 |
+ volatile struct gdb_exception except;
|
|
Jan Kratochvil |
5752ad0 |
+
|
|
Jan Kratochvil |
5752ad0 |
+ TRY_CATCH (except, RETURN_MASK_ERROR)
|
|
Jan Kratochvil |
5752ad0 |
+ {
|
|
Jan Kratochvil |
5752ad0 |
+ target_find_new_threads ();
|
|
Jan Kratochvil |
5752ad0 |
+ }
|
|
Jan Kratochvil |
5752ad0 |
+
|
|
Jan Kratochvil |
5752ad0 |
+ if (except.reason < 0)
|
|
Jan Kratochvil |
5752ad0 |
+ {
|
|
Jan Kratochvil |
5752ad0 |
+ exception_print (gdb_stderr, except);
|
|
Jan Kratochvil |
5752ad0 |
+ return 0;
|
|
Jan Kratochvil |
5752ad0 |
+ }
|
|
Jan Kratochvil |
5752ad0 |
+ return 1;
|
|
Jan Kratochvil |
5752ad0 |
+}
|
|
Jan Kratochvil |
5752ad0 |
--- a/gdb/wrapper.h
|
|
Jan Kratochvil |
5752ad0 |
+++ b/gdb/wrapper.h
|
|
Jan Kratochvil |
5752ad0 |
@@ -48,4 +48,6 @@ extern int gdb_value_ind (struct value *val, struct value ** rval);
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
extern int gdb_parse_and_eval_type (char *, int, struct type **);
|
|
Jan Kratochvil |
5752ad0 |
|
|
Jan Kratochvil |
5752ad0 |
+extern int gdb_target_find_new_threads (void);
|
|
Jan Kratochvil |
5752ad0 |
+
|
|
Jan Kratochvil |
5752ad0 |
#endif /* wrapper.h */
|
|
Jan Kratochvil |
5752ad0 |
|