- Rebase to 8.1 release:
* ptype/o prints offsets and sizes of members (like pahole) * tab-completion improved: quoting function names is not generally necessary anymore, completion offers for breakpoint don't include data symbol * enable/disable breakpoints now accept ranges: 'disable 1.3-5' * new commands: - set/show cwd: working directory of debuggee - set/show compile-gcc: program to use for 'compile' command - starti: start program and stop at first instruction - TUI single-key commands: 'i' for stepi and 'o' for nexti * --readnever option disables any reading of debug info (for dumping) * s390: guarded storage register access for z14 * gcore option -a dumps all memory mapping * C++ breakpoints: 'b foo' will now set a breakpoint on all functions and methods named 'foo' no matter the scope. Use -qualified if you don't want that * python scripting: new events gdb.new_inferior, gdb.inferior_deleted and gdb.new_thread; new command rbreak (breakpoint accepting regexps) * gdbserver can be passed environment parameters to remote debuggee - Added patches from Fedora: gdb-ppc64-stwux-tautological-compare.patch gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch gdb-vla-intel-fix-print-char-array.patch - Removed unused gdb-libstdc++-v3-python-7.1.1-20170526.tar.bz2 - Removed obsolete upstream patches: gdb-s390x-1b63490.patch gdb-s390x-289e23a.patch gdb-s390x-8fe09d7.patch gdb-s390x-96235dc.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=177
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: workaround stale frame_info * (PR 13866)
|
||||
|
||||
FileName: gdb-stale-frame_info.patch
|
||||
|
||||
;; Workaround crashes from stale frame_info pointer (BZ 804256).
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2012-04/msg00058.html
|
||||
Subject: [downstream patch FYI] workaround stale frame_info * (PR 13866)
|
||||
|
||||
Hi,
|
||||
|
||||
@@ -21,39 +30,41 @@ testsuite under valgrind I did not find feasible.
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
|
||||
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
|
||||
gdb/
|
||||
2012-04-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Workaround PR backtrace/13866.
|
||||
* progspace.c (switch_to_program_space_and_thread): Try not to call
|
||||
switch_to_thread.
|
||||
---
|
||||
gdb/progspace-and-thread.c | 18 ++++++++++++++++--
|
||||
1 file changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/gdb/progspace.c
|
||||
+++ b/gdb/progspace.c
|
||||
@@ -481,17 +481,28 @@ save_current_space_and_thread (void)
|
||||
diff --git a/gdb/progspace-and-thread.c b/gdb/progspace-and-thread.c
|
||||
index 27d626b05f..ee6342d96a 100644
|
||||
--- a/gdb/progspace-and-thread.c
|
||||
+++ b/gdb/progspace-and-thread.c
|
||||
@@ -23,15 +23,29 @@
|
||||
void
|
||||
switch_to_program_space_and_thread (struct program_space *pspace)
|
||||
switch_to_program_space_and_thread (program_space *pspace)
|
||||
{
|
||||
- struct inferior *inf;
|
||||
+ struct inferior *inf = current_inferior ();
|
||||
|
||||
- inf = find_inferior_for_program_space (pspace);
|
||||
- inferior *inf = find_inferior_for_program_space (pspace);
|
||||
+ inferior *inf = current_inferior ();
|
||||
+
|
||||
+ if (inf->pspace != pspace)
|
||||
+ inf = find_inferior_for_program_space (pspace);
|
||||
|
||||
if (inf != NULL && inf->pid != 0)
|
||||
{
|
||||
- struct thread_info *tp;
|
||||
+ struct thread_info *tp, *current_tp = NULL;
|
||||
thread_info *tp = any_live_thread_of_process (inf->pid);
|
||||
+ thread_info *current_tp = NULL;
|
||||
+
|
||||
+ if (ptid_get_pid (inferior_ptid) == inf->pid)
|
||||
+ current_tp = find_thread_ptid (inferior_ptid);
|
||||
|
||||
tp = any_live_thread_of_process (inf->pid);
|
||||
if (tp != NULL)
|
||||
{
|
||||
- switch_to_thread (tp->ptid);
|
||||
@@ -68,107 +79,6 @@ gdb/
|
||||
/* Switching thread switches pspace implicitly. We're
|
||||
done. */
|
||||
return;
|
||||
--
|
||||
2.14.3
|
||||
|
||||
|
||||
Reproducer with:
|
||||
./gdb -nx ~/t/thread -ex 'b 24' -ex r -ex 'until 25'
|
||||
Breakpoint 1, main () at /home/jkratoch/t/thread.c:24
|
||||
24 v++;
|
||||
Segmentation fault (core dumped)
|
||||
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int v;
|
||||
|
||||
static void *start (void *arg)
|
||||
{
|
||||
v++;
|
||||
v++;
|
||||
v++;
|
||||
v++;
|
||||
sleep (100);
|
||||
return arg;
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
pthread_t thread1;
|
||||
int i;
|
||||
|
||||
i = pthread_create (&thread1, NULL, start, NULL);
|
||||
assert (i == 0);
|
||||
v++;
|
||||
v++;
|
||||
v++;
|
||||
v++;
|
||||
i = pthread_join (thread1, NULL);
|
||||
assert (i == 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
### --- a/gdb/frame.c
|
||||
### +++ b/gdb/frame.c
|
||||
### @@ -1522,12 +1522,30 @@ frame_observer_target_changed (struct target_ops *target)
|
||||
### reinit_frame_cache ();
|
||||
### }
|
||||
###
|
||||
### +typedef struct obstack obstack_s;
|
||||
### +DEF_VEC_O (obstack_s);
|
||||
### +static VEC (obstack_s) *frame_poison_vec;
|
||||
### +
|
||||
### +void frame_garbage_collection (void);
|
||||
### +void
|
||||
### +frame_garbage_collection (void)
|
||||
### +{
|
||||
### + struct obstack *obstack_p;
|
||||
### + int ix;
|
||||
### +
|
||||
### + for (ix = 0; VEC_iterate (obstack_s, frame_poison_vec, ix, obstack_p); ix++)
|
||||
### + obstack_free (obstack_p, 0);
|
||||
### +
|
||||
### + VEC_free (obstack_s, frame_poison_vec);
|
||||
### + frame_poison_vec = NULL;
|
||||
### +}
|
||||
### +
|
||||
### /* Flush the entire frame cache. */
|
||||
###
|
||||
### void
|
||||
### reinit_frame_cache (void)
|
||||
### {
|
||||
### - struct frame_info *fi;
|
||||
### + struct frame_info *fi, *fi_prev;
|
||||
###
|
||||
### /* Tear down all frame caches. */
|
||||
### for (fi = current_frame; fi != NULL; fi = fi->prev)
|
||||
### @@ -1538,8 +1556,14 @@ reinit_frame_cache (void)
|
||||
### fi->base->unwind->dealloc_cache (fi, fi->base_cache);
|
||||
### }
|
||||
###
|
||||
### + for (fi = current_frame; fi != NULL; fi = fi_prev)
|
||||
### + {
|
||||
### + fi_prev = fi->prev;
|
||||
### + memset (fi, 0, sizeof (*fi));
|
||||
### + }
|
||||
### + VEC_safe_push (obstack_s, frame_poison_vec, &frame_cache_obstack);
|
||||
### +
|
||||
### /* Since we can't really be sure what the first object allocated was. */
|
||||
### - obstack_free (&frame_cache_obstack, 0);
|
||||
### obstack_init (&frame_cache_obstack);
|
||||
###
|
||||
### if (current_frame != NULL)
|
||||
### --- a/gdb/top.c
|
||||
### +++ b/gdb/top.c
|
||||
### @@ -359,6 +359,11 @@ prepare_execute_command (void)
|
||||
### if (non_stop)
|
||||
### target_dcache_invalidate ();
|
||||
###
|
||||
### + {
|
||||
### + extern void frame_garbage_collection (void);
|
||||
### + frame_garbage_collection ();
|
||||
### + }
|
||||
### +
|
||||
### return cleanup;
|
||||
### }
|
||||
###
|
||||
|
Reference in New Issue
Block a user