]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-core-thread-internalerr-3of3.patch
- added devel deps for gdb-lib
[packages/gdb.git] / gdb-core-thread-internalerr-3of3.patch
1 http://sourceware.org/ml/gdb-patches/2011-02/msg00675.html
2 Subject: [patch 3/3] Display core reasons even during thread error
3
4 [ rediff ]
5
6 Hi,
7
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
12
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
19         91        int k = 0;
20         (gdb) PASS: gdb.threads/gcore-thread.exp: re-load generated corefile
21
22 No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu.
23
24
25 Thanks,
26 Jan
27
28
29 gdb/
30 2011-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
31
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.
37
38 --- a/gdb/corelow.c
39 +++ b/gdb/corelow.c
40 @@ -47,6 +47,7 @@
41  #include "auxv.h"
42  #include "elf/common.h"
43  #include "gdbcmd.h"
44 +#include "wrapper.h"
45  
46  
47  #ifndef O_LARGEFILE
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
51       sections.  */
52 -  target_find_new_threads ();
53 +  gdb_target_find_new_threads ();
54  
55    p = bfd_core_file_failing_command (core_bfd);
56    if (p)
57 --- a/gdb/wrapper.c
58 +++ b/gdb/wrapper.c
59 @@ -21,6 +21,7 @@
60  #include "exceptions.h"
61  #include "wrapper.h"
62  #include "ui-out.h"
63 +#include "target.h"
64  
65  int
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,
68      return GDB_RC_FAIL;
69    return GDB_RC_OK;
70  }
71 +
72 +/* Call target_find_new_threads without throwing exception.  Exception is
73 +   printed if it got thrown.  */
74 +
75 +int
76 +gdb_target_find_new_threads (void)
77 +{
78 +  volatile struct gdb_exception except;
79 +
80 +  TRY_CATCH (except, RETURN_MASK_ERROR)
81 +    {
82 +      target_find_new_threads ();
83 +    }
84 +
85 +  if (except.reason < 0)
86 +    {
87 +      exception_print (gdb_stderr, except);
88 +      return 0;
89 +    }
90 +  return 1;
91 +}
92 --- a/gdb/wrapper.h
93 +++ b/gdb/wrapper.h
94 @@ -48,4 +48,6 @@ extern int gdb_value_ind (struct value *val, struct value ** rval);
95  
96  extern int gdb_parse_and_eval_type (char *, int, struct type **);
97  
98 +extern int gdb_target_find_new_threads (void);
99 +
100  #endif /* wrapper.h */
101
This page took 0.078076 seconds and 3 git commands to generate.