1 http://sourceware.org/ml/gdb-patches/2011-02/msg00675.html
2 Subject: [patch 3/3] Display core reasons even during thread error
8 this is mostly unrelated. But after the patch 2/3 it will still FAIL:
9 Loaded symbols for /lib64/ld-linux-x86-64.so.2
10 Cannot find new threads: debugger service failed
11 (gdb) FAIL: gdb.threads/gcore-thread.exp: re-load generated corefile
13 as it is a common bug I dislike for years I have fixed it here:
14 Loaded symbols for /lib64/ld-linux-x86-64.so.2
15 Cannot find new threads: debugger service failed
16 Core was generated by `.../gdb/testsuite/gdb.threads/gcore-thread'.
17 Program terminated with signal 5, Trace/breakpoint trap.
18 #0 thread2 (arg=0xdeadbeef) at ./gdb.threads/pthreads.c:91
20 (gdb) PASS: gdb.threads/gcore-thread.exp: re-load generated corefile
22 No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu.
30 2011-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
32 * corelow.c: Include wrapper.h.
33 (core_open): Call now gdb_target_find_new_threads.
34 * wrapper.c: Include target.h.
35 (gdb_target_find_new_threads): New.
36 * wrapper.h (gdb_target_find_new_threads): New declaration.
42 #include "elf/common.h"
48 @@ -428,7 +429,7 @@ core_open (char *filename, int from_tty)
49 may be a thread_stratum target loaded on top of target core by
50 now. The layer above should claim threads found in the BFD
52 - target_find_new_threads ();
53 + gdb_target_find_new_threads ();
55 p = bfd_core_file_failing_command (core_bfd);
60 #include "exceptions.h"
66 gdb_parse_exp_1 (char **stringptr, struct block *block, int comma,
67 @@ -161,3 +162,24 @@ gdb_value_struct_elt (struct ui_out *uiout, struct value **result,
72 +/* Call target_find_new_threads without throwing exception. Exception is
73 + printed if it got thrown. */
76 +gdb_target_find_new_threads (void)
78 + volatile struct gdb_exception except;
80 + TRY_CATCH (except, RETURN_MASK_ERROR)
82 + target_find_new_threads ();
85 + if (except.reason < 0)
87 + exception_print (gdb_stderr, except);
94 @@ -48,4 +48,6 @@ extern int gdb_value_ind (struct value *val, struct value ** rval);
96 extern int gdb_parse_and_eval_type (char *, int, struct type **);
98 +extern int gdb_target_find_new_threads (void);
100 #endif /* wrapper.h */