!8 upgrade version to 8.3.1
Merge pull request !8 from HukunaMatata/upgradeVersion
This commit is contained in:
commit
ba14fedcb0
@ -1,11 +1,3 @@
|
||||
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: gdb-6.3-attach-see-vdso-test.patch
|
||||
|
||||
;; Test kernel VDSO decoding while attaching to an i386 process.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -113,3 +105,4 @@ new file mode 100644
|
||||
+# work.
|
||||
+
|
||||
+remote_exec build "kill -9 ${testpid}"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
||||
|
||||
;; Update PPC unwinding patches to their upstream variants (BZ 140532).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -318,3 +310,4 @@ diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arc
|
||||
verbose "Skipping PowerPC prologue tests."
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
|
||||
;; Testcase for exec() from threaded program (BZ 202689).
|
||||
;;=fedoratest
|
||||
|
||||
2007-01-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files.
|
||||
@ -107,3 +99,4 @@ new file mode 100644
|
||||
+ pass "Program exited"
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.3-focus-cmd-prev-test.patch
|
||||
|
||||
;; Test a crash on `focus cmd', `focus prev' commands.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -51,3 +43,4 @@ new file mode 100644
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Cagney <cagney@gnu.org>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-gstack-20050411.patch
|
||||
|
||||
;; Add a wrapper script to GDB that implements pstack using the
|
||||
;; --readnever option.
|
||||
;;=push
|
||||
|
||||
2004-11-23 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
|
||||
@ -16,7 +7,7 @@ Subject: gdb-6.3-gstack-20050411.patch
|
||||
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
||||
--- a/gdb/Makefile.in
|
||||
+++ b/gdb/Makefile.in
|
||||
@@ -1735,7 +1735,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
|
||||
@@ -1749,7 +1749,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
|
||||
install: all
|
||||
@$(MAKE) $(FLAGS_TO_PASS) install-only
|
||||
|
||||
@ -25,7 +16,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
||||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e "$$t"` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -1784,7 +1784,25 @@ install-guile:
|
||||
@@ -1798,7 +1798,25 @@ install-guile:
|
||||
install-python:
|
||||
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
|
||||
|
||||
@ -52,7 +43,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
||||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e $$t` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -1807,6 +1825,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
@@ -1821,6 +1839,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
fi
|
||||
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
||||
|
||||
@ -171,7 +162,7 @@ diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.e
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gstack.exp
|
||||
@@ -0,0 +1,66 @@
|
||||
@@ -0,0 +1,84 @@
|
||||
+# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
@ -202,6 +193,10 @@ new file mode 100644
|
||||
+ fail $test
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# The spawn id of the test inferior.
|
||||
+set test_spawn_id $res
|
||||
+
|
||||
+set use_gdb_stub 1
|
||||
+set pid [exp_pid -i $res]
|
||||
+gdb_expect {
|
||||
@ -217,7 +212,6 @@ new file mode 100644
|
||||
+ return
|
||||
+ }
|
||||
+}
|
||||
+gdb_exit
|
||||
+
|
||||
+# Testcase uses the most simple notification not to get caught by attach on
|
||||
+# exiting the function. Still we could retry the gstack command if we fail.
|
||||
@ -229,12 +223,28 @@ new file mode 100644
|
||||
+ perror "Spawning $command failed."
|
||||
+ fail $test
|
||||
+}
|
||||
+set pid [exp_pid -i $res]
|
||||
+
|
||||
+set gdb_spawn_id $res
|
||||
+
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+gdb_exit
|
||||
+
|
||||
+remote_exec host "kill -9 $pid"
|
||||
+gdb_test_multiple "" "gstack exits" {
|
||||
+ eof {
|
||||
+ set result [wait -i $gdb_spawn_id]
|
||||
+ verbose $result
|
||||
+
|
||||
+ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error"
|
||||
+ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0"
|
||||
+
|
||||
+ remote_close host
|
||||
+ clear_gdb_spawn_id
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Kill the test inferior.
|
||||
+kill_wait_spawned_process $test_spawn_id
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnston <jjohnstn@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-inferior-notification-20050721.patch
|
||||
|
||||
;; Notify observers that the inferior has been created
|
||||
;;=fedoratest
|
||||
|
||||
2005-07-21 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.base/attach-32.exp: New test for attaching in 32-bit
|
||||
@ -321,3 +313,4 @@ new file mode 100644
|
||||
+ }
|
||||
+ return (0);
|
||||
+}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnston <jjohnstn@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-inheritancetest-20050726.patch
|
||||
|
||||
;; Verify printing of inherited members test
|
||||
;;=fedoratest
|
||||
|
||||
2005-07-26 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* gdb.cp/b146835.exp: New testcase.
|
||||
@ -159,3 +151,4 @@ new file mode 100644
|
||||
+void A::funcD (class E *e, class D *d) {}
|
||||
+void A::funcE (E *e, D *d) {}
|
||||
+void A::funcF (unsigned long x, D *d) {}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.3-mapping-zero-inode-test.patch
|
||||
|
||||
;; Test GCORE for shmid 0 shared memory mappings.
|
||||
;;=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -245,3 +237,4 @@ new file mode 100644
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Cagney <cagney@gnu.org>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-ppc64displaysymbol-20041124.patch
|
||||
|
||||
;; Include the pc's section when doing a symbol lookup so that the
|
||||
;; correct symbol is found.
|
||||
;;=push: Write new testcase.
|
||||
|
||||
2004-11-24 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* printcmd.c (build_address_symbolic): Find a section for the
|
||||
address.
|
||||
|
||||
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
|
||||
--- a/gdb/printcmd.c
|
||||
+++ b/gdb/printcmd.c
|
||||
@@ -587,6 +587,14 @@ build_address_symbolic (struct gdbarch *gdbarch,
|
||||
addr = overlay_mapped_address (addr, section);
|
||||
}
|
||||
}
|
||||
+ /* To ensure that the symbol returned belongs to the correct setion
|
||||
+ (and that the last [random] symbol from the previous section
|
||||
+ isn't returned) try to find the section containing PC. First try
|
||||
+ the overlay code (which by default returns NULL); and second try
|
||||
+ the normal section code (which almost always succeeds). */
|
||||
+ section = find_pc_overlay (addr);
|
||||
+ if (section == NULL)
|
||||
+ section = find_pc_section (addr);
|
||||
|
||||
/* First try to find the address in the symbol table, then
|
||||
in the minsyms. Take the closest one. */
|
||||
@ -1,118 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Cagney <cagney@gnu.org>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-ppc64syscall-20040622.patch
|
||||
|
||||
;; Better parse 64-bit PPC system call prologues.
|
||||
;;=push: Write new testcase.
|
||||
|
||||
2004-06-22 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* rs6000-tdep.c (struct rs6000_framedata): Add field "func_start".
|
||||
(skip_prologue): Delete local variable "orig_pc", use
|
||||
"func_start". Add local variable "num_skip_linux_syscall_insn",
|
||||
use to skip over first half of a GNU/Linux syscall and update
|
||||
"func_start".
|
||||
|
||||
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
|
||||
--- a/gdb/rs6000-tdep.c
|
||||
+++ b/gdb/rs6000-tdep.c
|
||||
@@ -134,6 +134,7 @@ static const char *powerpc_vector_abi_string = "auto";
|
||||
|
||||
struct rs6000_framedata
|
||||
{
|
||||
+ CORE_ADDR func_start; /* True function start. */
|
||||
int offset; /* total size of frame --- the distance
|
||||
by which we decrement sp to allocate
|
||||
the frame */
|
||||
@@ -1426,7 +1427,6 @@ static CORE_ADDR
|
||||
skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
|
||||
struct rs6000_framedata *fdata)
|
||||
{
|
||||
- CORE_ADDR orig_pc = pc;
|
||||
CORE_ADDR last_prologue_pc = pc;
|
||||
CORE_ADDR li_found_pc = 0;
|
||||
gdb_byte buf[4];
|
||||
@@ -1445,12 +1445,14 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
|
||||
int minimal_toc_loaded = 0;
|
||||
int prev_insn_was_prologue_insn = 1;
|
||||
int num_skip_non_prologue_insns = 0;
|
||||
+ int num_skip_ppc64_gnu_linux_syscall_insn = 0;
|
||||
int r0_contains_arg = 0;
|
||||
const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch);
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
|
||||
memset (fdata, 0, sizeof (struct rs6000_framedata));
|
||||
+ fdata->func_start = pc;
|
||||
fdata->saved_gpr = -1;
|
||||
fdata->saved_fpr = -1;
|
||||
fdata->saved_vr = -1;
|
||||
@@ -1484,6 +1486,55 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
|
||||
break;
|
||||
op = extract_unsigned_integer (buf, 4, byte_order);
|
||||
|
||||
+ /* A PPC64 GNU/Linux system call function is split into two
|
||||
+ sub-functions: a non-threaded fast-path (__NAME_nocancel)
|
||||
+ which does not use a frame; and a threaded slow-path
|
||||
+ (Lpseudo_cancel) that does create a frame. Ref:
|
||||
+ nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
|
||||
+
|
||||
+ *INDENT-OFF*
|
||||
+ NAME:
|
||||
+ SINGLE_THREAD_P
|
||||
+ bne- .Lpseudo_cancel
|
||||
+ __NAME_nocancel:
|
||||
+ li r0,162
|
||||
+ sc
|
||||
+ bnslr+
|
||||
+ b 0x7fe014ef64 <.__syscall_error>
|
||||
+ Lpseudo_cancel:
|
||||
+ stdu r1,-128(r1)
|
||||
+ ...
|
||||
+ *INDENT-ON*
|
||||
+
|
||||
+ Unfortunatly, because the latter case uses a local label (not
|
||||
+ in the symbol table) a PC in "Lpseudo_cancel" appears to be
|
||||
+ in "__NAME_nocancel". The following code recognizes this,
|
||||
+ adjusting FUNC_START to point to where "Lpseudo_cancel"
|
||||
+ should be, and parsing the prologue sequence as if
|
||||
+ "Lpseudo_cancel" was the entry point. */
|
||||
+
|
||||
+ if (((op & 0xffff0000) == 0x38000000 /* li r0,N */
|
||||
+ && pc == fdata->func_start + 0
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 0)
|
||||
+ || (op == 0x44000002 /* sc */
|
||||
+ && pc == fdata->func_start + 4
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 1)
|
||||
+ || (op == 0x4ca30020 /* bnslr+ */
|
||||
+ && pc == fdata->func_start + 8
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 2))
|
||||
+ {
|
||||
+ num_skip_ppc64_gnu_linux_syscall_insn++;
|
||||
+ continue;
|
||||
+ }
|
||||
+ else if ((op & 0xfc000003) == 0x48000000 /* b __syscall_error */
|
||||
+ && pc == fdata->func_start + 12
|
||||
+ && num_skip_ppc64_gnu_linux_syscall_insn == 3)
|
||||
+ {
|
||||
+ num_skip_ppc64_gnu_linux_syscall_insn = -1;
|
||||
+ fdata->func_start = pc;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
if ((op & 0xfc1fffff) == 0x7c0802a6)
|
||||
{ /* mflr Rx */
|
||||
/* Since shared library / PIC code, which needs to get its
|
||||
@@ -1673,9 +1724,9 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
|
||||
we have no line table information or the line info tells
|
||||
us that the subroutine call is not part of the line
|
||||
associated with the prologue. */
|
||||
- if ((pc - orig_pc) > 8)
|
||||
+ if ((pc - fdata->func_start) > 8)
|
||||
{
|
||||
- struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
|
||||
+ struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0);
|
||||
struct symtab_and_line this_sal = find_pc_line (pc, 0);
|
||||
|
||||
if ((prologue_sal.line == 0)
|
||||
@ -1,35 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Cagney <cagney@gnu.org>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-readnever-20050907.patch
|
||||
|
||||
;; Add readnever option
|
||||
;;=push
|
||||
|
||||
2004-11-18 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* dwarf2read.c: Include "top.c".
|
||||
(dwarf2_has_info): Check for readnever_symbol_files.
|
||||
* symfile.c (readnever_symbol_files): Define.
|
||||
* top.h (readnever_symbol_files): Declare.
|
||||
* main.c (captured_main): Add --readnever option.
|
||||
(print_gdb_help): Ditto.
|
||||
|
||||
2004-11-18 Andrew Cagney <cagney@gnu.org>
|
||||
|
||||
* gdb.texinfo (File Options): Document --readnever.
|
||||
|
||||
Pushed upstream: https://sourceware.org/ml/gdb-cvs/2017-12/msg00007.html
|
||||
|
||||
diff --git a/gdb/gcore.in b/gdb/gcore.in
|
||||
--- a/gdb/gcore.in
|
||||
+++ b/gdb/gcore.in
|
||||
@@ -97,7 +97,7 @@ for pid in "$@"
|
||||
do
|
||||
# `</dev/null' to avoid touching interactive terminal if it is
|
||||
# available but not accessible as GDB would get stopped on SIGTTIN.
|
||||
- "$binary_path/@GDB_TRANSFORM_NAME@" </dev/null --nx --batch \
|
||||
+ "$binary_path/@GDB_TRANSFORM_NAME@" </dev/null --nx --batch --readnever \
|
||||
-ex "set pagination off" -ex "set height 0" -ex "set width 0" \
|
||||
"${dump_all_cmds[@]}" \
|
||||
-ex "attach $pid" -ex "gcore $name.$pid" -ex detach -ex quit
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.3-test-dtorfix-20050121.patch
|
||||
|
||||
;; Test support of multiple destructors just like multiple constructors
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.cp/constructortest.cc b/gdb/testsuite/gdb.cp/constructortest.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -245,3 +237,4 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+gdb_continue_to_breakpoint "First line ~C"
|
||||
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Elena Zannoni <ezannoni@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-test-movedir-20050125.patch
|
||||
|
||||
;; Fix to support executable moving
|
||||
;;=fedoratest
|
||||
|
||||
2005-01-25 Elena Zannoni <ezannoni@redhat.com>
|
||||
i2005-01-25 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* gdb.base/move-dir.exp: New test.
|
||||
* gdb.base/move-dir.c: Ditto.
|
||||
@ -101,3 +93,4 @@ new file mode 100644
|
||||
+ printf ("%s\n", ostring);;
|
||||
+}
|
||||
+
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.3-test-pie-20050107.patch
|
||||
|
||||
;; VSYSCALL and PIE
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.pie/attach.c b/gdb/testsuite/gdb.pie/attach.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -2025,3 +2017,4 @@ new file mode 100644
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Elena Zannoni <ezannoni@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-test-self-20050110.patch
|
||||
|
||||
;; Get selftest working with sep-debug-info
|
||||
;;=fedoratest
|
||||
|
||||
2004-02-23 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* gdb.gdb/selftest.exp: Make sure that the debug directory is
|
||||
@ -40,3 +32,4 @@ diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest
|
||||
|
||||
if {$result < 0} then {
|
||||
warning "Couldn't test self"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnston <jjohnstn@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
|
||||
;; Test sibling threads to set threaded watchpoints for x86 and x86-64
|
||||
;;=fedoratest
|
||||
|
||||
2005-02-28 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* config/i386/nm-linux.h: Change dr register routines to
|
||||
@ -252,3 +244,4 @@ new file mode 100644
|
||||
+} else {
|
||||
+ fail $message
|
||||
+}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-BEA-testsuite.patch
|
||||
|
||||
;; Improved testsuite results by the testsuite provided by the courtesy of BEA.
|
||||
;;=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.c b/gdb/testsuite/gdb.threads/threadcrash.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -936,3 +928,4 @@ new file mode 100644
|
||||
+rm -rf $WORKDIR
|
||||
+
|
||||
+exit $FAILURES
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
||||
|
||||
;; Find symbols properly at their original (included) file (BZ 109921).
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
|
||||
|
||||
It is duplicite to its upstream variant:
|
||||
@ -132,3 +124,4 @@ new file mode 100644
|
||||
+ USA. */
|
||||
+
|
||||
+int integer;
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
|
||||
;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
|
||||
;;=push+jan: It should be replaced by Infinity project.
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
|
||||
|
||||
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
@ -44,7 +36,7 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
|
||||
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
|
||||
--- a/gdb/printcmd.c
|
||||
+++ b/gdb/printcmd.c
|
||||
@@ -1190,6 +1190,10 @@ print_command_1 (const char *exp, int voidprint)
|
||||
@@ -1183,6 +1183,10 @@ print_command_1 (const char *exp, int voidprint)
|
||||
|
||||
if (exp && *exp)
|
||||
{
|
||||
@ -262,3 +254,4 @@ new file mode 100644
|
||||
+
|
||||
+# TODO: Test the error on resolving ERRNO with only libc loaded.
|
||||
+# Just how to find the current libc filename?
|
||||
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
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: gdb-6.5-bz203661-emit-relocs.patch
|
||||
|
||||
;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
|
||||
;;=push+jan: There was some mail thread about it, this patch may be a hack.
|
||||
|
||||
diff --git a/gdb/symfile.c b/gdb/symfile.c
|
||||
--- a/gdb/symfile.c
|
||||
+++ b/gdb/symfile.c
|
||||
@@ -3584,6 +3584,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
|
||||
DWO file. */
|
||||
bfd *abfd = sectp->owner;
|
||||
|
||||
+ /* Executable files have all the relocations already resolved.
|
||||
+ Handle files linked with --emit-relocs.
|
||||
+ http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */
|
||||
+ if ((abfd->flags & EXEC_P) != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
/* We're only interested in sections with relocation
|
||||
information. */
|
||||
if ((sectp->flags & SEC_RELOC) == 0)
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz216711-clone-is-outermost.patch
|
||||
|
||||
;; Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
|
||||
;;=fedora
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
|
||||
|
||||
FIXME: This workaround should be dropped and
|
||||
@ -127,7 +119,7 @@ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
|
||||
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
|
||||
--- a/gdb/amd64-tdep.c
|
||||
+++ b/gdb/amd64-tdep.c
|
||||
@@ -2595,6 +2595,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
|
||||
@@ -2601,6 +2601,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
|
||||
{
|
||||
struct amd64_frame_cache *cache =
|
||||
amd64_frame_cache (this_frame, this_cache);
|
||||
@ -135,7 +127,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
|
||||
|
||||
if (!cache->base_p)
|
||||
return UNWIND_UNAVAILABLE;
|
||||
@@ -2603,6 +2604,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
|
||||
@@ -2609,6 +2610,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
|
||||
if (cache->base == 0)
|
||||
return UNWIND_OUTERMOST;
|
||||
|
||||
@ -146,7 +138,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
|
||||
return UNWIND_NO_REASON;
|
||||
}
|
||||
|
||||
@@ -2737,6 +2742,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
|
||||
@@ -2743,6 +2748,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
|
||||
{
|
||||
struct amd64_frame_cache *cache =
|
||||
amd64_sigtramp_frame_cache (this_frame, this_cache);
|
||||
@ -154,7 +146,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
|
||||
|
||||
if (!cache->base_p)
|
||||
(*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
|
||||
@@ -2745,6 +2751,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
|
||||
@@ -2751,6 +2757,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
|
||||
/* This marks the outermost frame. */
|
||||
return;
|
||||
}
|
||||
@ -169,7 +161,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
|
||||
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
|
||||
--- a/gdb/i386-tdep.c
|
||||
+++ b/gdb/i386-tdep.c
|
||||
@@ -8406,6 +8406,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
@@ -8407,6 +8407,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
|
||||
tdep->xsave_xcr0_offset = -1;
|
||||
|
||||
@ -302,3 +294,4 @@ new file mode 100644
|
||||
+ pass "0x0 entry not found"
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
|
||||
;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c
|
||||
@ -100,3 +92,4 @@ new file mode 100644
|
||||
+ fail "stepped into trampoline"
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,17 +1,9 @@
|
||||
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: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
|
||||
;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
|
||||
;;=fedora
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
||||
|
||||
diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
--- a/gdb/symtab.c
|
||||
+++ b/gdb/symtab.c
|
||||
@@ -3165,6 +3165,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
@@ -3177,6 +3177,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
SYMBOL_LINKAGE_NAME (msymbol)); */
|
||||
;
|
||||
/* fall through */
|
||||
@ -25,3 +17,4 @@ diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
else
|
||||
return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
|
||||
;; Test leftover zombie process (BZ 243845).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -86,3 +78,4 @@ new file mode 100644
|
||||
+} else {
|
||||
+ fail $test
|
||||
+}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-gcore-buffer-limit-test.patch
|
||||
|
||||
;; Test gcore memory and time requirements for large inferiors.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -147,3 +139,4 @@ new file mode 100644
|
||||
+
|
||||
+# Cleanup.
|
||||
+exec kill -9 $pid_of_bin
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-ia64-libunwind-leak-test.patch
|
||||
|
||||
;; Test ia64 memory leaks of the code using libunwind.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/unwind-leak.c b/gdb/testsuite/gdb.base/unwind-leak.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -128,3 +120,4 @@ new file mode 100644
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-last-address-space-byte-test.patch
|
||||
|
||||
;; Testcase for deadlocking on last address space byte; for corrupted backtraces.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/largecore-last-address-lock.exp b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -60,3 +52,4 @@ new file mode 100644
|
||||
+ "Read the last address space byte"
|
||||
+
|
||||
+set timeout ${timeoutold}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-missed-trap-on-step-test.patch
|
||||
|
||||
;; Test hiding unexpected breakpoints on intentional step commands.
|
||||
;;=fedoratest
|
||||
|
||||
Fix has been committed to:
|
||||
gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
|
||||
|
||||
@ -93,3 +85,4 @@ new file mode 100644
|
||||
+# we step from as in this case it is a valid upstream KFAIL gdb/38
|
||||
+
|
||||
+gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint"
|
||||
|
||||
|
||||
@ -1,18 +1,10 @@
|
||||
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: gdb-6.5-readline-long-line-crash-test.patch
|
||||
|
||||
;; Fix readline segfault on excessively long hand-typed lines.
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/readline-overflow.exp
|
||||
@@ -0,0 +1,126 @@
|
||||
@@ -0,0 +1,104 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
@ -44,98 +36,77 @@ new file mode 100644
|
||||
+ strace $tracelevel
|
||||
+}
|
||||
+
|
||||
+# Don't let a .inputrc file or an existing setting of INPUTRC mess up
|
||||
+# the test results. Even if /dev/null doesn't exist on the particular
|
||||
+# platform, the readline library will use the default setting just by
|
||||
+# failing to open the file. OTOH, opening /dev/null successfully will
|
||||
+# also result in the default settings being used since nothing will be
|
||||
+# read from this file.
|
||||
+global env
|
||||
+if [info exists env(INPUTRC)] {
|
||||
+ set old_inputrc $env(INPUTRC)
|
||||
+}
|
||||
+set env(INPUTRC) "/dev/null"
|
||||
+
|
||||
+set oldtimeout1 $timeout
|
||||
+set timeout 600
|
||||
+save_vars { env(INPUTRC) env(GDBHISTFILE) env(HISTSIZE) TERM timeout } {
|
||||
+ # The arrow key test relies on the standard VT100 bindings, so
|
||||
+ # make sure that an appropriate terminal is selected. The same
|
||||
+ # bug doesn't show up if we use ^P / ^N instead.
|
||||
+ setenv TERM vt100
|
||||
+
|
||||
+if [info exists env(GDBHISTFILE)] {
|
||||
+ set old_gdbhistfile $env(GDBHISTFILE)
|
||||
+}
|
||||
+if [info exists env(HISTSIZE)] {
|
||||
+ set old_histsize $env(HISTSIZE)
|
||||
+}
|
||||
+set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
|
||||
+set env(HISTSIZE) "10"
|
||||
+ # Don't let a .inputrc file or an existing setting of INPUTRC mess up
|
||||
+ # the test results. Even if /dev/null doesn't exist on the particular
|
||||
+ # platform, the readline library will use the default setting just by
|
||||
+ # failing to open the file. OTOH, opening /dev/null successfully will
|
||||
+ # also result in the default settings being used since nothing will be
|
||||
+ # read from this file.
|
||||
+ set env(INPUTRC) "/dev/null"
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ set timeout 600
|
||||
+
|
||||
+ set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
|
||||
+ set env(HISTSIZE) "10"
|
||||
+
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+
|
||||
+set width 11
|
||||
+gdb_test "set width $width" \
|
||||
+ "" \
|
||||
+ "Setting width to $width."
|
||||
+#gdb_test "set height 1" \
|
||||
+# "" \
|
||||
+# "Setting height to 1."
|
||||
+send_gdb "run X"
|
||||
+set i 0
|
||||
+# It crashes using `set width 7' on `set total 3560'.
|
||||
+# Sometimes it corrupts screen on `set width 7'.
|
||||
+# Bugreport used `set total 130001':
|
||||
+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
|
||||
+# Check also `timeout' above.
|
||||
+set total 4200
|
||||
+gdb_expect {
|
||||
+ set width 11
|
||||
+ gdb_test "set width $width" \
|
||||
+ "" \
|
||||
+ "Setting width to $width."
|
||||
+ #gdb_test "set height 1" \
|
||||
+ # "" \
|
||||
+ # "Setting height to 1."
|
||||
+ send_gdb "run X"
|
||||
+ set i 0
|
||||
+ # It crashes using `set width 7' on `set total 3560'.
|
||||
+ # Sometimes it corrupts screen on `set width 7'.
|
||||
+ # Bugreport used `set total 130001':
|
||||
+ # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
|
||||
+ # Check also `timeout' above.
|
||||
+ set total 4200
|
||||
+ gdb_expect {
|
||||
+ -re X {
|
||||
+ incr i
|
||||
+ if {$i <= $total} {
|
||||
+ send_gdb "X"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ incr i
|
||||
+ if {$i <= $total} {
|
||||
+ send_gdb "X"
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ }
|
||||
+ -re "\[ \b\r\n\]" {
|
||||
+ exp_continue
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ eof {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: EOF"
|
||||
+ gdb_clear_suppressed
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: EOF"
|
||||
+ gdb_clear_suppressed
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
|
||||
+ gdb_clear_suppressed
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
|
||||
+ gdb_clear_suppressed
|
||||
+ }
|
||||
+ default {
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
|
||||
+ gdb_clear_suppressed
|
||||
+ fail "gdb sending total $total characters"
|
||||
+ note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
|
||||
+ gdb_clear_suppressed
|
||||
+ }
|
||||
+ }
|
||||
+ send_gdb "\r"
|
||||
+ gdb_test "" \
|
||||
+ "No executable file specified..*" \
|
||||
+ "All the characters transferred"
|
||||
+}
|
||||
+send_gdb "\r"
|
||||
+gdb_test "" \
|
||||
+ "No executable file specified..*" \
|
||||
+ "All the characters transferred"
|
||||
+
|
||||
+
|
||||
+# Restore globals modified in this test...
|
||||
+if [info exists old_inputrc] {
|
||||
+ set env(INPUTRC) $old_inputrc
|
||||
+} else {
|
||||
+ unset env(INPUTRC)
|
||||
+}
|
||||
+if [info exists old_gdbhistfile] {
|
||||
+ set env(GDBHISTFILE) $old_gdbhistfile
|
||||
+} else {
|
||||
+ unset env(GDBHISTFILE)
|
||||
+}
|
||||
+if [info exists old_histsize] {
|
||||
+ set env(HISTSIZE) $old_histsize
|
||||
+} else {
|
||||
+ unset env(HISTSIZE)
|
||||
+}
|
||||
+set timeout $oldtimeout1
|
||||
+
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.5-section-num-fixup-test.patch
|
||||
|
||||
;; Test a crash on libraries missing the .text section.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -120,3 +112,4 @@ new file mode 100644
|
||||
+gdb_test "start" \
|
||||
+ "main \\(\\) at .*${srcfilemain}.*" \
|
||||
+ "start"
|
||||
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-sharedlibrary-path.patch
|
||||
|
||||
;; Fix TLS symbols resolving for shared libraries with a relative pathname.
|
||||
;; The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
|
||||
;;=fedoratest: One should recheck if it is really fixed upstream.
|
||||
|
||||
If you provided some relative path to the shared library, such as with
|
||||
export LD_LIBRARY_PATH=.
|
||||
then gdb would fail to match the shared library name during the TLS lookup.
|
||||
@ -178,3 +169,4 @@ new file mode 100644
|
||||
+ "\\\$1 = \[0-9\].*" \
|
||||
+ "print TLS variable from a shared library with $name-directory separate debug info file"
|
||||
+}
|
||||
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
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: gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-01/msg00558.html
|
||||
|
||||
[ Fixed up since the mail. ]
|
||||
@ -85,7 +78,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "readline/readline.h"
|
||||
@@ -357,12 +358,27 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
@@ -355,12 +356,27 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
|
||||
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
|
||||
{
|
||||
@ -102,7 +95,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
exec_close ();
|
||||
- error (_("\"%s\": not in executable format: %s"),
|
||||
- scratch_pathname,
|
||||
- gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||
- gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
+
|
||||
+ if (is_core != 0)
|
||||
+ throw_error (IS_CORE_ERROR,
|
||||
@ -112,14 +105,14 @@ diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
+ else
|
||||
+ error (_("\"%s\": not in executable format: %s"),
|
||||
+ scratch_pathname,
|
||||
+ gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||
+ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
}
|
||||
|
||||
if (build_section_table (exec_bfd, §ions, §ions_end))
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -447,6 +447,37 @@ struct cmdarg
|
||||
@@ -448,6 +448,35 @@ struct cmdarg
|
||||
char *string;
|
||||
};
|
||||
|
||||
@ -130,8 +123,6 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
+static void
|
||||
+exec_or_core_file_attach (const char *filename, int from_tty)
|
||||
+{
|
||||
+ volatile struct gdb_exception e;
|
||||
+
|
||||
+ gdb_assert (exec_bfd == NULL);
|
||||
+
|
||||
+ TRY
|
||||
@ -157,7 +148,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
static void
|
||||
captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
@@ -883,6 +914,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -893,6 +922,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
symarg = argv[optind];
|
||||
execarg = argv[optind];
|
||||
@ -166,7 +157,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
optind++;
|
||||
}
|
||||
|
||||
@@ -1033,11 +1066,25 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -1043,12 +1074,25 @@ captured_main_1 (struct captured_main_args *context)
|
||||
&& symarg != NULL
|
||||
&& strcmp (execarg, symarg) == 0)
|
||||
{
|
||||
@ -185,13 +176,15 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
/* The exec file and the symbol-file are the same. If we can't
|
||||
open it, better only print one error message.
|
||||
- catch_command_errors returns non-zero on success! */
|
||||
- if (catch_command_errors (exec_file_attach, execarg,
|
||||
- !batch_flag))
|
||||
- ret = catch_command_errors (exec_file_attach, execarg,
|
||||
- !batch_flag);
|
||||
- if (ret != 0)
|
||||
+ catch_command_errors returns non-zero on success!
|
||||
+ Do not load EXECARG as a symbol file if it has been already processed
|
||||
+ as a core file. */
|
||||
+ if (catch_command_errors (func, execarg, !batch_flag)
|
||||
+ && core_bfd == NULL)
|
||||
catch_command_errors (symbol_file_add_main_adapter, symarg,
|
||||
!batch_flag);
|
||||
+ ret = catch_command_errors (func, execarg, !batch_flag);
|
||||
+ if (ret != 0 && core_bfd == NULL)
|
||||
ret = catch_command_errors (symbol_file_add_main_adapter,
|
||||
symarg, !batch_flag);
|
||||
}
|
||||
|
||||
|
||||
@ -1,13 +1,3 @@
|
||||
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:
|
||||
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
|
||||
;; Fix 'gdb gives highly misleading error when debuginfo pkg is present,
|
||||
;; but not corresponding binary pkg' (RH BZ 981154).
|
||||
;;=push+jan
|
||||
|
||||
Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
|
||||
|
||||
This is the fix for RH BZ #981154
|
||||
@ -25,21 +15,6 @@ Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
|
||||
NULL after it is free'd, otherwise the code below thinks that it is still
|
||||
valid and doesn't print the necessary warning ("Try: yum install ...").
|
||||
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -581,7 +581,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
|
||||
do_cleanups (inner);
|
||||
|
||||
if (abfd == NULL)
|
||||
- continue;
|
||||
+ {
|
||||
+ filename = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
if (build_id_verify (abfd.get(), build_id_len, build_id))
|
||||
break;
|
||||
diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -142,3 +117,4 @@ new file mode 100644
|
||||
+
|
||||
+# Leaving the link there will cause breakage in the next run.
|
||||
+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
|
||||
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -652,6 +652,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
@@ -712,6 +712,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
@ -40,3 +32,4 @@ diff --git a/gdb/proc-service.list b/gdb/proc-service.list
|
||||
+ /* gdb-6.6-buildid-locate-rpm.patch */
|
||||
+ rpmsqEnable;
|
||||
};
|
||||
|
||||
|
||||
@ -1,18 +1,10 @@
|
||||
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: gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
|
||||
;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
|
||||
;;=push+jan
|
||||
|
||||
warning: Skipping deprecated .gdb_index section
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=953585
|
||||
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -689,7 +689,11 @@ static int missing_rpm_list_entries;
|
||||
@@ -746,7 +746,11 @@ static int missing_rpm_list_entries;
|
||||
/* Returns the count of newly added rpms. */
|
||||
|
||||
static int
|
||||
@ -24,7 +16,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
{
|
||||
static int rpm_init_done = 0;
|
||||
rpmts ts;
|
||||
@@ -796,7 +800,11 @@ missing_rpm_enlist (const char *filename)
|
||||
@@ -853,7 +857,11 @@ missing_rpm_enlist (const char *filename)
|
||||
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
|
||||
if (mi != NULL)
|
||||
{
|
||||
@ -36,7 +28,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
{
|
||||
Header h;
|
||||
char *debuginfo, **slot, *s, *s2;
|
||||
@@ -914,6 +922,37 @@ missing_rpm_enlist (const char *filename)
|
||||
@@ -971,6 +979,37 @@ missing_rpm_enlist (const char *filename)
|
||||
xfree (debuginfo);
|
||||
count++;
|
||||
}
|
||||
@ -74,7 +66,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
|
||||
rpmdbFreeIterator_p (mi);
|
||||
}
|
||||
@@ -924,6 +963,21 @@ missing_rpm_enlist (const char *filename)
|
||||
@@ -981,6 +1020,21 @@ missing_rpm_enlist (const char *filename)
|
||||
}
|
||||
|
||||
static int
|
||||
@ -99,7 +91,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -3469,6 +3469,16 @@ read_gdb_index_from_section (struct objfile *objfile,
|
||||
@@ -3501,6 +3501,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
|
||||
"set use-deprecated-index-sections on". */
|
||||
if (version < 6 && !deprecated_ok)
|
||||
{
|
||||
@ -116,7 +108,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
static int warning_printed = 0;
|
||||
if (!warning_printed)
|
||||
{
|
||||
@@ -3480,6 +3490,10 @@ to use the section anyway."),
|
||||
@@ -3512,6 +3522,10 @@ to use the section anyway."),
|
||||
warning_printed = 1;
|
||||
}
|
||||
return 0;
|
||||
@ -127,3 +119,4 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
}
|
||||
/* Version 7 indices generated by gold refer to the CU for a symbol instead
|
||||
of the TU (for symbols coming from TUs),
|
||||
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
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: gdb-6.6-buildid-locate-rpm.patch
|
||||
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
|
||||
--- a/gdb/aclocal.m4
|
||||
+++ b/gdb/aclocal.m4
|
||||
@ -244,7 +237,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
|
||||
#define BUILD_ID_VERBOSE_NONE 0
|
||||
#define BUILD_ID_VERBOSE_FILENAMES 1
|
||||
@@ -640,8 +642,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
@@ -700,8 +702,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -612,7 +605,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
avoidance. */
|
||||
|
||||
struct missing_filepair
|
||||
@@ -695,11 +1055,17 @@ missing_filepair_change (void)
|
||||
@@ -755,11 +1115,17 @@ missing_filepair_change (void)
|
||||
/* All their memory came just from missing_filepair_OBSTACK. */
|
||||
missing_filepair_hash = NULL;
|
||||
}
|
||||
@ -630,7 +623,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
missing_filepair_change ();
|
||||
}
|
||||
|
||||
@@ -766,14 +1132,39 @@ debug_print_missing (const char *binary, const char *debug)
|
||||
@@ -826,14 +1192,39 @@ debug_print_missing (const char *binary, const char *debug)
|
||||
|
||||
*slot = missing_filepair;
|
||||
|
||||
@ -690,7 +683,7 @@ diff --git a/gdb/config.in b/gdb/config.in
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
@@ -270,6 +273,9 @@
|
||||
@@ -261,6 +264,9 @@
|
||||
/* Define if Python 2.7 is being used. */
|
||||
#undef HAVE_LIBPYTHON2_7
|
||||
|
||||
@ -703,7 +696,7 @@ diff --git a/gdb/config.in b/gdb/config.in
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -749,6 +749,11 @@ CODESIGN_CERT
|
||||
@@ -751,6 +751,11 @@ CODESIGN_CERT
|
||||
HAVE_NATIVE_GCORE_TARGET
|
||||
TARGET_OBS
|
||||
subdirs
|
||||
@ -715,15 +708,15 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
GDB_DATADIR
|
||||
DEBUGDIR
|
||||
MAKEINFO_EXTRA_FLAGS
|
||||
@@ -853,6 +858,7 @@ with_gdb_datadir
|
||||
@@ -855,6 +860,7 @@ with_gdb_datadir
|
||||
with_relocated_sources
|
||||
with_auto_load_dir
|
||||
with_auto_load_safe_path
|
||||
+with_rpm
|
||||
enable_targets
|
||||
enable_64_bit_bfd
|
||||
enable_gdbcli
|
||||
@@ -912,6 +918,11 @@ CCC
|
||||
enable_gdbmi
|
||||
@@ -915,6 +921,11 @@ CCC
|
||||
CPP
|
||||
MAKEINFO
|
||||
MAKEINFOFLAGS
|
||||
@ -735,7 +728,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
YACC
|
||||
YFLAGS
|
||||
XMKMF'
|
||||
@@ -1583,6 +1594,8 @@ Optional Packages:
|
||||
@@ -1588,6 +1599,8 @@ Optional Packages:
|
||||
[--with-auto-load-dir]
|
||||
--without-auto-load-safe-path
|
||||
do not restrict auto-loaded files locations
|
||||
@ -744,7 +737,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
|
||||
--with-curses use the curses library instead of the termcap
|
||||
library
|
||||
@@ -1640,6 +1653,13 @@ Some influential environment variables:
|
||||
@@ -1645,6 +1658,13 @@ Some influential environment variables:
|
||||
MAKEINFO Parent configure detects if it is of sufficient version.
|
||||
MAKEINFOFLAGS
|
||||
Parameters for MAKEINFO.
|
||||
@ -758,7 +751,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
YACC The `Yet Another Compiler Compiler' implementation to use.
|
||||
Defaults to the first program found out of: `bison -y', `byacc',
|
||||
`yacc'.
|
||||
@@ -6575,6 +6595,494 @@ _ACEOF
|
||||
@@ -6626,6 +6646,494 @@ _ACEOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
|
||||
$as_echo "$with_auto_load_safe_path" >&6; }
|
||||
|
||||
@ -1459,7 +1452,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
--- a/gdb/corelow.c
|
||||
+++ b/gdb/corelow.c
|
||||
@@ -366,7 +366,7 @@ build_id_locate_exec (int from_tty)
|
||||
@@ -365,7 +365,7 @@ build_id_locate_exec (int from_tty)
|
||||
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
|
||||
}
|
||||
else
|
||||
@ -1472,7 +1465,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
--- a/gdb/event-top.c
|
||||
+++ b/gdb/event-top.c
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "buffer.h"
|
||||
#include "common/buffer.h"
|
||||
#include "ser-event.h"
|
||||
#include "gdb_select.h"
|
||||
+#include "symfile.h"
|
||||
@ -1488,7 +1481,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
/* Do not call the python hook on an explicit prompt change as
|
||||
passed to this function, as this forms a secondary/local prompt,
|
||||
IE, displayed but not set. */
|
||||
@@ -774,7 +777,10 @@ command_line_handler (char *rl)
|
||||
@@ -770,7 +773,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
|
||||
command_handler (cmd);
|
||||
|
||||
if (ui->prompt_state != PROMPTED)
|
||||
@ -1503,7 +1496,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
--- a/gdb/symfile.h
|
||||
+++ b/gdb/symfile.h
|
||||
@@ -540,6 +540,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
|
||||
@@ -534,6 +534,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
|
||||
/* build-id support. */
|
||||
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
|
||||
extern void debug_print_missing (const char *binary, const char *debug);
|
||||
@ -1512,3 +1505,4 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
|
||||
/* From dwarf2read.c */
|
||||
|
||||
|
||||
|
||||
@ -1,20 +1,10 @@
|
||||
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: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
|
||||
;; Fix loading of core files without build-ids but with build-ids in executables.
|
||||
;; Load strictly build-id-checked core files only if no executable is specified
|
||||
;; (Jan Kratochvil, RH BZ 1339862).
|
||||
;;=push+jan
|
||||
|
||||
gdb returns an incorrect back trace when applying a debuginfo
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1339862
|
||||
|
||||
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
--- a/gdb/solib-svr4.c
|
||||
+++ b/gdb/solib-svr4.c
|
||||
@@ -1358,14 +1358,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
@@ -1347,14 +1347,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
}
|
||||
|
||||
{
|
||||
@ -44,7 +34,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
if (build_id != NULL)
|
||||
{
|
||||
char *name, *build_id_filename;
|
||||
@@ -1380,23 +1393,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
@@ -1369,23 +1382,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
xfree (name);
|
||||
}
|
||||
else
|
||||
@ -235,3 +225,4 @@ new file mode 100644
|
||||
+
|
||||
+gdb_test "bt"
|
||||
+gdb_test "info shared"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.6-buildid-locate.patch
|
||||
|
||||
;; New locating of the matching binaries from the pure core file (build-id).
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@ -55,13 +47,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
+ && namesz == sizeof "GNU"
|
||||
+ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
|
||||
+ {
|
||||
+ size_t size = descsz;
|
||||
+ size_t sz = descsz;
|
||||
+ gdb_byte *data = (gdb_byte *) descdata;
|
||||
+ struct bfd_build_id *retval;
|
||||
+
|
||||
+ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size);
|
||||
+ retval->size = size;
|
||||
+ memcpy (retval->data, data, size);
|
||||
+ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + sz);
|
||||
+ retval->size = sz;
|
||||
+ memcpy (retval->data, data, sz);
|
||||
+
|
||||
+ return retval;
|
||||
+ }
|
||||
@ -436,7 +428,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
|
||||
if (found == NULL)
|
||||
warning (_("File \"%s\" has no build-id, file skipped"),
|
||||
@@ -65,11 +463,50 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
@@ -65,62 +463,173 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -474,6 +466,160 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
+ return retval;
|
||||
+}
|
||||
+
|
||||
/* Helper for build_id_to_debug_bfd. LINK is a path to a potential
|
||||
build-id-based separate debug file, potentially a symlink to the real file.
|
||||
If the file exists and matches BUILD_ID, return a BFD reference to it. */
|
||||
|
||||
static gdb_bfd_ref_ptr
|
||||
-build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
|
||||
- const bfd_byte *build_id)
|
||||
+build_id_to_debug_bfd_1 (const std::string &orig_link, size_t build_id_len,
|
||||
+ const bfd_byte *build_id, char **link_return,
|
||||
+ int add_debug_suffix)
|
||||
{
|
||||
+ gdb_bfd_ref_ptr ret_bfd = {};
|
||||
+ std::string ret_link;
|
||||
+
|
||||
if (separate_debug_file_debug)
|
||||
{
|
||||
- printf_unfiltered (_(" Trying %s..."), link.c_str ());
|
||||
+ printf_unfiltered (_(" Trying %s..."), orig_link.c_str ());
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
- /* lrealpath() is expensive even for the usually non-existent files. */
|
||||
- gdb::unique_xmalloc_ptr<char> filename;
|
||||
- if (access (link.c_str (), F_OK) == 0)
|
||||
- filename.reset (lrealpath (link.c_str ()));
|
||||
-
|
||||
- if (filename == NULL)
|
||||
+ for (unsigned seqno = 0;; seqno++)
|
||||
{
|
||||
- if (separate_debug_file_debug)
|
||||
- printf_unfiltered (_(" no, unable to compute real path\n"));
|
||||
+ std::string link = orig_link;
|
||||
|
||||
- return {};
|
||||
- }
|
||||
+ if (seqno > 0)
|
||||
+ {
|
||||
+ /* There can be multiple build-id symlinks pointing to real files
|
||||
+ with the same build-id (such as hard links). Some of the real
|
||||
+ files may not be installed. */
|
||||
|
||||
- /* We expect to be silent on the non-existing files. */
|
||||
- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
|
||||
+ string_appendf (link, ".%u", seqno);
|
||||
+ }
|
||||
|
||||
- if (debug_bfd == NULL)
|
||||
- {
|
||||
- if (separate_debug_file_debug)
|
||||
- printf_unfiltered (_(" no, unable to open.\n"));
|
||||
+ if (add_debug_suffix)
|
||||
+ link += ".debug";
|
||||
+
|
||||
+ ret_link = link;
|
||||
+
|
||||
+ struct stat statbuf_trash;
|
||||
+
|
||||
+ /* `access' automatically dereferences LINK. */
|
||||
+ if (lstat (link.c_str (), &statbuf_trash) != 0)
|
||||
+ {
|
||||
+ /* Stop increasing SEQNO. */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* lrealpath() is expensive even for the usually non-existent files. */
|
||||
+ gdb::unique_xmalloc_ptr<char> filename;
|
||||
+
|
||||
+ if (access (link.c_str (), F_OK) == 0)
|
||||
+ filename.reset (lrealpath (link.c_str ()));
|
||||
+
|
||||
+ if (filename == NULL)
|
||||
+ {
|
||||
+ if (separate_debug_file_debug)
|
||||
+ printf_unfiltered (_(" no, unable to compute real path\n"));
|
||||
+
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ /* We expect to be silent on the non-existing files. */
|
||||
+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
|
||||
+
|
||||
+ if (debug_bfd == NULL)
|
||||
+ {
|
||||
+ if (separate_debug_file_debug)
|
||||
+ printf_unfiltered (_(" no, unable to open.\n"));
|
||||
+
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
|
||||
+ {
|
||||
+ if (separate_debug_file_debug)
|
||||
+ printf_unfiltered (_(" no, build-id does not match.\n"));
|
||||
+
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
- return {};
|
||||
+ ret_bfd = debug_bfd;
|
||||
+ break;
|
||||
}
|
||||
|
||||
- if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
|
||||
+ std::string link_all;
|
||||
+
|
||||
+ if (ret_bfd != NULL)
|
||||
{
|
||||
if (separate_debug_file_debug)
|
||||
- printf_unfiltered (_(" no, build-id does not match.\n"));
|
||||
+ printf_unfiltered (_(" yes!\n"));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* If none of the real files is found report as missing file
|
||||
+ always the non-.%u-suffixed file. */
|
||||
+ std::string link0 = orig_link;
|
||||
+
|
||||
+ if (add_debug_suffix)
|
||||
+ link0 += ".debug";
|
||||
+
|
||||
+ /* If the symlink has target request to install the target.
|
||||
+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
|
||||
+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
|
||||
+ std::string link0_resolved (link_resolve (link0.c_str (), 0));
|
||||
|
||||
- return {};
|
||||
+ if (link_all.empty ())
|
||||
+ link_all = link0_resolved;
|
||||
+ else
|
||||
+ {
|
||||
+ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
|
||||
+ its possible use as an argument for installation command. */
|
||||
+ link_all += " " + link0_resolved;
|
||||
+ }
|
||||
}
|
||||
|
||||
- if (separate_debug_file_debug)
|
||||
- printf_unfiltered (_(" yes!\n"));
|
||||
+ if (link_return != NULL)
|
||||
+ {
|
||||
+ if (ret_bfd != NULL)
|
||||
+ {
|
||||
+ *link_return = xstrdup (ret_link.c_str ());
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *link_return = xstrdup (link_all.c_str ());
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- return debug_bfd;
|
||||
+ return ret_bfd;
|
||||
}
|
||||
|
||||
/* See build-id.h. */
|
||||
|
||||
gdb_bfd_ref_ptr
|
||||
@ -481,27 +627,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
+build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
|
||||
+ char **link_return, int add_debug_suffix)
|
||||
{
|
||||
+ char *debugdir;
|
||||
+ std::string link, link_all;
|
||||
+ struct cleanup *back_to;
|
||||
+ int ix;
|
||||
gdb_bfd_ref_ptr abfd;
|
||||
|
||||
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
|
||||
@@ -82,63 +519,296 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
|
||||
{
|
||||
const gdb_byte *data = build_id;
|
||||
size_t size = build_id_len;
|
||||
+ char *filename = NULL;
|
||||
+ struct cleanup *inner;
|
||||
+ unsigned seqno;
|
||||
+ struct stat statbuf_trash;
|
||||
+ std::string link0;
|
||||
|
||||
- std::string link = debugdir.get ();
|
||||
+ link = debugdir.get ();
|
||||
link += "/.build-id/";
|
||||
|
||||
cause "/.build-id/..." lookups. */
|
||||
@@ -143,16 +652,16 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
|
||||
if (size > 0)
|
||||
{
|
||||
size--;
|
||||
@ -516,105 +644,25 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
|
||||
- link += ".debug";
|
||||
-
|
||||
if (separate_debug_file_debug)
|
||||
printf_unfiltered (_(" Trying %s\n"), link.c_str ());
|
||||
gdb_bfd_ref_ptr debug_bfd
|
||||
- = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
|
||||
+ = build_id_to_debug_bfd_1 (link, build_id_len, build_id,
|
||||
+ link_return, add_debug_suffix);
|
||||
if (debug_bfd != NULL)
|
||||
return debug_bfd;
|
||||
|
||||
- /* lrealpath() is expensive even for the usually non-existent files. */
|
||||
- gdb::unique_xmalloc_ptr<char> filename;
|
||||
- if (access (link.c_str (), F_OK) == 0)
|
||||
- filename.reset (lrealpath (link.c_str ()));
|
||||
-
|
||||
- if (filename == NULL)
|
||||
- continue;
|
||||
+ for (seqno = 0;; seqno++)
|
||||
+ {
|
||||
+ if (seqno)
|
||||
+ {
|
||||
+ /* There can be multiple build-id symlinks pointing to real files
|
||||
+ with the same build-id (such as hard links). Some of the real
|
||||
+ files may not be installed. */
|
||||
+
|
||||
+ string_appendf (link, ".%u", seqno);
|
||||
+ }
|
||||
+
|
||||
+ if (add_debug_suffix)
|
||||
+ link += ".debug";
|
||||
+
|
||||
+ if (!seqno)
|
||||
+ {
|
||||
+ /* If none of the real files is found report as missing file
|
||||
+ always the non-.%u-suffixed file. */
|
||||
+ link0 = link;
|
||||
+ }
|
||||
+
|
||||
+ /* `access' automatically dereferences LINK. */
|
||||
+ if (lstat (link.c_str (), &statbuf_trash) != 0)
|
||||
+ {
|
||||
+ /* Stop increasing SEQNO. */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ filename = lrealpath (link.c_str ());
|
||||
+ if (filename == NULL)
|
||||
+ continue;
|
||||
+
|
||||
+ /* We expect to be silent on the non-existing files. */
|
||||
+ inner = make_cleanup (xfree, filename);
|
||||
+ abfd = gdb_bfd_open (filename, gnutarget, -1);
|
||||
+ do_cleanups (inner);
|
||||
+
|
||||
+ if (abfd == NULL)
|
||||
+ continue;
|
||||
+
|
||||
+ if (build_id_verify (abfd.get(), build_id_len, build_id))
|
||||
+ break;
|
||||
+
|
||||
+ abfd.release ();
|
||||
+
|
||||
+ filename = NULL;
|
||||
+ }
|
||||
|
||||
- /* We expect to be silent on the non-existing files. */
|
||||
- abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
|
||||
+ if (filename != NULL)
|
||||
+ {
|
||||
+ /* LINK_ALL is not used below in this non-NULL FILENAME case. */
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- if (abfd == NULL)
|
||||
- continue;
|
||||
+ /* If the symlink has target request to install the target.
|
||||
+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
|
||||
+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
|
||||
+ std::string link0_resolved (link_resolve (link0.c_str (), 0));
|
||||
|
||||
- if (build_id_verify (abfd.get(), build_id_len, build_id))
|
||||
- break;
|
||||
+ if (link_all.empty ())
|
||||
+ link_all = link0_resolved;
|
||||
+ else
|
||||
+ {
|
||||
+ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
|
||||
+ its possible use as an argument for installation command. */
|
||||
+ link_all += " " + link0_resolved;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- abfd.release ();
|
||||
+ if (link_return != NULL)
|
||||
+ {
|
||||
+ if (abfd != NULL)
|
||||
+ {
|
||||
+ *link_return = xstrdup (link.c_str ());
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *link_return = xstrdup (link_all.c_str ());
|
||||
+ }
|
||||
}
|
||||
|
||||
return abfd;
|
||||
@@ -166,7 +675,8 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
|
||||
if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
|
||||
{
|
||||
link = gdb_sysroot + link;
|
||||
- debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
|
||||
+ debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id,
|
||||
+ link_return, add_debug_suffix);
|
||||
if (debug_bfd != NULL)
|
||||
return debug_bfd;
|
||||
}
|
||||
@@ -175,22 +685,190 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
|
||||
return {};
|
||||
}
|
||||
|
||||
+char *
|
||||
@ -807,7 +855,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
/* Prevent looping on a stripped .debug file. */
|
||||
if (abfd != NULL
|
||||
&& filename_cmp (bfd_get_filename (abfd.get ()),
|
||||
@@ -151,3 +821,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
|
||||
@@ -203,3 +881,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
|
||||
|
||||
return std::string ();
|
||||
}
|
||||
@ -832,9 +880,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
diff --git a/gdb/build-id.h b/gdb/build-id.h
|
||||
--- a/gdb/build-id.h
|
||||
+++ b/gdb/build-id.h
|
||||
@@ -22,9 +22,10 @@
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
#include "gdb_bfd.h"
|
||||
#include "common/rsp-low.h"
|
||||
|
||||
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
|
||||
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
|
||||
@ -845,7 +893,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
|
||||
|
||||
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
|
||||
Otherwise, issue a warning and return false. */
|
||||
@@ -38,13 +39,18 @@ extern int build_id_verify (bfd *abfd,
|
||||
@@ -39,14 +40,19 @@ extern int build_id_verify (bfd *abfd,
|
||||
the caller. */
|
||||
|
||||
extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
|
||||
@ -866,11 +914,12 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
|
||||
+extern std::string find_separate_debug_file_by_buildid (struct objfile *objfile,
|
||||
+ gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
|
||||
|
||||
#endif /* BUILD_ID_H */
|
||||
/* Return an hex-string representation of BUILD_ID. */
|
||||
|
||||
diff --git a/gdb/coffread.c b/gdb/coffread.c
|
||||
--- a/gdb/coffread.c
|
||||
+++ b/gdb/coffread.c
|
||||
@@ -733,7 +733,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
@@ -732,7 +732,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
/* Try to add separate debug file if no symbols table found. */
|
||||
if (!objfile_has_partial_symbols (objfile))
|
||||
{
|
||||
@ -883,10 +932,10 @@ diff --git a/gdb/coffread.c b/gdb/coffread.c
|
||||
diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
--- a/gdb/corelow.c
|
||||
+++ b/gdb/corelow.c
|
||||
@@ -45,6 +45,10 @@
|
||||
@@ -43,6 +43,10 @@
|
||||
#include "gdb_bfd.h"
|
||||
#include "completer.h"
|
||||
#include "filestuff.h"
|
||||
#include "common/filestuff.h"
|
||||
+#include "auxv.h"
|
||||
+#include "elf/common.h"
|
||||
+#include "gdbcmd.h"
|
||||
@ -894,7 +943,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
|
||||
#ifndef O_LARGEFILE
|
||||
#define O_LARGEFILE 0
|
||||
@@ -321,6 +325,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
|
||||
@@ -320,6 +324,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
|
||||
inferior_ptid = ptid; /* Yes, make it current. */
|
||||
}
|
||||
|
||||
@ -905,7 +954,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
+{
|
||||
+ CORE_ADDR at_entry;
|
||||
+ struct bfd_build_id *build_id;
|
||||
+ char *execfilename, *debug_filename;
|
||||
+ char *execfilename;
|
||||
+ char *build_id_filename;
|
||||
+ struct cleanup *back_to;
|
||||
+
|
||||
@ -949,7 +998,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
/* Issue a message saying we have no core to debug, if FROM_TTY. */
|
||||
|
||||
static void
|
||||
@@ -464,6 +516,14 @@ core_target_open (const char *arg, int from_tty)
|
||||
@@ -455,6 +507,14 @@ core_target_open (const char *arg, int from_tty)
|
||||
switch_to_thread (thread);
|
||||
}
|
||||
|
||||
@ -964,7 +1013,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
post_create_inferior (target, from_tty);
|
||||
|
||||
/* Now go through the target stack looking for threads since there
|
||||
@@ -1072,4 +1132,11 @@ void
|
||||
@@ -1063,4 +1123,11 @@ void
|
||||
_initialize_corelow (void)
|
||||
{
|
||||
add_target (core_target_info, core_target_open, filename_completer);
|
||||
@ -979,7 +1028,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -19570,6 +19570,27 @@ information files.
|
||||
@@ -19949,6 +19949,27 @@ information files.
|
||||
|
||||
@end table
|
||||
|
||||
@ -1007,10 +1056,22 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
@cindex @code{.gnu_debuglink} sections
|
||||
@cindex debug link sections
|
||||
A debug link is a special section of the executable file named
|
||||
diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
|
||||
--- a/gdb/dwarf-index-cache.c
|
||||
+++ b/gdb/dwarf-index-cache.c
|
||||
@@ -93,7 +93,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
if (!enabled ())
|
||||
return;
|
||||
|
||||
- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd);
|
||||
+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
|
||||
if (build_id == nullptr)
|
||||
{
|
||||
if (debug_index_cache)
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -2683,7 +2683,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
@@ -2727,7 +2727,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
}
|
||||
|
||||
if (dwz_bfd == NULL)
|
||||
@ -1019,10 +1080,28 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
|
||||
if (dwz_bfd == NULL)
|
||||
error (_("could not find '.gnu_debugaltlink' file for %s"),
|
||||
@@ -6237,7 +6237,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
|
||||
static gdb::array_view<const gdb_byte>
|
||||
get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
|
||||
{
|
||||
- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd);
|
||||
+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
|
||||
if (build_id == nullptr)
|
||||
return {};
|
||||
|
||||
@@ -6250,7 +6250,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
|
||||
static gdb::array_view<const gdb_byte>
|
||||
get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
|
||||
{
|
||||
- const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ());
|
||||
+ const bfd_build_id *build_id = build_id_bfd_shdr_get (dwz->dwz_bfd.get ());
|
||||
if (build_id == nullptr)
|
||||
return {};
|
||||
|
||||
diff --git a/gdb/elfread.c b/gdb/elfread.c
|
||||
--- a/gdb/elfread.c
|
||||
+++ b/gdb/elfread.c
|
||||
@@ -1290,7 +1290,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
@@ -1287,7 +1287,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
&& objfile->separate_debug_objfile == NULL
|
||||
&& objfile->separate_debug_objfile_backlink == NULL)
|
||||
{
|
||||
@ -1033,8 +1112,8 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
|
||||
|
||||
if (debugfile.empty ())
|
||||
debugfile = find_separate_debug_file_by_debuglink (objfile);
|
||||
@@ -1302,6 +1304,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
symbol_file_add_separate (abfd.get (), debugfile.c_str (),
|
||||
@@ -1299,6 +1301,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
|
||||
symfile_flags, objfile);
|
||||
}
|
||||
+ /* Check if any separate debug info has been extracted out. */
|
||||
@ -1047,7 +1126,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
|
||||
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
|
||||
--- a/gdb/objfiles.h
|
||||
+++ b/gdb/objfiles.h
|
||||
@@ -470,6 +470,10 @@ struct objfile
|
||||
@@ -554,6 +554,10 @@ struct objfile
|
||||
htab_t static_links {};
|
||||
};
|
||||
|
||||
@ -1061,7 +1140,7 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h
|
||||
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
|
||||
--- a/gdb/python/py-objfile.c
|
||||
+++ b/gdb/python/py-objfile.c
|
||||
@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
|
||||
@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
|
||||
|
||||
TRY
|
||||
{
|
||||
@ -1070,7 +1149,7 @@ diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
|
||||
}
|
||||
CATCH (except, RETURN_MASK_ALL)
|
||||
{
|
||||
@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id)
|
||||
@@ -535,7 +535,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id)
|
||||
/* Don't return separate debug files. */
|
||||
if (objfile->separate_debug_objfile_backlink != NULL)
|
||||
continue;
|
||||
@ -1090,7 +1169,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
|
||||
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
|
||||
static int svr4_have_link_map_offsets (void);
|
||||
@@ -1356,9 +1357,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
@@ -1345,9 +1346,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1148,7 +1227,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
--- a/gdb/symfile.h
|
||||
+++ b/gdb/symfile.h
|
||||
@@ -537,6 +537,10 @@ void expand_symtabs_matching
|
||||
@@ -531,6 +531,10 @@ void expand_symtabs_matching
|
||||
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
|
||||
int need_fullname);
|
||||
|
||||
@ -1210,7 +1289,7 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb
|
||||
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
||||
--- a/gdb/testsuite/lib/gdb.exp
|
||||
+++ b/gdb/testsuite/lib/gdb.exp
|
||||
@@ -1695,6 +1695,16 @@ proc default_gdb_start { } {
|
||||
@@ -1716,6 +1716,16 @@ proc default_gdb_start { } {
|
||||
warning "Couldn't set the width to 0."
|
||||
}
|
||||
}
|
||||
@ -1247,3 +1326,4 @@ diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
|
||||
|
||||
if { $separate_inferior_pty } {
|
||||
mi_create_inferior_pty
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
|
||||
;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
|
||||
;;=fedoratest
|
||||
|
||||
2007-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb_gcore.sh: Redirect GDB from `</dev/null'.
|
||||
@ -186,3 +178,4 @@ new file mode 100644
|
||||
+
|
||||
+set env(PATH) $oldpath
|
||||
+remote_file target delete "./gdb"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
|
||||
;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
||||
;;=fedoratest
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
|
||||
|
||||
The original testcase
|
||||
@ -92,3 +84,4 @@ new file mode 100644
|
||||
+ .long 0xfc020444 /* ddivq f0,f2,f0 */
|
||||
+ .long 0xec820d04 /* dcmpu cr1,f2,f1 */
|
||||
+ .long 0xfc820504 /* dcmpuq cr1,f2,f0 */
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
|
||||
;; Support for stepping over PPC atomic instruction sequences (BZ 237572).
|
||||
;;=fedoratest
|
||||
|
||||
2007-06-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.threads/atomic-seq-threaded.c,
|
||||
@ -276,3 +268,4 @@ new file mode 100644
|
||||
+gdb_test "c" \
|
||||
+ ".*Program exited normally\\..*" \
|
||||
+ "run till program exit"
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-6.6-scheduler_locking-step-is-default.patch
|
||||
|
||||
;; Make upstream `set scheduler-locking step' as default.
|
||||
;;=push+jan: How much is scheduler-locking relevant after non-stop?
|
||||
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -2193,7 +2193,7 @@ static const char *const scheduler_enums[] = {
|
||||
@@ -2075,7 +2075,7 @@ static const char *const scheduler_enums[] = {
|
||||
schedlock_replay,
|
||||
NULL
|
||||
};
|
||||
@ -76,3 +68,4 @@ diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inlin
|
||||
pass $message
|
||||
}
|
||||
timeout {
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.6-testsuite-timeouts.patch
|
||||
|
||||
;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
|
||||
--- a/gdb/testsuite/gdb.base/annota1.exp
|
||||
+++ b/gdb/testsuite/gdb.base/annota1.exp
|
||||
@ -30,3 +22,4 @@ diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
gdb_test_no_output "set height 0"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-charsign-test.patch
|
||||
|
||||
;; Fix displaying of numeric char arrays as strings (BZ 224128).
|
||||
;;=fedoratest: But it is failing anyway, one should check the behavior more.
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
|
||||
|
||||
2007-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
@ -128,3 +120,4 @@ new file mode 100644
|
||||
+do_test {}
|
||||
+do_test {-fsigned-char}
|
||||
+do_test {-funsigned-char}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
|
||||
;; Test PPC hiding of call-volatile parameter register.
|
||||
;;=fedoratest
|
||||
|
||||
2007-11-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
|
||||
@ -106,3 +98,4 @@ new file mode 100644
|
||||
+
|
||||
+gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
|
||||
+ "Check value of call clobbered registers"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-testsuite-stable-results.patch
|
||||
|
||||
;; Testsuite fixes for more stable/comparable results.
|
||||
;;=fedoratest
|
||||
|
||||
gdb/testsuite/gdb.base/fileio.c:
|
||||
gdb/testsuite/gdb.base/fileio.exp:
|
||||
2007-12-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
@ -102,3 +94,4 @@ diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.e
|
||||
|
||||
set timeout $oldtimeout
|
||||
return 0
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-6.8-bz436037-reg-no-longer-active.patch
|
||||
|
||||
;; Fix register assignments with no GDB stack frames (BZ 436037).
|
||||
;;=push+jan: This fix is incorrect.
|
||||
|
||||
diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
--- a/gdb/valops.c
|
||||
+++ b/gdb/valops.c
|
||||
@@ -1104,6 +1104,8 @@ value_assign (struct value *toval, struct value *fromval)
|
||||
@@ -1092,6 +1092,8 @@ value_assign (struct value *toval, struct value *fromval)
|
||||
struct gdbarch *gdbarch;
|
||||
int value_reg;
|
||||
|
||||
@ -18,7 +10,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
/* Figure out which frame this is in currently.
|
||||
|
||||
We use VALUE_FRAME_ID for obtaining the value's frame id instead of
|
||||
@@ -1113,8 +1115,14 @@ value_assign (struct value *toval, struct value *fromval)
|
||||
@@ -1101,8 +1103,14 @@ value_assign (struct value *toval, struct value *fromval)
|
||||
frame. */
|
||||
frame = frame_find_by_id (VALUE_FRAME_ID (toval));
|
||||
|
||||
@ -35,3 +27,4 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
if (!frame)
|
||||
error (_("Value being assigned to is no longer active."));
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
|
||||
;; Test various forms of threads tracking across exec() (BZ 442765).
|
||||
;;=fedoratest
|
||||
|
||||
Test various forms of threads tracking across exec(2).
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c
|
||||
@ -179,3 +171,4 @@ diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.thr
|
||||
|
||||
gdb_test_multiple {} "Program exited" {
|
||||
-re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
|
||||
;; Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
|
||||
;;=fedoratest
|
||||
|
||||
Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
|
||||
@ -479,3 +471,4 @@ new file mode 100644
|
||||
+
|
||||
+# `abort' can get expressed as `*__GI_abort'.
|
||||
+gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-6.8-quit-never-aborts.patch
|
||||
|
||||
;; Make the GDB quit processing non-abortable to cleanup everything properly.
|
||||
;;=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch .
|
||||
|
||||
We may abort the process of detaching threads with multiple SIGINTs - which are
|
||||
being sent during a testcase terminating its child GDB.
|
||||
|
||||
@ -45,7 +37,7 @@ diff --git a/gdb/extension.c b/gdb/extension.c
|
||||
diff --git a/gdb/top.c b/gdb/top.c
|
||||
--- a/gdb/top.c
|
||||
+++ b/gdb/top.c
|
||||
@@ -1606,7 +1606,13 @@ quit_force (int *exit_arg, int from_tty)
|
||||
@@ -1626,7 +1626,13 @@ quit_force (int *exit_arg, int from_tty)
|
||||
|
||||
qt.from_tty = from_tty;
|
||||
|
||||
@ -62,7 +54,7 @@ diff --git a/gdb/top.c b/gdb/top.c
|
||||
diff --git a/gdb/utils.c b/gdb/utils.c
|
||||
--- a/gdb/utils.c
|
||||
+++ b/gdb/utils.c
|
||||
@@ -108,6 +108,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
|
||||
@@ -100,6 +100,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
|
||||
|
||||
static int debug_timestamp = 0;
|
||||
|
||||
@ -76,3 +68,4 @@ diff --git a/gdb/utils.c b/gdb/utils.c
|
||||
/* Nonzero means that strings with character values >0x7F should be printed
|
||||
as octal escapes. Zero means just print the value (e.g. it's an
|
||||
international character, and the terminal or window can cope.) */
|
||||
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
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: gdb-6.8-sparc64-silence-memcpy-check.patch
|
||||
|
||||
;; Silence memcpy check which returns false positive (sparc64)
|
||||
;;=push: But it is just a GCC workaround, look up the existing GCC PR for it.
|
||||
|
||||
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
|
||||
--- a/gdb/sparc-tdep.c
|
||||
+++ b/gdb/sparc-tdep.c
|
||||
@@ -1462,6 +1462,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache,
|
||||
if (sparc_floating_p (type) || sparc_complex_floating_p (type))
|
||||
{
|
||||
/* Floating return values. */
|
||||
+ len = (len <= 8) ? len : 8;
|
||||
memcpy (buf, valbuf, len);
|
||||
regcache->cooked_write (SPARC_F0_REGNUM, buf);
|
||||
if (len > 4)
|
||||
@ -1,90 +0,0 @@
|
||||
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: gdb-6.8-watchpoint-conditionals-test.patch
|
||||
|
||||
;; Test the watchpoints conditionals works.
|
||||
;;=fedoratest
|
||||
|
||||
For:
|
||||
http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
|
||||
http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.c b/gdb/testsuite/gdb.base/watchpoint-cond.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/watchpoint-cond.c
|
||||
@@ -0,0 +1,31 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int
|
||||
+main (int argc, char **argv)
|
||||
+{
|
||||
+ static int i = 0; /* `static' to start initialized. */
|
||||
+ int j = 2;
|
||||
+
|
||||
+ for (j = 0; j < 30; j++)
|
||||
+ i = 30 - j;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.exp b/gdb/testsuite/gdb.base/watchpoint-cond.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/watchpoint-cond.exp
|
||||
@@ -0,0 +1,37 @@
|
||||
+# Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile watchpoint-cond
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+if { [runto_main] < 0 } {
|
||||
+ untested watchpoint-cond
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i"
|
||||
+gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*"
|
||||
@ -1,68 +0,0 @@
|
||||
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: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
|
||||
|
||||
;; Toolchain on sparc is slightly broken and debuginfo files are generated
|
||||
;; with non 64bit aligned tables/offsets.
|
||||
;; See for example readelf -S ../Xvnc.debug.
|
||||
;;
|
||||
;; As a consenquence calculation of sectp->filepos as used in
|
||||
;; dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer
|
||||
;; that cannot be used directly as done with MMAP.
|
||||
;; Usage will result in a BusError.
|
||||
;;
|
||||
;; While we figure out what's wrong in the toolchain and do a full archive
|
||||
;; rebuild to fix it, we need to be able to use gdb :)
|
||||
;;=push
|
||||
|
||||
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
|
||||
--- a/gdb/gdb_bfd.c
|
||||
+++ b/gdb/gdb_bfd.c
|
||||
@@ -24,12 +24,14 @@
|
||||
#include "hashtab.h"
|
||||
#include "filestuff.h"
|
||||
#include "vec.h"
|
||||
+#ifndef __sparc__
|
||||
#ifdef HAVE_MMAP
|
||||
#include <sys/mman.h>
|
||||
#ifndef MAP_FAILED
|
||||
#define MAP_FAILED ((void *) -1)
|
||||
#endif
|
||||
#endif
|
||||
+#endif
|
||||
#include "target.h"
|
||||
#include "gdb/fileio.h"
|
||||
#include "inferior.h"
|
||||
@@ -484,6 +486,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
|
||||
|
||||
if (sect != NULL && sect->data != NULL)
|
||||
{
|
||||
+#ifndef __sparc__
|
||||
#ifdef HAVE_MMAP
|
||||
if (sect->map_addr != NULL)
|
||||
{
|
||||
@@ -493,6 +496,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
|
||||
gdb_assert (res == 0);
|
||||
}
|
||||
else
|
||||
+#endif
|
||||
#endif
|
||||
xfree (sect->data);
|
||||
}
|
||||
@@ -659,6 +663,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
|
||||
if (descriptor->data != NULL)
|
||||
goto done;
|
||||
|
||||
+#ifndef __sparc__
|
||||
#ifdef HAVE_MMAP
|
||||
if (!bfd_is_section_compressed (abfd, sectp))
|
||||
{
|
||||
@@ -693,6 +698,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_MMAP */
|
||||
+#endif
|
||||
|
||||
/* Handle compressed sections, or ordinary uncompressed sections in
|
||||
the no-mmap case. */
|
||||
Binary file not shown.
@ -1,76 +0,0 @@
|
||||
From 723adb650a31859d7cc45832cb8adca0206455ed Mon Sep 17 00:00:00 2001
|
||||
From: Sandra Loosemore <sandra@codesourcery.com>
|
||||
Date: Thu, 25 Apr 2019 07:27:02 -0700
|
||||
Subject: [PATCH] Detect invalid length field in debug frame FDE header.
|
||||
|
||||
GDB was failing to catch cases where a corrupt ELF or core file
|
||||
contained an invalid length value in a Dwarf debug frame FDE header.
|
||||
It was checking for buffer overflow but not cases where the length was
|
||||
negative or caused pointer wrap-around.
|
||||
|
||||
In addition to the additional validity check, this patch cleans up the
|
||||
multiple signed/unsigned conversions on the length field so that an
|
||||
unsigned representation is used consistently throughout.
|
||||
|
||||
This patch fixes CVE-2017-9778 and PR gdb/21600.
|
||||
|
||||
2019-04-25 Sandra Loosemore <sandra@codesourcery.com>
|
||||
Kang Li <kanglictf@gmail.com>
|
||||
|
||||
PR gdb/21600
|
||||
|
||||
* dwarf2-frame.c (read_initial_length): Be consistent about using
|
||||
unsigned representation of length.
|
||||
(decode_frame_entry_1): Likewise. Check for wraparound of
|
||||
end pointer as well as buffer overflow.
|
||||
---
|
||||
gdb/ChangeLog | 10 ++++++++++
|
||||
gdb/dwarf2-frame.c | 14 +++++++-------
|
||||
2 files changed, 17 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
|
||||
index e2bf61b..b697afa 100644
|
||||
--- a/gdb/dwarf2-frame.c
|
||||
+++ b/gdb/dwarf2-frame.c
|
||||
@@ -1487,7 +1487,7 @@ static ULONGEST
|
||||
read_initial_length (bfd *abfd, const gdb_byte *buf,
|
||||
unsigned int *bytes_read_ptr)
|
||||
{
|
||||
- LONGEST result;
|
||||
+ ULONGEST result;
|
||||
|
||||
result = bfd_get_32 (abfd, buf);
|
||||
if (result == 0xffffffff)
|
||||
@@ -1788,7 +1788,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
|
||||
{
|
||||
struct gdbarch *gdbarch = get_objfile_arch (unit->objfile);
|
||||
const gdb_byte *buf, *end;
|
||||
- LONGEST length;
|
||||
+ ULONGEST length;
|
||||
unsigned int bytes_read;
|
||||
int dwarf64_p;
|
||||
ULONGEST cie_id;
|
||||
@@ -1799,15 +1799,15 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
|
||||
buf = start;
|
||||
length = read_initial_length (unit->abfd, buf, &bytes_read);
|
||||
buf += bytes_read;
|
||||
- end = buf + length;
|
||||
-
|
||||
- /* Are we still within the section? */
|
||||
- if (end > unit->dwarf_frame_buffer + unit->dwarf_frame_size)
|
||||
- return NULL;
|
||||
+ end = buf + (size_t) length;
|
||||
|
||||
if (length == 0)
|
||||
return end;
|
||||
|
||||
+ /* Are we still within the section? */
|
||||
+ if (end <= buf || end > unit->dwarf_frame_buffer + unit->dwarf_frame_size)
|
||||
+ return NULL;
|
||||
+
|
||||
/* Distinguish between 32 and 64-bit encoded frame info. */
|
||||
dwarf64_p = (bytes_read == 12);
|
||||
|
||||
--
|
||||
2.9.3
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
|
||||
;; Fix follow-exec for C++ programs (bugreported by Martin Stransky).
|
||||
;;=fedoratest
|
||||
|
||||
Archer-upstreamed:
|
||||
http://sourceware.org/ml/archer/2010-q2/msg00031.html
|
||||
|
||||
@ -43,7 +35,7 @@ diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/cxxexec.exp
|
||||
@@ -0,0 +1,51 @@
|
||||
@@ -0,0 +1,42 @@
|
||||
+# Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
@ -83,15 +75,7 @@ new file mode 100644
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test continue
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "Cannot access memory at address 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ -re "\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# `info inferiors' can show <null> on older GDBs.
|
||||
+gdb_test "info threads" "info threads" "program finished"
|
||||
+# Run to end. The buggy GDB failed instead with:
|
||||
+# Cannot access memory at address ADDR.
|
||||
+gdb_continue_to_end "" "continue" 1
|
||||
|
||||
|
||||
@ -1,16 +1,9 @@
|
||||
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: gdb-archer-pie-addons-keep-disabled.patch
|
||||
|
||||
;;=push+jan: Breakpoints disabling matching should not be based on address.
|
||||
|
||||
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
--- a/gdb/breakpoint.c
|
||||
+++ b/gdb/breakpoint.c
|
||||
@@ -15522,6 +15522,50 @@ initialize_breakpoint_ops (void)
|
||||
@@ -15441,6 +15441,50 @@ static struct cmd_list_element *enablebreaklist = NULL;
|
||||
|
||||
static struct cmd_list_element *enablebreaklist = NULL;
|
||||
cmd_list_element *commands_cmd_element = nullptr;
|
||||
|
||||
+void
|
||||
+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
|
||||
@ -62,7 +55,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
|
||||
--- a/gdb/breakpoint.h
|
||||
+++ b/gdb/breakpoint.h
|
||||
@@ -1679,6 +1679,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
|
||||
@@ -1664,6 +1664,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
|
||||
UIOUT iff debugging multiple threads. */
|
||||
extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
|
||||
|
||||
@ -75,7 +68,7 @@ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
|
||||
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
|
||||
--- a/gdb/objfiles.c
|
||||
+++ b/gdb/objfiles.c
|
||||
@@ -883,6 +883,11 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
@@ -875,6 +875,11 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
obj_section_addr (s));
|
||||
}
|
||||
|
||||
@ -87,3 +80,4 @@ diff --git a/gdb/objfiles.c b/gdb/objfiles.c
|
||||
/* Data changed. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1,14 +1,7 @@
|
||||
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: gdb-archer-pie-addons.patch
|
||||
|
||||
;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
|
||||
|
||||
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
--- a/gdb/gdbtypes.h
|
||||
+++ b/gdb/gdbtypes.h
|
||||
@@ -505,6 +505,7 @@ enum field_loc_kind
|
||||
@@ -507,6 +507,7 @@ enum field_loc_kind
|
||||
{
|
||||
FIELD_LOC_KIND_BITPOS, /**< bitpos */
|
||||
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
|
||||
@ -16,7 +9,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
|
||||
FIELD_LOC_KIND_PHYSNAME, /**< physname */
|
||||
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
|
||||
@@ -556,6 +557,7 @@ union field_location
|
||||
@@ -558,6 +559,7 @@ union field_location
|
||||
field. Otherwise, physname is the mangled label of the
|
||||
static field. */
|
||||
|
||||
@ -24,7 +17,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
CORE_ADDR physaddr;
|
||||
const char *physname;
|
||||
|
||||
@@ -1438,6 +1440,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
||||
@@ -1436,6 +1438,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
||||
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
|
||||
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
|
||||
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
|
||||
@ -32,7 +25,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
||||
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
|
||||
#define SET_FIELD_BITPOS(thisfld, bitpos) \
|
||||
@@ -1449,6 +1452,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
||||
@@ -1447,6 +1450,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
||||
#define SET_FIELD_PHYSNAME(thisfld, name) \
|
||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
|
||||
FIELD_STATIC_PHYSNAME (thisfld) = (name))
|
||||
@ -40,7 +33,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
#define SET_FIELD_PHYSADDR(thisfld, addr) \
|
||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
|
||||
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
|
||||
@@ -1465,6 +1469,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
||||
@@ -1463,6 +1467,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
||||
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
|
||||
@ -51,7 +44,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
diff --git a/gdb/value.c b/gdb/value.c
|
||||
--- a/gdb/value.c
|
||||
+++ b/gdb/value.c
|
||||
@@ -2829,7 +2829,8 @@ value_static_field (struct type *type, int fieldno)
|
||||
@@ -2827,7 +2827,8 @@ value_static_field (struct type *type, int fieldno)
|
||||
{
|
||||
case FIELD_LOC_KIND_PHYSADDR:
|
||||
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
|
||||
@ -61,3 +54,4 @@ diff --git a/gdb/value.c b/gdb/value.c
|
||||
break;
|
||||
case FIELD_LOC_KIND_PHYSNAME:
|
||||
{
|
||||
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
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: gdb-archer-vla-tests.patch
|
||||
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp
|
||||
--- a/gdb/testsuite/gdb.ada/packed_array.exp
|
||||
+++ b/gdb/testsuite/gdb.ada/packed_array.exp
|
||||
@ -3735,3 +3728,4 @@ diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
|
||||
}
|
||||
set pascal_init_done 1
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-archer.patch
|
||||
|
||||
;; Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
|
||||
;;=push
|
||||
|
||||
http://sourceware.org/gdb/wiki/ProjectArcher
|
||||
http://sourceware.org/gdb/wiki/ArcherBranchManagement
|
||||
|
||||
@ -17,7 +9,7 @@ tromey/python
|
||||
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
||||
--- a/gdb/Makefile.in
|
||||
+++ b/gdb/Makefile.in
|
||||
@@ -2112,6 +2112,12 @@ stamp-h: $(srcdir)/config.in config.status
|
||||
@@ -2082,6 +2082,12 @@ stamp-h: $(srcdir)/config.in config.status
|
||||
CONFIG_LINKS= \
|
||||
$(SHELL) config.status
|
||||
|
||||
@ -53,7 +45,7 @@ diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -1245,6 +1245,16 @@ for remote debugging.
|
||||
@@ -1251,6 +1251,16 @@ for remote debugging.
|
||||
Run using @var{device} for your program's standard input and output.
|
||||
@c FIXME: kingdon thinks there is more to -tty. Investigate.
|
||||
|
||||
@ -73,7 +65,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
|
||||
--- a/gdb/doc/python.texi
|
||||
+++ b/gdb/doc/python.texi
|
||||
@@ -88,8 +88,6 @@ containing @code{end}. For example:
|
||||
@@ -90,8 +90,6 @@ containing @code{end}. For example:
|
||||
|
||||
@smallexample
|
||||
(@value{GDBP}) python
|
||||
@ -112,7 +104,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
#include "source.h"
|
||||
#include "cli/cli-cmds.h"
|
||||
#include "objfiles.h"
|
||||
@@ -479,7 +480,7 @@ exec_or_core_file_attach (const char *filename, int from_tty)
|
||||
@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty)
|
||||
}
|
||||
|
||||
static void
|
||||
@ -121,7 +113,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
{
|
||||
int argc = context->argc;
|
||||
char **argv = context->argv;
|
||||
@@ -695,10 +696,14 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -698,10 +699,14 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{"args", no_argument, &set_args, 1},
|
||||
{"l", required_argument, 0, 'l'},
|
||||
{"return-child-result", no_argument, &return_child_result, 1},
|
||||
@ -137,7 +129,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
{
|
||||
int option_index;
|
||||
|
||||
@@ -716,6 +721,9 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -719,6 +724,9 @@ captured_main_1 (struct captured_main_args *context)
|
||||
case 0:
|
||||
/* Long option that just sets a flag. */
|
||||
break;
|
||||
@ -147,7 +139,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
case OPT_SE:
|
||||
symarg = optarg;
|
||||
execarg = optarg;
|
||||
@@ -890,7 +898,31 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -898,7 +906,31 @@ captured_main_1 (struct captured_main_args *context)
|
||||
|
||||
/* Now that gdb_init has created the initial inferior, we're in
|
||||
position to set args for that inferior. */
|
||||
@ -180,7 +172,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
{
|
||||
/* The remaining options are the command-line options for the
|
||||
inferior. The first one is the sym/exec file, and the rest
|
||||
@@ -1180,7 +1212,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -1199,7 +1231,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
|
||||
/* Read in the old history after all the command files have been
|
||||
read. */
|
||||
@ -190,7 +182,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
|
||||
if (batch_flag)
|
||||
{
|
||||
@@ -1193,24 +1226,37 @@ static void
|
||||
@@ -1215,24 +1248,37 @@ static void
|
||||
captured_main (void *data)
|
||||
{
|
||||
struct captured_main_args *context = (struct captured_main_args *) data;
|
||||
@ -241,7 +233,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
}
|
||||
/* No exit -- exit is through quit_command. */
|
||||
}
|
||||
@@ -1253,6 +1299,12 @@ print_gdb_help (struct ui_file *stream)
|
||||
@@ -1275,6 +1321,12 @@ print_gdb_help (struct ui_file *stream)
|
||||
fputs_unfiltered (_("\
|
||||
This is the GNU debugger. Usage:\n\n\
|
||||
gdb [options] [executable-file [core-file or process-id]]\n\
|
||||
@ -254,7 +246,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
|
||||
"), stream);
|
||||
fputs_unfiltered (_("\
|
||||
@@ -1298,6 +1350,13 @@ Output and user interface control:\n\n\
|
||||
@@ -1320,6 +1372,13 @@ Output and user interface control:\n\n\
|
||||
#endif
|
||||
fputs_unfiltered (_("\
|
||||
--dbx DBX compatibility mode.\n\
|
||||
@ -365,8 +357,8 @@ new file mode 100644
|
||||
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
|
||||
--- a/gdb/python/python-internal.h
|
||||
+++ b/gdb/python/python-internal.h
|
||||
@@ -644,6 +644,9 @@ class gdbpy_enter_varobj : public gdbpy_enter
|
||||
|
||||
@@ -709,6 +709,9 @@ private:
|
||||
PyThreadState *m_save;
|
||||
};
|
||||
|
||||
+struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
|
||||
@ -378,16 +370,16 @@ diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
|
||||
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
--- a/gdb/python/python.c
|
||||
+++ b/gdb/python/python.c
|
||||
@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python =
|
||||
@@ -94,6 +94,8 @@ const struct extension_language_defn extension_language_python =
|
||||
#include "linespec.h"
|
||||
#include "source.h"
|
||||
#include "version.h"
|
||||
#include "common/version.h"
|
||||
+#include "inferior.h"
|
||||
+#include "gdbthread.h"
|
||||
#include "target.h"
|
||||
#include "gdbthread.h"
|
||||
#include "interps.h"
|
||||
@@ -237,6 +239,29 @@ gdbpy_enter::~gdbpy_enter ()
|
||||
@@ -235,6 +237,29 @@ gdbpy_enter::~gdbpy_enter ()
|
||||
restore_active_ext_lang (m_previous_active);
|
||||
}
|
||||
|
||||
@ -417,10 +409,10 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
/* Set the quit flag. */
|
||||
|
||||
static void
|
||||
@@ -1367,6 +1392,92 @@ gdbpy_print_stack (void)
|
||||
@@ -1283,6 +1308,92 @@ gdbpy_print_stack_or_quit ()
|
||||
|
||||
|
||||
|
||||
/* Return the current Progspace.
|
||||
There always is one. */
|
||||
+/* True if 'gdb -P' was used, false otherwise. */
|
||||
+static int running_python_script;
|
||||
+
|
||||
@ -507,10 +499,10 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
+
|
||||
+
|
||||
+
|
||||
/* Return a sequence holding all the Progspaces. */
|
||||
|
||||
static PyObject *
|
||||
gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
|
||||
@@ -2057,6 +2168,8 @@ PyMethodDef python_GdbMethods[] =
|
||||
@@ -1937,6 +2048,8 @@ PyMethodDef python_GdbMethods[] =
|
||||
Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
|
||||
a Python String containing the output of the command if to_string is\n\
|
||||
set to True." },
|
||||
@ -522,13 +514,17 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
diff --git a/gdb/python/python.h b/gdb/python/python.h
|
||||
--- a/gdb/python/python.h
|
||||
+++ b/gdb/python/python.h
|
||||
@@ -25,4 +25,6 @@
|
||||
@@ -25,7 +25,10 @@
|
||||
/* This is all that python exports to gdb. */
|
||||
extern const struct extension_language_defn extension_language_python;
|
||||
|
||||
+
|
||||
/* Command element for the 'python' command. */
|
||||
extern cmd_list_element *python_cmd_element;
|
||||
|
||||
+extern void run_python_script (int argc, char **argv);
|
||||
+
|
||||
#endif /* GDB_PYTHON_H */
|
||||
#endif /* PYTHON_PYTHON_H */
|
||||
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
|
||||
--- a/gdb/testsuite/gdb.python/py-frame.exp
|
||||
+++ b/gdb/testsuite/gdb.python/py-frame.exp
|
||||
@ -544,7 +540,7 @@ diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py
|
||||
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
|
||||
--- a/gdb/testsuite/gdb.python/py-value.exp
|
||||
+++ b/gdb/testsuite/gdb.python/py-value.exp
|
||||
@@ -384,6 +384,15 @@ proc test_value_after_death {} {
|
||||
@@ -399,6 +399,15 @@ proc test_value_after_death {} {
|
||||
"print value's type"
|
||||
}
|
||||
|
||||
@ -560,8 +556,8 @@ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py
|
||||
# Regression test for invalid subscript operations. The bug was that
|
||||
# the type of the value was not being checked before allowing a
|
||||
# subscript operation to proceed.
|
||||
@@ -512,6 +521,7 @@ if ![runto_main] then {
|
||||
test_value_in_inferior
|
||||
@@ -585,6 +594,7 @@ test_value_in_inferior
|
||||
test_value_from_buffer
|
||||
test_inferior_function_call
|
||||
test_value_after_death
|
||||
+test_cast_regression
|
||||
@ -571,7 +567,7 @@ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py
|
||||
diff --git a/gdb/varobj.c b/gdb/varobj.c
|
||||
--- a/gdb/varobj.c
|
||||
+++ b/gdb/varobj.c
|
||||
@@ -218,6 +218,14 @@ is_root_p (const struct varobj *var)
|
||||
@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var)
|
||||
}
|
||||
|
||||
#ifdef HAVE_PYTHON
|
||||
@ -598,3 +594,4 @@ diff --git a/gdb/varobj.h b/gdb/varobj.h
|
||||
extern bool varobj_default_value_is_changeable_p (const struct varobj *var);
|
||||
extern bool varobj_value_is_changeable_p (const struct varobj *var);
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-attach-fail-reasons-5of5.patch
|
||||
|
||||
;; Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878).
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2012-03/msg00171.html
|
||||
|
||||
Hi,
|
||||
@ -45,7 +37,7 @@ gdb/gdbserver/
|
||||
diff --git a/gdb/config.in b/gdb/config.in
|
||||
--- a/gdb/config.in
|
||||
+++ b/gdb/config.in
|
||||
@@ -276,6 +276,9 @@
|
||||
@@ -267,6 +267,9 @@
|
||||
/* Define if librpm library is being used. */
|
||||
#undef HAVE_LIBRPM
|
||||
|
||||
@ -55,7 +47,7 @@ diff --git a/gdb/config.in b/gdb/config.in
|
||||
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
|
||||
#undef HAVE_LIBUNWIND_IA64_H
|
||||
|
||||
@@ -399,6 +402,9 @@
|
||||
@@ -390,6 +393,9 @@
|
||||
/* Define to 1 if you have the `scm_new_smob' function. */
|
||||
#undef HAVE_SCM_NEW_SMOB
|
||||
|
||||
@ -68,7 +60,7 @@ diff --git a/gdb/config.in b/gdb/config.in
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -15854,6 +15854,64 @@ cat >>confdefs.h <<_ACEOF
|
||||
@@ -15898,6 +15898,64 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
@ -136,7 +128,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -2054,6 +2054,10 @@ case $host_os in
|
||||
@@ -2051,6 +2051,10 @@ case $host_os in
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
|
||||
|
||||
@ -173,7 +165,7 @@ diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
|
||||
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
|
||||
--- a/gdb/gdbserver/configure
|
||||
+++ b/gdb/gdbserver/configure
|
||||
@@ -8535,6 +8535,64 @@ if $want_ipa ; then
|
||||
@@ -8589,6 +8589,64 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -241,7 +233,7 @@ diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
|
||||
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
|
||||
--- a/gdb/gdbserver/configure.ac
|
||||
+++ b/gdb/gdbserver/configure.ac
|
||||
@@ -486,6 +486,10 @@ if $want_ipa ; then
|
||||
@@ -478,6 +478,10 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -276,9 +268,9 @@ diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
|
||||
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
--- a/gdb/linux-nat.c
|
||||
+++ b/gdb/linux-nat.c
|
||||
@@ -1089,7 +1089,17 @@ linux_nat_target::create_inferior (const char *exec_file,
|
||||
@@ -1099,7 +1099,17 @@ linux_nat_target::create_inferior (const char *exec_file,
|
||||
/* Make sure we report all signals during startup. */
|
||||
pass_signals (0, NULL);
|
||||
pass_signals ({});
|
||||
|
||||
- inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty);
|
||||
+ TRY
|
||||
@ -318,7 +310,7 @@ diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -583,6 +589,25 @@ linux_ptrace_init_warnings (void)
|
||||
@@ -586,6 +592,25 @@ linux_ptrace_init_warnings (void)
|
||||
linux_ptrace_test_ret_to_nx ();
|
||||
}
|
||||
|
||||
@ -355,3 +347,4 @@ diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
|
||||
extern void linux_check_ptrace_features (void);
|
||||
extern void linux_enable_event_reporting (pid_t pid, int attached);
|
||||
extern void linux_disable_event_reporting (pid_t pid);
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-btrobust.patch
|
||||
|
||||
;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
|
||||
;;=push
|
||||
|
||||
This should fix the error with glib. An error message will still be
|
||||
printed, but a default backtrace will occur in this case.
|
||||
|
||||
@ -14,7 +6,7 @@ printed, but a default backtrace will occur in this case.
|
||||
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
|
||||
--- a/gdb/python/py-framefilter.c
|
||||
+++ b/gdb/python/py-framefilter.c
|
||||
@@ -1151,6 +1151,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
@@ -1139,6 +1139,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
htab_eq_pointer,
|
||||
NULL));
|
||||
|
||||
@ -22,24 +14,25 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
|
||||
while (true)
|
||||
{
|
||||
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
|
||||
@@ -1159,8 +1160,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
@@ -1147,8 +1148,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
{
|
||||
if (PyErr_Occurred ())
|
||||
{
|
||||
- throw_quit_or_print_exception ();
|
||||
- gdbpy_print_stack_or_quit ();
|
||||
- return EXT_LANG_BT_ERROR;
|
||||
+ gdbpy_print_stack ();
|
||||
+ return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1193,7 +1194,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
@@ -1181,7 +1182,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
|
||||
/* Do not exit on error printing a single frame. Print the
|
||||
error and continue with other frames. */
|
||||
if (success == EXT_LANG_BT_ERROR)
|
||||
- throw_quit_or_print_exception ();
|
||||
- gdbpy_print_stack_or_quit ();
|
||||
+ gdbpy_print_stack ();
|
||||
+ count_printed++;
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-bz1219747-attach-kills.patch
|
||||
|
||||
;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html
|
||||
|
||||
Hi,
|
||||
@ -80,18 +72,18 @@ gdb/testsuite/ChangeLog
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -1115,7 +1115,10 @@ captured_main_1 (struct captured_main_args *context)
|
||||
if (isdigit (pid_or_core_arg[0]))
|
||||
@@ -1129,7 +1129,10 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
if (catch_command_errors (attach_command, pid_or_core_arg,
|
||||
- !batch_flag) == 0)
|
||||
+ !batch_flag) == 0
|
||||
ret = catch_command_errors (attach_command, pid_or_core_arg,
|
||||
!batch_flag);
|
||||
- if (ret == 0)
|
||||
+ if (ret == 0
|
||||
+ /* attach_command could succeed partially and core_file_command
|
||||
+ would try to kill it. */
|
||||
+ && !have_inferiors ())
|
||||
catch_command_errors (core_file_command, pid_or_core_arg,
|
||||
!batch_flag);
|
||||
}
|
||||
ret = catch_command_errors (core_file_command,
|
||||
pid_or_core_arg,
|
||||
!batch_flag);
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -176,3 +168,4 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+kill_wait_spawned_process $test_spawn_id
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-bz533176-fortran-omp-step.patch
|
||||
|
||||
;; Fix stepping with OMP parallel Fortran sections (BZ 533176).
|
||||
;;=push+jan: It requires some better DWARF annotations.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=533176#c4
|
||||
|
||||
I find it a bug in DWARF and gdb behaves correctly according to it. From the
|
||||
@ -30,7 +22,7 @@ debugging problem of GOMP outside of the scope of this Bug.
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -6695,6 +6695,16 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
@@ -6499,6 +6499,16 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
|
||||
{
|
||||
@ -47,7 +39,7 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
/* We're doing a "next".
|
||||
|
||||
Normal (forward) execution: set a breakpoint at the
|
||||
@@ -6728,6 +6738,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
@@ -6532,6 +6542,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
keep_going (ecs);
|
||||
return;
|
||||
@ -128,3 +120,4 @@ new file mode 100644
|
||||
+ end do
|
||||
+ print *, "success"
|
||||
+ end
|
||||
|
||||
|
||||
@ -1,16 +1,7 @@
|
||||
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: gdb-bz541866-rwatch-before-run.patch
|
||||
|
||||
;; Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
|
||||
;; Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866).
|
||||
;;=push+jan: It should be fixed properly instead.
|
||||
|
||||
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
--- a/gdb/breakpoint.c
|
||||
+++ b/gdb/breakpoint.c
|
||||
@@ -8807,7 +8807,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
|
||||
@@ -8773,7 +8773,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
|
||||
int enabled, int internal, unsigned flags,
|
||||
int display_canonical)
|
||||
{
|
||||
@ -19,7 +10,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
|
||||
if (type == bp_hardware_breakpoint)
|
||||
{
|
||||
@@ -14356,7 +14356,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
|
||||
@@ -14271,7 +14271,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
|
||||
|
||||
if (bpt->type == bp_hardware_breakpoint)
|
||||
{
|
||||
@ -97,26 +88,26 @@ new file mode 100644
|
||||
diff --git a/gdb/configure.nat b/gdb/configure.nat
|
||||
--- a/gdb/configure.nat
|
||||
+++ b/gdb/configure.nat
|
||||
@@ -238,6 +238,7 @@ case ${gdb_host} in
|
||||
@@ -245,6 +245,7 @@ case ${gdb_host} in
|
||||
;;
|
||||
i386)
|
||||
# Host: Intel 386 running GNU/Linux.
|
||||
+ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux.h"
|
||||
NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
|
||||
i386-linux-nat.o x86-linux-nat.o linux-btrace.o \
|
||||
x86-linux.o x86-linux-dregs.o"
|
||||
@@ -290,6 +291,7 @@ case ${gdb_host} in
|
||||
NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \
|
||||
i386-linux-nat.o x86-linux-nat.o nat/linux-btrace.o \
|
||||
nat/x86-linux.o nat/x86-linux-dregs.o"
|
||||
@@ -301,6 +302,7 @@ case ${gdb_host} in
|
||||
case ${gdb_host_cpu} in
|
||||
i386)
|
||||
# Host: GNU/Linux x86-64
|
||||
+ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux64.h"
|
||||
NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
|
||||
amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \
|
||||
x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o"
|
||||
NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \
|
||||
amd64-nat.o amd64-linux-nat.o x86-linux-nat.o \
|
||||
nat/linux-btrace.o \
|
||||
diff --git a/gdb/target.h b/gdb/target.h
|
||||
--- a/gdb/target.h
|
||||
+++ b/gdb/target.h
|
||||
@@ -1953,9 +1953,11 @@ extern struct thread_info *target_thread_handle_to_thread_info
|
||||
@@ -1971,9 +1971,11 @@ extern struct thread_info *target_thread_handle_to_thread_info
|
||||
one. OTHERTYPE is the number of watchpoints of other types than
|
||||
this one used so far. */
|
||||
|
||||
@ -173,3 +164,4 @@ new file mode 100644
|
||||
+gdb_test "" "main .* at .*" "start"
|
||||
+
|
||||
+gdb_test "continue" "Continuing.\r\n\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-bz568248-oom-is-error.patch
|
||||
|
||||
;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
|
||||
;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted.
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
|
||||
|
||||
Hi,
|
||||
@ -53,7 +45,7 @@ gdb/
|
||||
diff --git a/gdb/utils.c b/gdb/utils.c
|
||||
--- a/gdb/utils.c
|
||||
+++ b/gdb/utils.c
|
||||
@@ -746,13 +746,11 @@ malloc_failure (long size)
|
||||
@@ -721,13 +721,11 @@ malloc_failure (long size)
|
||||
{
|
||||
if (size > 0)
|
||||
{
|
||||
@ -69,3 +61,4 @@ diff --git a/gdb/utils.c b/gdb/utils.c
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-bz601887-dwarf4-rh-test.patch
|
||||
|
||||
;; Backport DWARF-4 support (BZ 601887, Tom Tromey).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -252,3 +244,4 @@ new file mode 100644
|
||||
+clean_restart $executable
|
||||
+
|
||||
+gdb_test "ptype main" {type = int \(void\)}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-bz634108-solib_address.patch
|
||||
|
||||
;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
|
||||
;;=fedoratest
|
||||
|
||||
Fix gdb.solib_address (fix by Phil Muldoon).
|
||||
|
||||
s/solib_address/solib_name/ during upstreaming.
|
||||
@ -39,3 +31,4 @@ new file mode 100644
|
||||
+if { [skip_python_tests] } { continue }
|
||||
+
|
||||
+gdb_test "python print gdb.solib_name(-1)" "None" "gdb.solib_name exists"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-ccache-workaround.patch
|
||||
|
||||
;; Workaround ccache making lineno non-zero for command-line definitions.
|
||||
;;=fedoratest: ccache is rarely used and it is even fixed now.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
|
||||
--- a/gdb/testsuite/gdb.base/macscp.exp
|
||||
+++ b/gdb/testsuite/gdb.base/macscp.exp
|
||||
@ -24,3 +16,4 @@ diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.e
|
||||
# Generate the intermediate object file. This is required by Darwin to
|
||||
# have access to the .debug_macinfo section.
|
||||
if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-container-rh-pkg.patch
|
||||
|
||||
;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -13909,7 +13909,17 @@ remote_target::pid_to_exec_file (int pid)
|
||||
@@ -13966,7 +13966,17 @@ remote_target::pid_to_exec_file (int pid)
|
||||
char *annex = NULL;
|
||||
|
||||
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
|
||||
@ -28,3 +20,4 @@ diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
|
||||
inf = find_inferior_pid (pid);
|
||||
if (inf == NULL)
|
||||
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
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: gdb-core-open-vdso-warning.patch
|
||||
|
||||
;; Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
;; Fix regression of undisplayed missing shared libraries caused by a fix for.
|
||||
;;=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
|
||||
Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
|
||||
@ -56,3 +47,4 @@ diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/so
|
||||
+gdb_run_cmd
|
||||
+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \
|
||||
+ "warning for missing libraries"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-dts-rhel6-python-compat.patch
|
||||
|
||||
;; [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon).
|
||||
;;=fedora
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1020004
|
||||
|
||||
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
|
||||
@ -313,3 +305,4 @@ new file mode 100644
|
||||
+ pair[1].describe (sys.stdout, full)
|
||||
+
|
||||
+FilteringBacktrace()
|
||||
|
||||
|
||||
@ -1,18 +1,10 @@
|
||||
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: gdb-fedora-libncursesw.patch
|
||||
|
||||
;; Force libncursesw over libncurses to match the includes (RH BZ 1270534).
|
||||
;;=push+jan
|
||||
|
||||
Fedora: Force libncursesw over libncurses to match the includes.
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1270534
|
||||
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -9393,6 +9393,7 @@ if test x"$prefer_curses" = xyes; then
|
||||
@@ -9418,6 +9418,7 @@ if test x"$prefer_curses" = xyes; then
|
||||
# search /usr/local/include, if ncurses is installed in /usr/local. A
|
||||
# default installation of ncurses on alpha*-dec-osf* will lead to such
|
||||
# a situation.
|
||||
@ -20,7 +12,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
|
||||
$as_echo_n "checking for library containing waddstr... " >&6; }
|
||||
if ${ac_cv_search_waddstr+:} false; then :
|
||||
@@ -9417,7 +9418,7 @@ return waddstr ();
|
||||
@@ -9442,7 +9443,7 @@ return waddstr ();
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
@ -29,7 +21,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
@@ -9491,6 +9492,7 @@ case $host_os in
|
||||
@@ -9516,6 +9517,7 @@ case $host_os in
|
||||
esac
|
||||
|
||||
# These are the libraries checked by Readline.
|
||||
@ -37,19 +29,19 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
|
||||
$as_echo_n "checking for library containing tgetent... " >&6; }
|
||||
if ${ac_cv_search_tgetent+:} false; then :
|
||||
@@ -9515,7 +9517,7 @@ return tgetent ();
|
||||
@@ -9540,7 +9542,7 @@ return tgetent ();
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
-for ac_lib in '' termcap tinfo curses ncursesw ncurses; do
|
||||
+for ac_lib in '' termcap tinfo ncursesw; do
|
||||
-for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do
|
||||
+for ac_lib in '' ncursesw; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -766,7 +766,8 @@ if test x"$prefer_curses" = xyes; then
|
||||
@@ -743,7 +743,8 @@ if test x"$prefer_curses" = xyes; then
|
||||
# search /usr/local/include, if ncurses is installed in /usr/local. A
|
||||
# default installation of ncurses on alpha*-dec-osf* will lead to such
|
||||
# a situation.
|
||||
@ -59,13 +51,14 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
|
||||
if test "$ac_cv_search_waddstr" != no; then
|
||||
curses_found=yes
|
||||
@@ -808,7 +809,8 @@ case $host_os in
|
||||
@@ -785,7 +786,8 @@ case $host_os in
|
||||
esac
|
||||
|
||||
# These are the libraries checked by Readline.
|
||||
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
|
||||
-AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses])
|
||||
+# Fedora: Force libncursesw over libncurses to match the includes.
|
||||
+AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw])
|
||||
+AC_SEARCH_LIBS(tgetent, [ncursesw])
|
||||
|
||||
if test "$ac_cv_search_tgetent" = no; then
|
||||
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-follow-child-stale-parent.patch
|
||||
|
||||
;; Fix regression by python on ia64 due to stale current frame.
|
||||
;;=push+jan
|
||||
|
||||
Problem occurs with python and its get_current_arch () as it selects
|
||||
selected_frame and current_frame while still inferior_ptid is valid for the
|
||||
original parent. But since this place it is already attached and later
|
||||
@ -24,7 +16,7 @@ unwinders try to access it, breaking:
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -752,6 +752,9 @@ follow_fork (void)
|
||||
@@ -754,6 +754,9 @@ follow_fork (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -34,3 +26,4 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
/* This pending follow fork event is now handled, one way
|
||||
or another. The previous selected thread may be gone
|
||||
from the lists by now, but if it is still around, need
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-fortran-frame-string.patch
|
||||
|
||||
;; Display Fortran strings in backtraces.
|
||||
;;=fedoratest
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
|
||||
|
||||
Hi,
|
||||
@ -102,3 +94,4 @@ new file mode 100644
|
||||
+ program main
|
||||
+ call f ('foo')
|
||||
+ end
|
||||
|
||||
|
||||
@ -1,46 +1,8 @@
|
||||
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: gdb-glibc-strstr-workaround.patch
|
||||
|
||||
;; Workaround PR libc/14166 for inferior calls of strstr.
|
||||
;;=fedora: Compatibility with RHELs (unchecked which ones).
|
||||
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -21286,6 +21286,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
|
||||
/* Cache this symbol's name and the name's demangled form (if any). */
|
||||
SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack);
|
||||
linkagename = dwarf2_physname (name, die, cu);
|
||||
+
|
||||
+ /* Workaround for:
|
||||
+ * invalid IFUNC DW_AT_linkage_name: memmove strstr time
|
||||
+ * http://sourceware.org/bugzilla/show_bug.cgi?id=14166 */
|
||||
+ if (strcmp (linkagename, "strstr") == 0
|
||||
+ && strstr (objfile_name (objfile), "/libc") != NULL)
|
||||
+ {
|
||||
+ struct objfile *objfile_msym;
|
||||
+ struct bound_minimal_symbol bmsym;
|
||||
+
|
||||
+ if (objfile->separate_debug_objfile_backlink)
|
||||
+ objfile_msym = objfile->separate_debug_objfile_backlink;
|
||||
+ else
|
||||
+ objfile_msym = objfile;
|
||||
+ bmsym = lookup_minimal_symbol ("strstr", NULL, objfile_msym);
|
||||
+ if (bmsym.minsym != NULL
|
||||
+ && MSYMBOL_TYPE (bmsym.minsym) == mst_text_gnu_ifunc)
|
||||
+ linkagename = "__strstr";
|
||||
+ }
|
||||
+
|
||||
SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile);
|
||||
|
||||
/* Fortran does not have mangling standard and the mangling does differ
|
||||
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
@@ -0,0 +1,108 @@
|
||||
@@ -0,0 +1,115 @@
|
||||
+# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
@ -103,6 +65,10 @@ new file mode 100644
|
||||
+ set addr $expect_out(1,string)
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} (0x\[0-9a-f\]+) <__libc_strstr_ifunc>\r\n$gdb_prompt $" {
|
||||
+ set addr $expect_out(1,string)
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
|
||||
+ untested "$test (gnu-ifunc not in use by glibc)"
|
||||
+ return 0
|
||||
@ -142,6 +108,9 @@ new file mode 100644
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__libc_strstr>\r\n$gdb_prompt $" {
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__libc_strstr_ifunc>\r\n$gdb_prompt $" {
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {void \\*\\(void\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
@ -149,3 +118,4 @@ new file mode 100644
|
||||
+
|
||||
+gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
|
||||
+gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-gnat-dwarf-crash-3of3.patch
|
||||
|
||||
;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
|
||||
;;=push+jan
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
|
||||
|
||||
--6TrnltStXW4iwmi0
|
||||
@ -42,7 +34,7 @@ gdb/
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -10499,6 +10499,13 @@ private:
|
||||
@@ -10588,6 +10588,13 @@ private:
|
||||
static void
|
||||
process_die (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
@ -59,7 +51,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -607,6 +607,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \
|
||||
@@ -609,6 +609,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \
|
||||
target_pid_to_str (process_ptid));
|
||||
}
|
||||
|
||||
@ -76,7 +68,7 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
--- a/gdb/linux-nat.c
|
||||
+++ b/gdb/linux-nat.c
|
||||
@@ -191,6 +191,12 @@ struct linux_nat_target *linux_target;
|
||||
@@ -192,6 +192,12 @@ struct linux_nat_target *linux_target;
|
||||
/* Does the current host support PTRACE_GETREGSET? */
|
||||
enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN;
|
||||
|
||||
@ -86,10 +78,10 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
/* The saved to_close method, inherited from inf-ptrace.c.
|
||||
Called by our to_close. */
|
||||
static void (*super_close) (struct target_ops *);
|
||||
@@ -1027,6 +1033,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled)
|
||||
static unsigned int debug_linux_nat;
|
||||
static void
|
||||
show_debug_linux_nat (struct ui_file *file, int from_tty,
|
||||
@@ -1037,6 +1043,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled)
|
||||
if (debug_linux_nat)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"LNPAW: Attaching to a stopped process\n");
|
||||
@ -99,7 +91,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
|
||||
/* The process is definitely stopped. It is in a job control
|
||||
stop, unless the kernel predates the TASK_STOPPED /
|
||||
@@ -1359,6 +1368,25 @@ get_detach_signal (struct lwp_info *lp)
|
||||
@@ -1369,6 +1378,25 @@ get_detach_signal (struct lwp_info *lp)
|
||||
return gdb_signal_to_host (signo);
|
||||
}
|
||||
|
||||
@ -125,7 +117,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1507,6 +1535,10 @@ linux_nat_target::detach (inferior *inf, int from_tty)
|
||||
@@ -1517,6 +1545,10 @@ linux_nat_target::detach (inferior *inf, int from_tty)
|
||||
detach_one_lwp (main_lwp, &signo);
|
||||
|
||||
detach_success (inf);
|
||||
@ -136,7 +128,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1765,6 +1797,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
|
||||
@@ -1775,6 +1807,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -153,7 +145,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
if (resume_many)
|
||||
iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
|
||||
|
||||
@@ -3761,6 +3803,10 @@ linux_nat_target::mourn_inferior ()
|
||||
@@ -3763,6 +3805,10 @@ linux_nat_target::mourn_inferior ()
|
||||
|
||||
/* Let the arch-specific native code know this process is gone. */
|
||||
linux_target->low_forget_process (pid);
|
||||
@ -234,3 +226,4 @@ diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.th
|
||||
|
||||
set test "$threadtype: attach2 to stopped, after setting file"
|
||||
gdb_test_multiple "attach $testpid" "$test" {
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-jit-reader-multilib.patch
|
||||
|
||||
;; Fix jit-reader.h for multi-lib.
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -9680,10 +9680,12 @@ _ACEOF
|
||||
@@ -9705,10 +9705,12 @@ _ACEOF
|
||||
|
||||
|
||||
|
||||
@ -28,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -843,10 +843,12 @@ AC_CHECK_SIZEOF(unsigned long long)
|
||||
@@ -820,10 +820,12 @@ AC_CHECK_SIZEOF(unsigned long long)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
AC_CHECK_SIZEOF(unsigned __int128)
|
||||
|
||||
@ -44,3 +36,4 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
|
||||
TARGET_PTR="unsigned __int128"
|
||||
else
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-libexec-add-index.patch
|
||||
|
||||
;; Fix gdb-headless /usr/bin/ executables (BZ 1390251).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
|
||||
--- a/gdb/contrib/gdb-add-index.sh
|
||||
+++ b/gdb/contrib/gdb-add-index.sh
|
||||
@ -21,3 +13,4 @@ diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
|
||||
myname="${0##*/}"
|
||||
|
||||
dwarf5=""
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-lineno-makeup-test.patch
|
||||
|
||||
;; Testcase for "Do not make up line information" fix by Daniel Jacobowitz.
|
||||
;;=fedoratest
|
||||
|
||||
New testcase for:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=466222
|
||||
(for the first / customer recommended fix)
|
||||
@ -163,3 +155,4 @@ new file mode 100644
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-linux_perf-bundle.patch
|
||||
|
||||
;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -12059,7 +12059,7 @@ else
|
||||
@@ -12137,7 +12137,7 @@ else
|
||||
|
||||
#include <linux/perf_event.h>
|
||||
#ifndef PERF_ATTR_SIZE_VER5
|
||||
@ -21,7 +13,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -1477,7 +1477,7 @@ else
|
||||
@@ -1500,7 +1500,7 @@ else
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <linux/perf_event.h>
|
||||
#ifndef PERF_ATTR_SIZE_VER5
|
||||
@ -234,3 +226,4 @@ diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
|
||||
struct target_ops;
|
||||
|
||||
#if HAVE_LINUX_PERF_EVENT_H
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-moribund-utrace-workaround.patch
|
||||
|
||||
;; Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
|
||||
;;=push+jan: Currently it is still not fully safe.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=590623
|
||||
http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593
|
||||
|
||||
@ -14,7 +6,7 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
|
||||
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
--- a/gdb/breakpoint.c
|
||||
+++ b/gdb/breakpoint.c
|
||||
@@ -12016,6 +12016,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
|
||||
@@ -11929,6 +11929,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
|
||||
traps we can no longer explain. */
|
||||
|
||||
old_loc->events_till_retirement = 3 * (thread_count () + 1);
|
||||
@ -22,4 +14,5 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
+ old_loc->events_till_retirement *= 10;
|
||||
old_loc->owner = NULL;
|
||||
|
||||
VEC_safe_push (bp_location_p, moribund_locations, old_loc);
|
||||
moribund_locations.push_back (old_loc);
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-opcodes-clflushopt-test.patch
|
||||
|
||||
;; Test clflushopt instruction decode (for RH BZ 1262471).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.S b/gdb/testsuite/gdb.arch/amd64-clflushopt.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -60,3 +52,4 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+gdb_test "disas _start" "Dump of assembler code for function _start:\r\n *0x\[0-9a-f\]+ <\[+\]0>:\tclflushopt \\(%edi\\)\r\nEnd of assembler dump\\." "clflushopt"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-physname-pr11734-test.patch
|
||||
|
||||
;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
|
||||
;;=fedoratest
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.cc
|
||||
@ -232,3 +224,4 @@ new file mode 100644
|
||||
+ void foo (char *);
|
||||
+};
|
||||
+
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-physname-pr12273-test.patch
|
||||
|
||||
;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
|
||||
;;=fedoratest
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.cp/pr12273.cc b/gdb/testsuite/gdb.cp/pr12273.cc
|
||||
@ -101,3 +93,4 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-ppc-power7-test.patch
|
||||
|
||||
;; Test power7 ppc disassembly.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.exp b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -301,3 +293,4 @@ new file mode 100644
|
||||
+ .long 0xedc07834 /* 194: frsqrtes f14,f15 */
|
||||
+ .long 0xedc07835 /* 198: frsqrtes. f14,f15 */
|
||||
+ .long 0x7c43271e /* 19c: isel r2,r3,r4,28 */
|
||||
|
||||
|
||||
@ -1,241 +0,0 @@
|
||||
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: gdb-python-gil.patch
|
||||
|
||||
;; Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957).
|
||||
;;=push
|
||||
|
||||
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
|
||||
--- a/gdb/doc/python.texi
|
||||
+++ b/gdb/doc/python.texi
|
||||
@@ -232,6 +232,14 @@ returned as a string. The default is @code{False}, in which case the
|
||||
return value is @code{None}. If @var{to_string} is @code{True}, the
|
||||
@value{GDBN} virtual terminal will be temporarily set to unlimited width
|
||||
and height, and its pagination will be disabled; @pxref{Screen Size}.
|
||||
+
|
||||
+The @var{release_gil} flag specifies whether @value{GDBN} ought to
|
||||
+release the Python GIL before executing the command. This is useful
|
||||
+in multi-threaded Python programs where by default the Python
|
||||
+interpreter will acquire the GIL and lock other threads from
|
||||
+executing. After the command has completed executing in @value{GDBN}
|
||||
+the Python GIL is reacquired. This flag must be a boolean value. If
|
||||
+omitted, it defaults to @code{False}.
|
||||
@end defun
|
||||
|
||||
@findex gdb.breakpoints
|
||||
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
|
||||
--- a/gdb/python/python-internal.h
|
||||
+++ b/gdb/python/python-internal.h
|
||||
@@ -148,6 +148,8 @@ typedef int Py_ssize_t;
|
||||
#define PyGILState_Release(ARG) ((void)(ARG))
|
||||
#define PyEval_InitThreads()
|
||||
#define PyThreadState_Swap(ARG) ((void)(ARG))
|
||||
+#define PyEval_SaveThread() ((void)(ARG))
|
||||
+#define PyEval_RestoreThread(ARG) ((void)(ARG))
|
||||
#define PyEval_ReleaseLock()
|
||||
#endif
|
||||
|
||||
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
--- a/gdb/python/python.c
|
||||
+++ b/gdb/python/python.c
|
||||
@@ -556,12 +556,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
const char *arg;
|
||||
PyObject *from_tty_obj = NULL, *to_string_obj = NULL;
|
||||
- int from_tty, to_string;
|
||||
- static const char *keywords[] = { "command", "from_tty", "to_string", NULL };
|
||||
+ int from_tty, to_string, release_gil;
|
||||
+ static const char *keywords[] = {"command", "from_tty", "to_string", "release_gil", NULL };
|
||||
+ PyObject *release_gil_obj = NULL;
|
||||
+ /* Initialize it just to avoid a GCC false warning. */
|
||||
+ PyThreadState *state = NULL;
|
||||
|
||||
- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!", keywords, &arg,
|
||||
+ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!O!", keywords, &arg,
|
||||
&PyBool_Type, &from_tty_obj,
|
||||
- &PyBool_Type, &to_string_obj))
|
||||
+ &PyBool_Type, &to_string_obj,
|
||||
+ &PyBool_Type, &release_gil_obj))
|
||||
return NULL;
|
||||
|
||||
from_tty = 0;
|
||||
@@ -582,6 +586,15 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
||||
to_string = cmp;
|
||||
}
|
||||
|
||||
+ release_gil = 0;
|
||||
+ if (release_gil_obj)
|
||||
+ {
|
||||
+ int cmp = PyObject_IsTrue (release_gil_obj);
|
||||
+ if (cmp < 0)
|
||||
+ return NULL;
|
||||
+ release_gil = cmp;
|
||||
+ }
|
||||
+
|
||||
std::string to_string_res;
|
||||
|
||||
TRY
|
||||
@@ -602,6 +615,13 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
||||
|
||||
counted_command_line lines = read_command_lines_1 (reader, 1, nullptr);
|
||||
|
||||
+ /* In the case of long running GDB commands, allow the user to
|
||||
+ release the Python GIL acquired by Python. Restore the GIL
|
||||
+ after the command has completed before handing back to
|
||||
+ Python. */
|
||||
+ if (release_gil)
|
||||
+ state = PyEval_SaveThread();
|
||||
+
|
||||
scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
|
||||
|
||||
scoped_restore save_uiout = make_scoped_restore (¤t_uiout);
|
||||
@@ -617,10 +637,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
||||
from_tty);
|
||||
else
|
||||
execute_control_commands (lines.get (), from_tty);
|
||||
+
|
||||
+ /* Reacquire the GIL if it was released earlier. */
|
||||
+ if (release_gil)
|
||||
+ PyEval_RestoreThread (state);
|
||||
}
|
||||
CATCH (except, RETURN_MASK_ALL)
|
||||
{
|
||||
- GDB_PY_HANDLE_EXCEPTION (except);
|
||||
+ if (except.reason < 0)
|
||||
+ {
|
||||
+ /* Reacquire the GIL if it was released earlier. */
|
||||
+ if (release_gil)
|
||||
+ PyEval_RestoreThread (state);
|
||||
+
|
||||
+ gdbpy_convert_exception (except);
|
||||
+ return NULL;
|
||||
+ }
|
||||
}
|
||||
END_CATCH
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.c b/gdb/testsuite/gdb.python/py-gil-mthread.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/py-gil-mthread.c
|
||||
@@ -0,0 +1,13 @@
|
||||
+#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ int i;
|
||||
+ for (i = 0; i < 10; i++)
|
||||
+ {
|
||||
+ sleep (1); /* break-here */
|
||||
+ printf ("Sleeping %d\n", i);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.exp b/gdb/testsuite/gdb.python/py-gil-mthread.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/py-gil-mthread.exp
|
||||
@@ -0,0 +1,69 @@
|
||||
+# Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+standard_testfile .c .py
|
||||
+set executable $testfile
|
||||
+
|
||||
+if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Skip all tests if Python scripting is not enabled.
|
||||
+if { [skip_python_tests] } { continue }
|
||||
+
|
||||
+if ![runto_main] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] temporary
|
||||
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
|
||||
+
|
||||
+set test "response"
|
||||
+set timeout 60
|
||||
+set sleeping_last -1
|
||||
+set hello_last 0
|
||||
+set minimal 5
|
||||
+gdb_test_multiple "python exec (open ('$srcdir/$subdir/$srcfile2').read ())" $test {
|
||||
+ -re "Error: unable to start thread\r\n" {
|
||||
+ fail $test
|
||||
+ # Not $gdb_prompt-synced!
|
||||
+ }
|
||||
+ -re "Sleeping (\[0-9\]+)\r\n" {
|
||||
+ set n $expect_out(1,string)
|
||||
+ if { $sleeping_last + 1 != $n } {
|
||||
+ fail $test
|
||||
+ } else {
|
||||
+ set sleeping_last $n
|
||||
+ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
|
||||
+ pass $test
|
||||
+ } else {
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ -re "Hello \\( (\[0-9\]+) \\)\r\n" {
|
||||
+ set n $expect_out(1,string)
|
||||
+ if { $hello_last + 1 != $n } {
|
||||
+ fail $test
|
||||
+ } else {
|
||||
+ set hello_last $n
|
||||
+ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
|
||||
+ pass $test
|
||||
+ } else {
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.py b/gdb/testsuite/gdb.python/py-gil-mthread.py
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/py-gil-mthread.py
|
||||
@@ -0,0 +1,28 @@
|
||||
+try:
|
||||
+ import thread
|
||||
+except:
|
||||
+ import _thread
|
||||
+import time
|
||||
+import gdb
|
||||
+
|
||||
+# Define a function for the thread
|
||||
+def print_thread_hello():
|
||||
+ count = 0
|
||||
+ while count < 10:
|
||||
+ time.sleep(1)
|
||||
+ count += 1
|
||||
+ print ("Hello ( %d )" % count)
|
||||
+
|
||||
+# Create a threads a continue
|
||||
+try:
|
||||
+ thread.start_new_thread (print_thread_hello, ())
|
||||
+ gdb.execute ("continue", release_gil=True)
|
||||
+except:
|
||||
+ try:
|
||||
+ _thread.start_new_thread (print_thread_hello, ())
|
||||
+ gdb.execute ("continue", release_gil=True)
|
||||
+ except:
|
||||
+ print ("Error: unable to start thread")
|
||||
+
|
||||
+while 1:
|
||||
+ pass
|
||||
@ -1,15 +1,7 @@
|
||||
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: gdb-readline62-ask-more-rh.patch
|
||||
|
||||
;; Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
--- a/gdb/event-top.c
|
||||
+++ b/gdb/event-top.c
|
||||
@@ -1183,6 +1183,13 @@ gdb_setup_readline (int editing)
|
||||
@@ -1179,6 +1179,13 @@ gdb_setup_readline (int editing)
|
||||
{
|
||||
struct ui *ui = current_ui;
|
||||
|
||||
@ -23,3 +15,4 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
/* This function is a noop for the sync case. The assumption is
|
||||
that the sync setup is ALL done in gdb_init, and we would only
|
||||
mess it up here. The sync stuff should really go away over
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
|
||||
;; Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -81,3 +73,4 @@ new file mode 100644
|
||||
+ ".*warning: Unable to find dynamic linker breakpoint function.*" \
|
||||
+ "set solib-absolute-prefix"
|
||||
+gdb_test "bt" "__kernel_vsyscall.*" "backtrace with __kernel_vsyscall"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
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: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
|
||||
;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
|
||||
;;=fedoratest
|
||||
|
||||
Original message by Tom Tromey:
|
||||
|
||||
<https://sourceware.org/ml/gdb-patches/2012-03/msg00955.html>
|
||||
@ -168,3 +160,4 @@ new file mode 100644
|
||||
+ print "Hello, World!"
|
||||
+
|
||||
+HelloWorld ()
|
||||
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
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: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
|
||||
;; Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
|
||||
;; Kratochvil, RH BZ 1084404).
|
||||
;;=fedoratest
|
||||
|
||||
These testcases have been created by compiling glibc-2.17-78 on
|
||||
RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file
|
||||
present at $builddir/misc/select.o.
|
||||
@ -233,3 +224,4 @@ new file mode 100644
|
||||
+L````(`````$````%````````````````````/`````$````%`````````$@`
|
||||
+`
|
||||
+end
|
||||
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
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: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
|
||||
;; Fix '`catch syscall' doesn't work for parent after `fork' is called'
|
||||
;; (Philippe Waroquiers, RH BZ 1149205).
|
||||
;;=fedoratest
|
||||
|
||||
URL: <https://sourceware.org/ml/gdb-patches/2013-05/msg00364.html>
|
||||
Message-ID: <1368136582.30058.7.camel@soleil>
|
||||
|
||||
@ -121,3 +112,4 @@ new file mode 100644
|
||||
+gdb_test "continue" \
|
||||
+ "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \
|
||||
+ "continue from catch syscall after fork"
|
||||
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
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: gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
|
||||
;; Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
|
||||
;; crash.' (RH BZ 1156192).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -348,3 +339,4 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+test_stop_on_solib_events
|
||||
|
||||
|
||||
@ -1,13 +1,3 @@
|
||||
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: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
|
||||
|
||||
;; Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug
|
||||
;; description: 'C++ (and objc): Internal error on unqualified name
|
||||
;; re-set', PR 11657] (RH BZ 1186476).
|
||||
;;=fedoratest
|
||||
|
||||
Comments from Sergio Durigan Junior:
|
||||
|
||||
The "proper" fix for this whole problem would be to backport the
|
||||
@ -133,3 +123,4 @@ new file mode 100644
|
||||
+gdb_test "run"
|
||||
+
|
||||
+gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*"
|
||||
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 17:09:48 +0200
|
||||
Subject: gdb-rhbz1187581-power8-regs-1of7.patch
|
||||
|
||||
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
||||
|
||||
commit 05abfc39c719e740530000059bb963ad33462479
|
||||
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
Date: Mon Aug 6 16:24:55 2018 -0300
|
||||
|
||||
Fix indentation in remote_target::download_tracepoint
|
||||
|
||||
gdb/ChangeLog:
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* remote.c (remote_target::download_tracepoint): Fix indentation
|
||||
in for block.
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -12912,24 +12912,24 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
error (_("Error on target while setting tracepoints."));
|
||||
}
|
||||
|
||||
- for (auto action_it = stepping_actions.begin ();
|
||||
- action_it != stepping_actions.end (); action_it++)
|
||||
- {
|
||||
- QUIT; /* Allow user to bail out with ^C. */
|
||||
-
|
||||
- bool is_first = action_it == stepping_actions.begin ();
|
||||
- bool has_more = action_it != stepping_actions.end ();
|
||||
-
|
||||
- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s",
|
||||
- b->number, addrbuf, /* address */
|
||||
- is_first ? "S" : "",
|
||||
- action_it->c_str (),
|
||||
- has_more ? "-" : "");
|
||||
- putpkt (buf);
|
||||
- remote_get_noisy_reply ();
|
||||
- if (strcmp (rs->buf, "OK"))
|
||||
- error (_("Error on target while setting tracepoints."));
|
||||
- }
|
||||
+ for (auto action_it = stepping_actions.begin ();
|
||||
+ action_it != stepping_actions.end (); action_it++)
|
||||
+ {
|
||||
+ QUIT; /* Allow user to bail out with ^C. */
|
||||
+
|
||||
+ bool is_first = action_it == stepping_actions.begin ();
|
||||
+ bool has_more = action_it != stepping_actions.end ();
|
||||
+
|
||||
+ xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s",
|
||||
+ b->number, addrbuf, /* address */
|
||||
+ is_first ? "S" : "",
|
||||
+ action_it->c_str (),
|
||||
+ has_more ? "-" : "");
|
||||
+ putpkt (buf);
|
||||
+ remote_get_noisy_reply ();
|
||||
+ if (strcmp (rs->buf, "OK"))
|
||||
+ error (_("Error on target while setting tracepoints."));
|
||||
+ }
|
||||
|
||||
if (packet_support (PACKET_TracepointSource) == PACKET_ENABLE)
|
||||
{
|
||||
@ -1,45 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 17:10:46 +0200
|
||||
Subject: gdb-rhbz1187581-power8-regs-2of7.patch
|
||||
|
||||
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
||||
|
||||
commit aa6f3694ce867884e43d1c0406c64df08ea24bd3
|
||||
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
Date: Mon Aug 6 16:24:55 2018 -0300
|
||||
|
||||
Remove trailing '-' from the last QTDP action packet
|
||||
|
||||
The has_more predicate in remote_target::download_tracepoint always
|
||||
evaluates to true, so the last action packet will be sent with a
|
||||
trailing '-'. This patch changes the predicate to remove the last
|
||||
trailing '-'.
|
||||
|
||||
gdb/ChangeLog:
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* remote.c (remote_target::download_tracepoint): Fix the has_more
|
||||
predicate in the QTDP action list iteration.
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -12899,7 +12899,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
{
|
||||
QUIT; /* Allow user to bail out with ^C. */
|
||||
|
||||
- bool has_more = (action_it != tdp_actions.end ()
|
||||
+ bool has_more = ((action_it + 1) != tdp_actions.end ()
|
||||
|| !stepping_actions.empty ());
|
||||
|
||||
xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c",
|
||||
@@ -12918,7 +12918,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
QUIT; /* Allow user to bail out with ^C. */
|
||||
|
||||
bool is_first = action_it == stepping_actions.begin ();
|
||||
- bool has_more = action_it != stepping_actions.end ();
|
||||
+ bool has_more = (action_it + 1) != stepping_actions.end ();
|
||||
|
||||
xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s",
|
||||
b->number, addrbuf, /* address */
|
||||
@ -1,258 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 17:11:09 +0200
|
||||
Subject: gdb-rhbz1187581-power8-regs-3of7.patch
|
||||
|
||||
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
||||
|
||||
commit 3df3a985a475db004706d64f83d9085f99053611
|
||||
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
Date: Mon Aug 6 16:24:55 2018 -0300
|
||||
|
||||
Use get_remote_packet_size in download_tracepoint
|
||||
|
||||
This patch changes the remote target to use the remote packet size to
|
||||
build QTDP packets, and to check if there is enough room for the
|
||||
packet.
|
||||
|
||||
I changed the function to raise an error if the packet is too small,
|
||||
instead of aborting gdb (through xsnprintf). It isn't clear if gdb
|
||||
will be in a consistent state with respect to the stub after this,
|
||||
since it's possible that some packets will be sent but not others, and
|
||||
there could be an incomplete tracepoint on the stub.
|
||||
|
||||
The char array used to build the packets is changed to a
|
||||
gdb::char_vector and sized with the result from
|
||||
get_remote_packet_size.
|
||||
|
||||
When checking if the buffer is large enough to hold the tracepoint
|
||||
condition agent expression, the length of the expression is multiplied
|
||||
by two, since it is encoded with two hex digits per expression
|
||||
byte. For simplicity, I assume that the result won't overflow, which
|
||||
can happen for very long condition expressions.
|
||||
|
||||
gdb/ChangeLog:
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* remote.c (remote_target::download_tracepoint): Remove BUF_SIZE.
|
||||
Replace array buf with gdb::char_vector buf, of size
|
||||
get_remote_packet_size (). Replace references to buf and
|
||||
BUF_SIZE to buf.data () and buf.size (). Replace strcpy, strcat
|
||||
and xsnprintf with snprintf. Raise errors if the buffer is too
|
||||
small.
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -12799,26 +12799,35 @@ remote_target::remote_download_command_source (int num, ULONGEST addr,
|
||||
void
|
||||
remote_target::download_tracepoint (struct bp_location *loc)
|
||||
{
|
||||
-#define BUF_SIZE 2048
|
||||
-
|
||||
CORE_ADDR tpaddr;
|
||||
char addrbuf[40];
|
||||
- char buf[BUF_SIZE];
|
||||
std::vector<std::string> tdp_actions;
|
||||
std::vector<std::string> stepping_actions;
|
||||
char *pkt;
|
||||
struct breakpoint *b = loc->owner;
|
||||
struct tracepoint *t = (struct tracepoint *) b;
|
||||
struct remote_state *rs = get_remote_state ();
|
||||
+ int ret;
|
||||
+ char *err_msg = _("Tracepoint packet too large for target.");
|
||||
+ size_t size_left;
|
||||
+
|
||||
+ /* We use a buffer other than rs->buf because we'll build strings
|
||||
+ across multiple statements, and other statements in between could
|
||||
+ modify rs->buf. */
|
||||
+ gdb::char_vector buf (get_remote_packet_size ());
|
||||
|
||||
encode_actions_rsp (loc, &tdp_actions, &stepping_actions);
|
||||
|
||||
tpaddr = loc->address;
|
||||
sprintf_vma (addrbuf, tpaddr);
|
||||
- xsnprintf (buf, BUF_SIZE, "QTDP:%x:%s:%c:%lx:%x", b->number,
|
||||
- addrbuf, /* address */
|
||||
- (b->enable_state == bp_enabled ? 'E' : 'D'),
|
||||
- t->step_count, t->pass_count);
|
||||
+ ret = snprintf (buf.data (), buf.size (), "QTDP:%x:%s:%c:%lx:%x",
|
||||
+ b->number, addrbuf, /* address */
|
||||
+ (b->enable_state == bp_enabled ? 'E' : 'D'),
|
||||
+ t->step_count, t->pass_count);
|
||||
+
|
||||
+ if (ret < 0 || ret >= buf.size ())
|
||||
+ error (err_msg);
|
||||
+
|
||||
/* Fast tracepoints are mostly handled by the target, but we can
|
||||
tell the target how big of an instruction block should be moved
|
||||
around. */
|
||||
@@ -12830,8 +12839,15 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
{
|
||||
if (gdbarch_fast_tracepoint_valid_at (loc->gdbarch, tpaddr,
|
||||
NULL))
|
||||
- xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":F%x",
|
||||
- gdb_insn_length (loc->gdbarch, tpaddr));
|
||||
+ {
|
||||
+ size_left = buf.size () - strlen (buf.data ());
|
||||
+ ret = snprintf (buf.data () + strlen (buf.data ()),
|
||||
+ size_left, ":F%x",
|
||||
+ gdb_insn_length (loc->gdbarch, tpaddr));
|
||||
+
|
||||
+ if (ret < 0 || ret >= size_left)
|
||||
+ error (err_msg);
|
||||
+ }
|
||||
else
|
||||
/* If it passed validation at definition but fails now,
|
||||
something is very wrong. */
|
||||
@@ -12855,7 +12871,14 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
struct static_tracepoint_marker marker;
|
||||
|
||||
if (target_static_tracepoint_marker_at (tpaddr, &marker))
|
||||
- strcat (buf, ":S");
|
||||
+ {
|
||||
+ size_left = buf.size () - strlen (buf.data ());
|
||||
+ ret = snprintf (buf.data () + strlen (buf.data ()),
|
||||
+ size_left, ":S");
|
||||
+
|
||||
+ if (ret < 0 || ret >= size_left)
|
||||
+ error (err_msg);
|
||||
+ }
|
||||
else
|
||||
error (_("Static tracepoint not valid during download"));
|
||||
}
|
||||
@@ -12873,10 +12896,26 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
capabilities at definition time. */
|
||||
if (remote_supports_cond_tracepoints ())
|
||||
{
|
||||
- agent_expr_up aexpr = gen_eval_for_expr (tpaddr, loc->cond.get ());
|
||||
- xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":X%x,",
|
||||
- aexpr->len);
|
||||
- pkt = buf + strlen (buf);
|
||||
+ agent_expr_up aexpr = gen_eval_for_expr (tpaddr,
|
||||
+ loc->cond.get ());
|
||||
+
|
||||
+ size_left = buf.size () - strlen (buf.data ());
|
||||
+
|
||||
+ ret = snprintf (buf.data () + strlen (buf.data ()),
|
||||
+ size_left, ":X%x,", aexpr->len);
|
||||
+
|
||||
+ if (ret < 0 || ret >= size_left)
|
||||
+ error (err_msg);
|
||||
+
|
||||
+ size_left = buf.size () - strlen (buf.data ());
|
||||
+
|
||||
+ /* Two bytes to encode each aexpr byte, plus the terminating
|
||||
+ null byte. */
|
||||
+ if (aexpr->len * 2 + 1 > size_left)
|
||||
+ error (err_msg);
|
||||
+
|
||||
+ pkt = buf.data () + strlen (buf.data ());
|
||||
+
|
||||
for (int ndx = 0; ndx < aexpr->len; ++ndx)
|
||||
pkt = pack_hex_byte (pkt, aexpr->buf[ndx]);
|
||||
*pkt = '\0';
|
||||
@@ -12887,8 +12926,17 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
}
|
||||
|
||||
if (b->commands || *default_collect)
|
||||
- strcat (buf, "-");
|
||||
- putpkt (buf);
|
||||
+ {
|
||||
+ size_left = buf.size () - strlen (buf.data ());
|
||||
+
|
||||
+ ret = snprintf (buf.data () + strlen (buf.data ()),
|
||||
+ size_left, "-");
|
||||
+
|
||||
+ if (ret < 0 || ret >= size_left)
|
||||
+ error (err_msg);
|
||||
+ }
|
||||
+
|
||||
+ putpkt (buf.data ());
|
||||
remote_get_noisy_reply ();
|
||||
if (strcmp (rs->buf, "OK"))
|
||||
error (_("Target does not support tracepoints."));
|
||||
@@ -12902,11 +12950,15 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
bool has_more = ((action_it + 1) != tdp_actions.end ()
|
||||
|| !stepping_actions.empty ());
|
||||
|
||||
- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c",
|
||||
- b->number, addrbuf, /* address */
|
||||
- action_it->c_str (),
|
||||
- has_more ? '-' : 0);
|
||||
- putpkt (buf);
|
||||
+ ret = snprintf (buf.data (), buf.size (), "QTDP:-%x:%s:%s%c",
|
||||
+ b->number, addrbuf, /* address */
|
||||
+ action_it->c_str (),
|
||||
+ has_more ? '-' : 0);
|
||||
+
|
||||
+ if (ret < 0 || ret >= buf.size ())
|
||||
+ error (err_msg);
|
||||
+
|
||||
+ putpkt (buf.data ());
|
||||
remote_get_noisy_reply ();
|
||||
if (strcmp (rs->buf, "OK"))
|
||||
error (_("Error on target while setting tracepoints."));
|
||||
@@ -12920,12 +12972,16 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
bool is_first = action_it == stepping_actions.begin ();
|
||||
bool has_more = (action_it + 1) != stepping_actions.end ();
|
||||
|
||||
- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s",
|
||||
- b->number, addrbuf, /* address */
|
||||
- is_first ? "S" : "",
|
||||
- action_it->c_str (),
|
||||
- has_more ? "-" : "");
|
||||
- putpkt (buf);
|
||||
+ ret = snprintf (buf.data (), buf.size (), "QTDP:-%x:%s:%s%s%s",
|
||||
+ b->number, addrbuf, /* address */
|
||||
+ is_first ? "S" : "",
|
||||
+ action_it->c_str (),
|
||||
+ has_more ? "-" : "");
|
||||
+
|
||||
+ if (ret < 0 || ret >= buf.size ())
|
||||
+ error (err_msg);
|
||||
+
|
||||
+ putpkt (buf.data ());
|
||||
remote_get_noisy_reply ();
|
||||
if (strcmp (rs->buf, "OK"))
|
||||
error (_("Error on target while setting tracepoints."));
|
||||
@@ -12935,22 +12991,32 @@ remote_target::download_tracepoint (struct bp_location *loc)
|
||||
{
|
||||
if (b->location != NULL)
|
||||
{
|
||||
- strcpy (buf, "QTDPsrc:");
|
||||
+ ret = snprintf (buf.data (), buf.size (), "QTDPsrc:");
|
||||
+
|
||||
+ if (ret < 0 || ret >= buf.size ())
|
||||
+ error (err_msg);
|
||||
+
|
||||
encode_source_string (b->number, loc->address, "at",
|
||||
event_location_to_string (b->location.get ()),
|
||||
- buf + strlen (buf), 2048 - strlen (buf));
|
||||
- putpkt (buf);
|
||||
+ buf.data () + strlen (buf.data ()),
|
||||
+ buf.size () - strlen (buf.data ()));
|
||||
+ putpkt (buf.data ());
|
||||
remote_get_noisy_reply ();
|
||||
if (strcmp (rs->buf, "OK"))
|
||||
warning (_("Target does not support source download."));
|
||||
}
|
||||
if (b->cond_string)
|
||||
{
|
||||
- strcpy (buf, "QTDPsrc:");
|
||||
+ ret = snprintf (buf.data (), buf.size (), "QTDPsrc:");
|
||||
+
|
||||
+ if (ret < 0 || ret >= buf.size ())
|
||||
+ error (err_msg);
|
||||
+
|
||||
encode_source_string (b->number, loc->address,
|
||||
- "cond", b->cond_string, buf + strlen (buf),
|
||||
- 2048 - strlen (buf));
|
||||
- putpkt (buf);
|
||||
+ "cond", b->cond_string,
|
||||
+ buf.data () + strlen (buf.data ()),
|
||||
+ buf.size () - strlen (buf.data ()));
|
||||
+ putpkt (buf.data ());
|
||||
remote_get_noisy_reply ();
|
||||
if (strcmp (rs->buf, "OK"))
|
||||
warning (_("Target does not support source download."));
|
||||
@ -1,449 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 17:17:16 +0200
|
||||
Subject: gdb-rhbz1187581-power8-regs-4of7.patch
|
||||
|
||||
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
||||
|
||||
commit 4277c4b87addb5354cc47b98d7a73e44cfaf22c2
|
||||
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
Date: Mon Aug 6 16:24:55 2018 -0300
|
||||
|
||||
Use remote register numbers in tracepoint mask
|
||||
|
||||
Currently, tracepoint register masks in the QTDP packets include both
|
||||
internal and remote register numbers, as well as pseudo-register
|
||||
numbers.
|
||||
|
||||
This patch changes this so that the mask only includes remote register
|
||||
numbers.
|
||||
|
||||
Register numbers from agent expressions are already set in the mask
|
||||
using remote numbers. Other tracepoint actions used internal numbers,
|
||||
e.g. "collect $regs" or "collect $<pseudoreg>". To handle pseudoreg
|
||||
numbers, an empty agent expression is created and ax_reg_mask is
|
||||
called for this expression and the pseudoreg. This will cause the ax
|
||||
to set its mask with the corresponding remote raw register
|
||||
numbers (using ax_regs_mask, which calls
|
||||
gdbarch_ax_pseudo_register_collect).
|
||||
|
||||
If ax_regs_mask and gdbarch_ax_pseudo_register_collect also generate
|
||||
more ax bytecode, the ax is also appended to the collection list. It
|
||||
isn't clear that this was the original intent for
|
||||
gdbarch_ax_pseudo_register_collect, and none of the arches seem to do
|
||||
this, but if this changes in the future, it should work.
|
||||
|
||||
The patch also refactors the code used by validate_action line to
|
||||
validate axs into a function that is now called from every place that
|
||||
generates axs. Previously, some parts of tracepoint.c that generated
|
||||
axs didn't check if the ax length was greater than MAX_AGENT_EXPR_LEN.
|
||||
|
||||
gdb/ChangeLog:
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* tracepoint.h (class collection_list) <add_register>: Remove.
|
||||
<add_remote_register, add_ax_registers, add_local_register>:
|
||||
Declare.
|
||||
<add_memrange>: Add scope parameter.
|
||||
* tracepoint.c (encode_actions_1): Likewise.
|
||||
(collection_list::add_register): Rename to ...
|
||||
(collection_list::add_remote_register): ... this. Update
|
||||
comment.
|
||||
(collection_list::add_ax_registers, add_local_register): New
|
||||
methods.
|
||||
(collection_list::add_memrange): Add scope parameter. Call
|
||||
add_local_register instead of add_register.
|
||||
(finalize_tracepoint_aexpr): New function.
|
||||
(collection_list::collect_symbol): Update calls to add_memrange.
|
||||
Call add_local_register instead of add_register. Call
|
||||
add_ax_registers. Call finalize_tracepoint_aexpr.
|
||||
(encode_actions_1): Get remote regnos for $reg action. Call
|
||||
add_remote_register, add_ax_registers, and add_local_register.
|
||||
Update call to add_memrange. Call finalize_tracepoint_aexpr.
|
||||
(validate_actionline): Call finalize_tracepoint_aexpr.
|
||||
|
||||
+2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
+
|
||||
+ * tracepoint.h (class collection_list) <add_register>: Remove.
|
||||
+ <add_remote_register, add_ax_registers, add_local_register>:
|
||||
+ Declare.
|
||||
+ <add_memrange>: Add scope parameter.
|
||||
+ * tracepoint.c (encode_actions_1): Likewise.
|
||||
+ (collection_list::add_register): Rename to ...
|
||||
+ (collection_list::add_remote_register): ... this. Update
|
||||
+ comment.
|
||||
+ (collection_list::add_ax_registers, add_local_register): New
|
||||
+ methods.
|
||||
+ (collection_list::add_memrange): Add scope parameter. Call
|
||||
+ add_local_register instead of add_register.
|
||||
+ (finalize_tracepoint_aexpr): New function.
|
||||
+ (collection_list::collect_symbol): Update calls to add_memrange.
|
||||
+ Call add_local_register instead of add_register. Call
|
||||
+ add_ax_registers. Call finalize_tracepoint_aexpr.
|
||||
+ (encode_actions_1): Get remote regnos for $reg action. Call
|
||||
+ add_remote_register, add_ax_registers, and add_local_register.
|
||||
+ Update call to add_memrange. Call finalize_tracepoint_aexpr.
|
||||
+ (validate_actionline): Call finalize_tracepoint_aexpr.
|
||||
+
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* remote.c (remote_target::download_tracepoint): Remove BUF_SIZE.
|
||||
|
||||
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
|
||||
--- a/gdb/tracepoint.c
|
||||
+++ b/gdb/tracepoint.c
|
||||
@@ -615,6 +615,19 @@ report_agent_reqs_errors (struct agent_expr *aexpr)
|
||||
error (_("Expression is too complicated."));
|
||||
}
|
||||
|
||||
+/* Call ax_reqs on AEXPR and raise an error if something is wrong. */
|
||||
+
|
||||
+static void
|
||||
+finalize_tracepoint_aexpr (struct agent_expr *aexpr)
|
||||
+{
|
||||
+ ax_reqs (aexpr);
|
||||
+
|
||||
+ if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
||||
+ error (_("Expression is too complicated."));
|
||||
+
|
||||
+ report_agent_reqs_errors (aexpr);
|
||||
+}
|
||||
+
|
||||
/* worker function */
|
||||
void
|
||||
validate_actionline (const char *line, struct breakpoint *b)
|
||||
@@ -699,12 +712,7 @@ validate_actionline (const char *line, struct breakpoint *b)
|
||||
exp.get (),
|
||||
trace_string);
|
||||
|
||||
- if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
||||
- error (_("Expression is too complicated."));
|
||||
-
|
||||
- ax_reqs (aexpr.get ());
|
||||
-
|
||||
- report_agent_reqs_errors (aexpr.get ());
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
}
|
||||
}
|
||||
while (p && *p++ == ',');
|
||||
@@ -731,11 +739,7 @@ validate_actionline (const char *line, struct breakpoint *b)
|
||||
long. */
|
||||
agent_expr_up aexpr = gen_eval_for_expr (loc->address, exp.get ());
|
||||
|
||||
- if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
||||
- error (_("Expression is too complicated."));
|
||||
-
|
||||
- ax_reqs (aexpr.get ());
|
||||
- report_agent_reqs_errors (aexpr.get ());
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
}
|
||||
}
|
||||
while (p && *p++ == ',');
|
||||
@@ -811,10 +815,10 @@ memrange_sortmerge (std::vector<memrange> &memranges)
|
||||
}
|
||||
}
|
||||
|
||||
-/* Add a register to a collection list. */
|
||||
+/* Add remote register number REGNO to the collection list mask. */
|
||||
|
||||
void
|
||||
-collection_list::add_register (unsigned int regno)
|
||||
+collection_list::add_remote_register (unsigned int regno)
|
||||
{
|
||||
if (info_verbose)
|
||||
printf_filtered ("collect register %d\n", regno);
|
||||
@@ -824,12 +828,74 @@ collection_list::add_register (unsigned int regno)
|
||||
m_regs_mask[regno / 8] |= 1 << (regno % 8);
|
||||
}
|
||||
|
||||
+/* Add all the registers from the mask in AEXPR to the mask in the
|
||||
+ collection list. Registers in the AEXPR mask are already remote
|
||||
+ register numbers. */
|
||||
+
|
||||
+void
|
||||
+collection_list::add_ax_registers (struct agent_expr *aexpr)
|
||||
+{
|
||||
+ if (aexpr->reg_mask_len > 0)
|
||||
+ {
|
||||
+ for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
||||
+ {
|
||||
+ QUIT; /* Allow user to bail out with ^C. */
|
||||
+ if (aexpr->reg_mask[ndx1] != 0)
|
||||
+ {
|
||||
+ /* Assume chars have 8 bits. */
|
||||
+ for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
||||
+ if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
||||
+ /* It's used -- record it. */
|
||||
+ add_remote_register (ndx1 * 8 + ndx2);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* If REGNO is raw, add its corresponding remote register number to
|
||||
+ the mask. If REGNO is a pseudo-register, figure out the necessary
|
||||
+ registers using a temporary agent expression, and add it to the
|
||||
+ list if it needs more than just a mask. */
|
||||
+
|
||||
+void
|
||||
+collection_list::add_local_register (struct gdbarch *gdbarch,
|
||||
+ unsigned int regno,
|
||||
+ CORE_ADDR scope)
|
||||
+{
|
||||
+ if (regno < gdbarch_num_regs (gdbarch))
|
||||
+ {
|
||||
+ int remote_regno = gdbarch_remote_register_number (gdbarch, regno);
|
||||
+
|
||||
+ if (remote_regno < 0)
|
||||
+ error (_("Can't collect register %d"), regno);
|
||||
+
|
||||
+ add_remote_register (remote_regno);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ agent_expr_up aexpr (new agent_expr (gdbarch, scope));
|
||||
+
|
||||
+ ax_reg_mask (aexpr.get (), regno);
|
||||
+
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
+
|
||||
+ add_ax_registers (aexpr.get ());
|
||||
+
|
||||
+ /* Usually ax_reg_mask for a pseudo-regiser only sets the
|
||||
+ corresponding raw registers in the ax mask, but if this isn't
|
||||
+ the case add the expression that is generated to the
|
||||
+ collection list. */
|
||||
+ if (aexpr->len > 0)
|
||||
+ add_aexpr (std::move (aexpr));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Add a memrange to a collection list. */
|
||||
|
||||
void
|
||||
collection_list::add_memrange (struct gdbarch *gdbarch,
|
||||
int type, bfd_signed_vma base,
|
||||
- ULONGEST len)
|
||||
+ ULONGEST len, CORE_ADDR scope)
|
||||
{
|
||||
if (info_verbose)
|
||||
printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
|
||||
@@ -840,7 +906,7 @@ collection_list::add_memrange (struct gdbarch *gdbarch,
|
||||
m_memranges.emplace_back (type, base, base + len);
|
||||
|
||||
if (type != memrange_absolute) /* Better collect the base register! */
|
||||
- add_register (type);
|
||||
+ add_local_register (gdbarch, type, scope);
|
||||
}
|
||||
|
||||
/* Add a symbol to a collection list. */
|
||||
@@ -882,19 +948,19 @@ collection_list::collect_symbol (struct symbol *sym,
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT)
|
||||
treat_as_expr = 1;
|
||||
else
|
||||
- add_memrange (gdbarch, memrange_absolute, offset, len);
|
||||
+ add_memrange (gdbarch, memrange_absolute, offset, len, scope);
|
||||
break;
|
||||
case LOC_REGISTER:
|
||||
reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch);
|
||||
if (info_verbose)
|
||||
printf_filtered ("LOC_REG[parm] %s: ",
|
||||
SYMBOL_PRINT_NAME (sym));
|
||||
- add_register (reg);
|
||||
+ add_local_register (gdbarch, reg, scope);
|
||||
/* Check for doubles stored in two registers. */
|
||||
/* FIXME: how about larger types stored in 3 or more regs? */
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
|
||||
len > register_size (gdbarch, reg))
|
||||
- add_register (reg + 1);
|
||||
+ add_local_register (gdbarch, reg + 1, scope);
|
||||
break;
|
||||
case LOC_REF_ARG:
|
||||
printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
|
||||
@@ -911,7 +977,7 @@ collection_list::collect_symbol (struct symbol *sym,
|
||||
SYMBOL_PRINT_NAME (sym), pulongest (len),
|
||||
paddress (gdbarch, offset), reg);
|
||||
}
|
||||
- add_memrange (gdbarch, reg, offset, len);
|
||||
+ add_memrange (gdbarch, reg, offset, len, scope);
|
||||
break;
|
||||
case LOC_REGPARM_ADDR:
|
||||
reg = SYMBOL_VALUE (sym);
|
||||
@@ -923,7 +989,7 @@ collection_list::collect_symbol (struct symbol *sym,
|
||||
SYMBOL_PRINT_NAME (sym), pulongest (len),
|
||||
paddress (gdbarch, offset), reg);
|
||||
}
|
||||
- add_memrange (gdbarch, reg, offset, len);
|
||||
+ add_memrange (gdbarch, reg, offset, len, scope);
|
||||
break;
|
||||
case LOC_LOCAL:
|
||||
reg = frame_regno;
|
||||
@@ -935,7 +1001,7 @@ collection_list::collect_symbol (struct symbol *sym,
|
||||
SYMBOL_PRINT_NAME (sym), pulongest (len),
|
||||
paddress (gdbarch, offset), reg);
|
||||
}
|
||||
- add_memrange (gdbarch, reg, offset, len);
|
||||
+ add_memrange (gdbarch, reg, offset, len, scope);
|
||||
break;
|
||||
|
||||
case LOC_UNRESOLVED:
|
||||
@@ -968,26 +1034,10 @@ collection_list::collect_symbol (struct symbol *sym,
|
||||
return;
|
||||
}
|
||||
|
||||
- ax_reqs (aexpr.get ());
|
||||
-
|
||||
- report_agent_reqs_errors (aexpr.get ());
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
|
||||
/* Take care of the registers. */
|
||||
- if (aexpr->reg_mask_len > 0)
|
||||
- {
|
||||
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
||||
- {
|
||||
- QUIT; /* Allow user to bail out with ^C. */
|
||||
- if (aexpr->reg_mask[ndx1] != 0)
|
||||
- {
|
||||
- /* Assume chars have 8 bits. */
|
||||
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
||||
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
||||
- /* It's used -- record it. */
|
||||
- add_register (ndx1 * 8 + ndx2);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ add_ax_registers (aexpr.get ());
|
||||
|
||||
add_aexpr (std::move (aexpr));
|
||||
}
|
||||
@@ -1257,8 +1307,18 @@ encode_actions_1 (struct command_line *action,
|
||||
|
||||
if (0 == strncasecmp ("$reg", action_exp, 4))
|
||||
{
|
||||
- for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++)
|
||||
- collect->add_register (i);
|
||||
+ for (i = 0; i < gdbarch_num_regs (target_gdbarch ());
|
||||
+ i++)
|
||||
+ {
|
||||
+ int remote_regno = (gdbarch_remote_register_number
|
||||
+ (target_gdbarch (), i));
|
||||
+
|
||||
+ /* Ignore arch regnos without a corresponding
|
||||
+ remote regno. This can happen for regnos not
|
||||
+ in the tdesc. */
|
||||
+ if (remote_regno >= 0)
|
||||
+ collect->add_remote_register (remote_regno);
|
||||
+ }
|
||||
action_exp = strchr (action_exp, ','); /* more? */
|
||||
}
|
||||
else if (0 == strncasecmp ("$arg", action_exp, 4))
|
||||
@@ -1288,27 +1348,10 @@ encode_actions_1 (struct command_line *action,
|
||||
target_gdbarch (),
|
||||
trace_string);
|
||||
|
||||
- ax_reqs (aexpr.get ());
|
||||
- report_agent_reqs_errors (aexpr.get ());
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
|
||||
/* take care of the registers */
|
||||
- if (aexpr->reg_mask_len > 0)
|
||||
- {
|
||||
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
||||
- {
|
||||
- QUIT; /* allow user to bail out with ^C */
|
||||
- if (aexpr->reg_mask[ndx1] != 0)
|
||||
- {
|
||||
- /* assume chars have 8 bits */
|
||||
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
||||
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
||||
- {
|
||||
- /* It's used -- record it. */
|
||||
- collect->add_register (ndx1 * 8 + ndx2);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ collect->add_ax_registers (aexpr.get ());
|
||||
|
||||
collect->add_aexpr (std::move (aexpr));
|
||||
action_exp = strchr (action_exp, ','); /* more? */
|
||||
@@ -1340,7 +1383,8 @@ encode_actions_1 (struct command_line *action,
|
||||
name);
|
||||
if (info_verbose)
|
||||
printf_filtered ("OP_REGISTER: ");
|
||||
- collect->add_register (i);
|
||||
+ collect->add_local_register (target_gdbarch (),
|
||||
+ i, tloc->address);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1396,8 @@ encode_actions_1 (struct command_line *action,
|
||||
check_typedef (exp->elts[1].type);
|
||||
collect->add_memrange (target_gdbarch (),
|
||||
memrange_absolute, addr,
|
||||
- TYPE_LENGTH (exp->elts[1].type));
|
||||
+ TYPE_LENGTH (exp->elts[1].type),
|
||||
+ tloc->address);
|
||||
collect->append_exp (exp.get ());
|
||||
break;
|
||||
|
||||
@@ -1376,28 +1421,10 @@ encode_actions_1 (struct command_line *action,
|
||||
exp.get (),
|
||||
trace_string);
|
||||
|
||||
- ax_reqs (aexpr.get ());
|
||||
-
|
||||
- report_agent_reqs_errors (aexpr.get ());
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
|
||||
/* Take care of the registers. */
|
||||
- if (aexpr->reg_mask_len > 0)
|
||||
- {
|
||||
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
||||
- {
|
||||
- QUIT; /* Allow user to bail out with ^C. */
|
||||
- if (aexpr->reg_mask[ndx1] != 0)
|
||||
- {
|
||||
- /* Assume chars have 8 bits. */
|
||||
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
||||
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
||||
- {
|
||||
- /* It's used -- record it. */
|
||||
- collect->add_register (ndx1 * 8 + ndx2);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ collect->add_ax_registers (aexpr.get ());
|
||||
|
||||
collect->add_aexpr (std::move (aexpr));
|
||||
collect->append_exp (exp.get ());
|
||||
@@ -1422,8 +1449,7 @@ encode_actions_1 (struct command_line *action,
|
||||
agent_expr_up aexpr = gen_eval_for_expr (tloc->address,
|
||||
exp.get ());
|
||||
|
||||
- ax_reqs (aexpr.get ());
|
||||
- report_agent_reqs_errors (aexpr.get ());
|
||||
+ finalize_tracepoint_aexpr (aexpr.get ());
|
||||
|
||||
/* Even though we're not officially collecting, add
|
||||
to the collect list anyway. */
|
||||
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
|
||||
--- a/gdb/tracepoint.h
|
||||
+++ b/gdb/tracepoint.h
|
||||
@@ -263,9 +263,14 @@ public:
|
||||
void add_aexpr (agent_expr_up aexpr);
|
||||
|
||||
void add_register (unsigned int regno);
|
||||
+ void add_remote_register (unsigned int regno);
|
||||
+ void add_ax_registers (struct agent_expr *aexpr);
|
||||
+ void add_local_register (struct gdbarch *gdbarch,
|
||||
+ unsigned int regno,
|
||||
+ CORE_ADDR scope);
|
||||
void add_memrange (struct gdbarch *gdbarch,
|
||||
int type, bfd_signed_vma base,
|
||||
- ULONGEST len);
|
||||
+ ULONGEST len, CORE_ADDR scope);
|
||||
void collect_symbol (struct symbol *sym,
|
||||
struct gdbarch *gdbarch,
|
||||
long frame_regno, long frame_offset,
|
||||
@ -1,215 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 17:17:46 +0200
|
||||
Subject: gdb-rhbz1187581-power8-regs-5of7.patch
|
||||
|
||||
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
||||
|
||||
commit a04b9d62a234923826e431a209d396a628661548
|
||||
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
Date: Mon Aug 6 16:24:55 2018 -0300
|
||||
|
||||
Variable size for regs mask in collection list
|
||||
|
||||
This patch changes collection_list to allow larger register masks.
|
||||
|
||||
The mask is changed from an array to a vector and is initialized to
|
||||
hold the maximum possible remote register number. The stringify
|
||||
method is updated to resize temp_buf if needed.
|
||||
|
||||
gdb/ChangeLog:
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* tracepoint.h (collection_list) <m_regs_mask>: Change type to
|
||||
std::vector<unsigned char>.
|
||||
* tracepoint.c (collection_list::collection_list): Remove
|
||||
m_regs_mask initializer from initializer list. Resize
|
||||
m_regs_mask using the largest remote register number.
|
||||
(collection_list::add_remote_register): Remove size check on
|
||||
m_regs_mask. Use at to access element.
|
||||
(collection_list::stringify): Change type of temp_buf to
|
||||
gdb::char_vector. Update uses of temp_buf. Resize if needed to
|
||||
stringify the register mask. Use pack_hex_byte for the register
|
||||
mask.
|
||||
|
||||
+2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
+
|
||||
+ * tracepoint.h (collection_list) <m_regs_mask>: Change type to
|
||||
+ std::vector<unsigned char>.
|
||||
+ * tracepoint.c (collection_list::collection_list): Remove
|
||||
+ m_regs_mask initializer from initializer list. Resize
|
||||
+ m_regs_mask using the largest remote register number.
|
||||
+ (collection_list::add_remote_register): Remove size check on
|
||||
+ m_regs_mask. Use at to access element.
|
||||
+ (collection_list::stringify): Change type of temp_buf to
|
||||
+ gdb::char_vector. Update uses of temp_buf. Resize if needed to
|
||||
+ stringify the register mask. Use pack_hex_byte for the register
|
||||
+ mask.
|
||||
+
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* tracepoint.h (class collection_list) <add_register>: Remove.
|
||||
|
||||
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
|
||||
--- a/gdb/tracepoint.c
|
||||
+++ b/gdb/tracepoint.c
|
||||
@@ -822,10 +822,8 @@ collection_list::add_remote_register (unsigned int regno)
|
||||
{
|
||||
if (info_verbose)
|
||||
printf_filtered ("collect register %d\n", regno);
|
||||
- if (regno >= (8 * sizeof (m_regs_mask)))
|
||||
- error (_("Internal: register number %d too large for tracepoint"),
|
||||
- regno);
|
||||
- m_regs_mask[regno / 8] |= 1 << (regno % 8);
|
||||
+
|
||||
+ m_regs_mask.at (regno / 8) |= 1 << (regno % 8);
|
||||
}
|
||||
|
||||
/* Add all the registers from the mask in AEXPR to the mask in the
|
||||
@@ -1136,9 +1134,20 @@ collection_list::add_static_trace_data ()
|
||||
}
|
||||
|
||||
collection_list::collection_list ()
|
||||
- : m_regs_mask (),
|
||||
- m_strace_data (false)
|
||||
+ : m_strace_data (false)
|
||||
{
|
||||
+ int max_remote_regno = 0;
|
||||
+ for (int i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++)
|
||||
+ {
|
||||
+ int remote_regno = (gdbarch_remote_register_number
|
||||
+ (target_gdbarch (), i));
|
||||
+
|
||||
+ if (remote_regno >= 0 && remote_regno > max_remote_regno)
|
||||
+ max_remote_regno = remote_regno;
|
||||
+ }
|
||||
+
|
||||
+ m_regs_mask.resize ((max_remote_regno / 8) + 1);
|
||||
+
|
||||
m_memranges.reserve (128);
|
||||
m_aexprs.reserve (128);
|
||||
}
|
||||
@@ -1148,7 +1157,8 @@ collection_list::collection_list ()
|
||||
std::vector<std::string>
|
||||
collection_list::stringify ()
|
||||
{
|
||||
- char temp_buf[2048];
|
||||
+ gdb::char_vector temp_buf (2048);
|
||||
+
|
||||
int count;
|
||||
char *end;
|
||||
long i;
|
||||
@@ -1158,35 +1168,45 @@ collection_list::stringify ()
|
||||
{
|
||||
if (info_verbose)
|
||||
printf_filtered ("\nCollecting static trace data\n");
|
||||
- end = temp_buf;
|
||||
+ end = temp_buf.data ();
|
||||
*end++ = 'L';
|
||||
- str_list.emplace_back (temp_buf, end - temp_buf);
|
||||
+ str_list.emplace_back (temp_buf.data (), end - temp_buf.data ());
|
||||
}
|
||||
|
||||
- for (i = sizeof (m_regs_mask) - 1; i > 0; i--)
|
||||
+ for (i = m_regs_mask.size () - 1; i > 0; i--)
|
||||
if (m_regs_mask[i] != 0) /* Skip leading zeroes in regs_mask. */
|
||||
break;
|
||||
if (m_regs_mask[i] != 0) /* Prepare to send regs_mask to the stub. */
|
||||
{
|
||||
if (info_verbose)
|
||||
printf_filtered ("\nCollecting registers (mask): 0x");
|
||||
- end = temp_buf;
|
||||
+
|
||||
+ /* One char for 'R', one for the null terminator and two per
|
||||
+ mask byte. */
|
||||
+ std::size_t new_size = (i + 1) * 2 + 2;
|
||||
+ if (new_size > temp_buf.size ())
|
||||
+ temp_buf.resize (new_size);
|
||||
+
|
||||
+ end = temp_buf.data ();
|
||||
*end++ = 'R';
|
||||
for (; i >= 0; i--)
|
||||
{
|
||||
QUIT; /* Allow user to bail out with ^C. */
|
||||
if (info_verbose)
|
||||
printf_filtered ("%02X", m_regs_mask[i]);
|
||||
- sprintf (end, "%02X", m_regs_mask[i]);
|
||||
- end += 2;
|
||||
+
|
||||
+ end = pack_hex_byte (end, m_regs_mask[i]);
|
||||
}
|
||||
- str_list.emplace_back (temp_buf);
|
||||
+ *end = '\0';
|
||||
+
|
||||
+ str_list.emplace_back (temp_buf.data ());
|
||||
}
|
||||
if (info_verbose)
|
||||
printf_filtered ("\n");
|
||||
if (!m_memranges.empty () && info_verbose)
|
||||
printf_filtered ("Collecting memranges: \n");
|
||||
- for (i = 0, count = 0, end = temp_buf; i < m_memranges.size (); i++)
|
||||
+ for (i = 0, count = 0, end = temp_buf.data ();
|
||||
+ i < m_memranges.size (); i++)
|
||||
{
|
||||
QUIT; /* Allow user to bail out with ^C. */
|
||||
if (info_verbose)
|
||||
@@ -1200,9 +1220,9 @@ collection_list::stringify ()
|
||||
}
|
||||
if (count + 27 > MAX_AGENT_EXPR_LEN)
|
||||
{
|
||||
- str_list.emplace_back (temp_buf, count);
|
||||
+ str_list.emplace_back (temp_buf.data (), count);
|
||||
count = 0;
|
||||
- end = temp_buf;
|
||||
+ end = temp_buf.data ();
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1222,7 +1242,7 @@ collection_list::stringify ()
|
||||
}
|
||||
|
||||
count += strlen (end);
|
||||
- end = temp_buf + count;
|
||||
+ end = temp_buf.data () + count;
|
||||
}
|
||||
|
||||
for (i = 0; i < m_aexprs.size (); i++)
|
||||
@@ -1230,9 +1250,9 @@ collection_list::stringify ()
|
||||
QUIT; /* Allow user to bail out with ^C. */
|
||||
if ((count + 10 + 2 * m_aexprs[i]->len) > MAX_AGENT_EXPR_LEN)
|
||||
{
|
||||
- str_list.emplace_back (temp_buf, count);
|
||||
+ str_list.emplace_back (temp_buf.data (), count);
|
||||
count = 0;
|
||||
- end = temp_buf;
|
||||
+ end = temp_buf.data ();
|
||||
}
|
||||
sprintf (end, "X%08X,", m_aexprs[i]->len);
|
||||
end += 10; /* 'X' + 8 hex digits + ',' */
|
||||
@@ -1244,9 +1264,9 @@ collection_list::stringify ()
|
||||
|
||||
if (count != 0)
|
||||
{
|
||||
- str_list.emplace_back (temp_buf, count);
|
||||
+ str_list.emplace_back (temp_buf.data (), count);
|
||||
count = 0;
|
||||
- end = temp_buf;
|
||||
+ end = temp_buf.data ();
|
||||
}
|
||||
|
||||
return str_list;
|
||||
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
|
||||
--- a/gdb/tracepoint.h
|
||||
+++ b/gdb/tracepoint.h
|
||||
@@ -293,8 +293,9 @@ public:
|
||||
{ return m_computed; }
|
||||
|
||||
private:
|
||||
- /* room for up to 256 regs */
|
||||
- unsigned char m_regs_mask[32];
|
||||
+ /* We need the allocator zero-initialize the mask, so we don't use
|
||||
+ gdb::byte_vector. */
|
||||
+ std::vector<unsigned char> m_regs_mask;
|
||||
|
||||
std::vector<memrange> m_memranges;
|
||||
|
||||
@ -1,187 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 17:18:15 +0200
|
||||
Subject: gdb-rhbz1187581-power8-regs-6of7.patch
|
||||
|
||||
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
||||
|
||||
commit 296956befef3711ed458c7cba8041fde0dab9c50
|
||||
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
Date: Mon Aug 6 16:24:55 2018 -0300
|
||||
|
||||
Allow larger regblock sizes when saving tracefiles
|
||||
|
||||
The tracefile.c:trace_save function assumes trace_regblock_size won't
|
||||
be larger than the MAX_TRACE_UPLOAD constant, used to size the buffer
|
||||
which holds trace data. This can cause buffer overruns when this is
|
||||
not the case. This patch changes this function so that the larger
|
||||
size is used to size the buffer.
|
||||
|
||||
gdb/ChangeLog:
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* tracefile.c: Include common/byte-vector.h.
|
||||
(trace_save): Change type of buf to gdb::byte_vector. Initialize
|
||||
with trace_regblock_size if needed. Update uses of buf.
|
||||
|
||||
+2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
+
|
||||
+ * tracefile.c: Include common/byte-vector.h.
|
||||
+ (trace_save): Change type of buf to gdb::byte_vector. Initialize
|
||||
+ with trace_regblock_size if needed. Update uses of buf.
|
||||
+
|
||||
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
||||
|
||||
* tracepoint.h (collection_list) <m_regs_mask>: Change type to
|
||||
|
||||
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
|
||||
--- a/gdb/tracefile.c
|
||||
+++ b/gdb/tracefile.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "ctf.h"
|
||||
#include "exec.h"
|
||||
#include "regcache.h"
|
||||
+#include "common/byte-vector.h"
|
||||
|
||||
/* Helper macros. */
|
||||
|
||||
@@ -67,7 +68,7 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
|
||||
ULONGEST offset = 0;
|
||||
#define MAX_TRACE_UPLOAD 2000
|
||||
- gdb_byte buf[MAX_TRACE_UPLOAD];
|
||||
+ gdb::byte_vector buf (std::max (MAX_TRACE_UPLOAD, trace_regblock_size));
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
|
||||
|
||||
/* If the target is to save the data to a file on its own, then just
|
||||
@@ -144,7 +145,7 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
/* We ask for big blocks, in the hopes of efficiency, but
|
||||
will take less if the target has packet size limitations
|
||||
or some such. */
|
||||
- gotten = target_get_raw_trace_data (buf, offset,
|
||||
+ gotten = target_get_raw_trace_data (buf.data (), offset,
|
||||
MAX_TRACE_UPLOAD);
|
||||
if (gotten < 0)
|
||||
error (_("Failure to get requested trace buffer data"));
|
||||
@@ -152,7 +153,7 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
if (gotten == 0)
|
||||
break;
|
||||
|
||||
- writer->ops->write_trace_buffer (writer, buf, gotten);
|
||||
+ writer->ops->write_trace_buffer (writer, buf.data (), gotten);
|
||||
|
||||
offset += gotten;
|
||||
}
|
||||
@@ -163,7 +164,7 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
/* Parse the trace buffers according to how data are stored
|
||||
in trace buffer in GDBserver. */
|
||||
|
||||
- gotten = target_get_raw_trace_data (buf, offset, 6);
|
||||
+ gotten = target_get_raw_trace_data (buf.data (), offset, 6);
|
||||
|
||||
if (gotten == 0)
|
||||
break;
|
||||
@@ -171,10 +172,10 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
/* Read the first six bytes in, which is the tracepoint
|
||||
number and trace frame size. */
|
||||
tp_num = (uint16_t)
|
||||
- extract_unsigned_integer (&buf[0], 2, byte_order);
|
||||
+ extract_unsigned_integer (&((buf.data ())[0]), 2, byte_order);
|
||||
|
||||
tf_size = (uint32_t)
|
||||
- extract_unsigned_integer (&buf[2], 4, byte_order);
|
||||
+ extract_unsigned_integer (&((buf.data ())[2]), 4, byte_order);
|
||||
|
||||
writer->ops->frame_ops->start (writer, tp_num);
|
||||
gotten = 6;
|
||||
@@ -192,7 +193,8 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
/* We'll fetch one block each time, in order to
|
||||
handle the extremely large 'M' block. We first
|
||||
fetch one byte to get the type of the block. */
|
||||
- gotten = target_get_raw_trace_data (buf, offset, 1);
|
||||
+ gotten = target_get_raw_trace_data (buf.data (),
|
||||
+ offset, 1);
|
||||
if (gotten < 1)
|
||||
error (_("Failure to get requested trace buffer data"));
|
||||
|
||||
@@ -205,13 +207,13 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
{
|
||||
case 'R':
|
||||
gotten
|
||||
- = target_get_raw_trace_data (buf, offset,
|
||||
+ = target_get_raw_trace_data (buf.data (), offset,
|
||||
trace_regblock_size);
|
||||
if (gotten < trace_regblock_size)
|
||||
error (_("Failure to get requested trace"
|
||||
" buffer data"));
|
||||
|
||||
- TRACE_WRITE_R_BLOCK (writer, buf,
|
||||
+ TRACE_WRITE_R_BLOCK (writer, buf.data (),
|
||||
trace_regblock_size);
|
||||
break;
|
||||
case 'M':
|
||||
@@ -221,7 +223,8 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
LONGEST t;
|
||||
int j;
|
||||
|
||||
- t = target_get_raw_trace_data (buf,offset, 10);
|
||||
+ t = target_get_raw_trace_data (buf.data (),
|
||||
+ offset, 10);
|
||||
if (t < 10)
|
||||
error (_("Failure to get requested trace"
|
||||
" buffer data"));
|
||||
@@ -231,10 +234,10 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
|
||||
gotten = 0;
|
||||
addr = (ULONGEST)
|
||||
- extract_unsigned_integer (buf, 8,
|
||||
+ extract_unsigned_integer (buf.data (), 8,
|
||||
byte_order);
|
||||
mlen = (unsigned short)
|
||||
- extract_unsigned_integer (&buf[8], 2,
|
||||
+ extract_unsigned_integer (&((buf.data ())[8]), 2,
|
||||
byte_order);
|
||||
|
||||
TRACE_WRITE_M_BLOCK_HEADER (writer, addr,
|
||||
@@ -252,14 +255,15 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
else
|
||||
read_length = mlen - j;
|
||||
|
||||
- t = target_get_raw_trace_data (buf,
|
||||
+ t = target_get_raw_trace_data (buf.data (),
|
||||
offset + j,
|
||||
read_length);
|
||||
if (t < read_length)
|
||||
error (_("Failure to get requested"
|
||||
" trace buffer data"));
|
||||
|
||||
- TRACE_WRITE_M_BLOCK_MEMORY (writer, buf,
|
||||
+ TRACE_WRITE_M_BLOCK_MEMORY (writer,
|
||||
+ buf.data (),
|
||||
read_length);
|
||||
|
||||
j += read_length;
|
||||
@@ -274,18 +278,18 @@ trace_save (const char *filename, struct trace_file_writer *writer,
|
||||
LONGEST val;
|
||||
|
||||
gotten
|
||||
- = target_get_raw_trace_data (buf, offset,
|
||||
- 12);
|
||||
+ = target_get_raw_trace_data (buf.data (),
|
||||
+ offset, 12);
|
||||
if (gotten < 12)
|
||||
error (_("Failure to get requested"
|
||||
" trace buffer data"));
|
||||
|
||||
- vnum = (int) extract_signed_integer (buf,
|
||||
+ vnum = (int) extract_signed_integer (buf.data (),
|
||||
4,
|
||||
byte_order);
|
||||
val
|
||||
- = extract_signed_integer (&buf[4], 8,
|
||||
- byte_order);
|
||||
+ = extract_signed_integer (&((buf.data ())[4]),
|
||||
+ 8, byte_order);
|
||||
|
||||
TRACE_WRITE_V_BLOCK (writer, vnum, val);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user