Accepting request 851872 from devel:gcc
- Mention fedora patch fixups added: * fixup-3-gdb-archer-vla-tests.patch - Mention patch to be upstreamed added: * gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch - Fedora patch fixups update: * fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch - Fedora patch fixups added: * fixup-gdb-test-ivy-bridge.patch - Add xz to BuildRequires for testsuite flavour. - Add note on mpfr-devel for SLE-11. - Backport from master: * gdb-testsuite-fix-failure-in-gdb-base-step-over-no-symbols-exp.patch - Patch to be upstreamed: * gdb-testsuite-fix-control-flow-in-gdb-reverse-insn-reverse-exp.patch - Patch updated: * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch - Patch updated: * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch - Patch to be upstreamed: * gdb-testsuite-gdb-base-morestack-exp-no-clang.patch * gdb-testsuite-handle-sigill-in-gdb-reverse-insn-reverse-exp.patch * gdb-testsuite-fix-gdb-reverse-insn-reverse-x86-c-for-m32.patch * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch * gdb-tui-enable-work-around-libncurses-segfault.patch - Backport from master dropped: * gdb-testsuite-fix-unbalanced-braces-in-gdb-tui-new-layout-exp.patch - Fedora patch fixups updated: * fixup-2-gdb-archer-vla-tests.patch - Fedora patch fixups added: * fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch - Testsuite patch: * gdb-testsuite-disable-selftests-for-factory.patch - Backport from master: * gdb-symtab-read-cu-base-address-for-enqueued-cu.patch * gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch * gdb-fix-section-matching-in-find_pc_sect_compunit.patch * gdb-symtab-fix-language-of-frame-without-debug-info.patch - Patch to be upstreamed: * gdb-symtab-set-default-dwarf-max-cache-age-1000.patch - BuildRequire curl for debuginfod test-case. - Patch to be upstreamed: * gdb-don-t-return-non-existing-path-in-debuginfod-source-query.patch * gdb-fix-assert-in-process-event-stop-test.patch * gdb-fix-filename-in-not-in-executable-format-error.patch * gdb-handle-no-upper-bound-in-value-subscript.patch * gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch - Testsuite patch: * gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch - Fedora patch fixups added: * fixup-gdb-rhbz1156192-recursive-dlopen-test.patch - Fedora patch fixups updated: * fixup-gdb-btrobust.patch * fixup-2-gdb-archer-vla-tests.patch - Add missing patch command for: * gdb-fortran-fix-print-dynamic-array.patch - Fix patch application on SLE-11: * gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch - Disable xz-devel and binutils-gold for SLE-10. - More enabling of gdbserver for riscv64. - Backport from master: * gdb-testsuite-fix-unbalanced-braces-in-gdb-tui-new-layout-exp.patch * gdb-testsuite-catch-condition-evaluation-errors-in-gdb-assert.patch * gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch * gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch - Patch to be upstreamed: * gdb-fortran-fix-print-dynamic-array.patch - Enable gdbserver for riscv64. - Restrict BuildRequires libdebuginfod to Factory and supporting archs. - Rebase to 10.1 release (as in fedora 33 @ 6c8ccd6). * Debuginfod support. * Multi-target debugging support. * Multithreaded symbol loading enabled by default. * New command set exec-file-mismatch. * New command tui new-layout. * Alias command can now specify default args for an alias. - Update libipt to v2.0.2. - Fedora-specific patches dropped: * gdb-6.8-bz466901-backtrace-full-prelinked.patch - Broken/obsolete fedora patches dropped: * gdb-bz533176-fortran-omp-step.patch * gdb-6.5-BEA-testsuite.patch * gdb-6.7-charsign-test.patch - Obsoleted fedora patches dropped: * gdb-6.3-attach-see-vdso-test.patch * gdb-6.3-inferior-notification-20050721.patch * gdb-6.5-gcore-buffer-limit-test.patch * gdb-6.5-missed-trap-on-step-test.patch * gdb-rhbz1818011-bfd-gcc10-error.patch - Fedora patches updated: * gdb-6.3-gstack-20050411.patch * gdb-6.3-test-self-20050110.patch * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch * gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch * gdb-6.6-buildid-locate-core-as-arg.patch * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch * gdb-6.6-buildid-locate-rpm-scl.patch * gdb-6.6-buildid-locate-rpm.patch * gdb-6.6-buildid-locate-solib-missing-ids.patch * gdb-6.6-buildid-locate.patch * gdb-6.7-testsuite-stable-results.patch * gdb-6.8-quit-never-aborts.patch * gdb-archer-pie-addons-keep-disabled.patch * gdb-archer-pie-addons.patch * gdb-archer-vla-tests.patch * gdb-attach-fail-reasons-5of5.patch * gdb-bz1219747-attach-kills.patch * gdb-bz533176-fortran-omp-step.patch * gdb-container-rh-pkg.patch * gdb-fedora-libncursesw.patch * gdb-gnat-dwarf-crash-3of3.patch * gdb-jit-reader-multilib.patch * gdb-linux_perf-bundle.patch * gdb-moribund-utrace-workaround.patch * gdb-runtest-pie-override.patch * gdb-vla-intel-fix-print-char-array.patch * gdb-vla-intel-fortran-strides.patch * gdb-vla-intel-fortran-vla-strings.patch * gdb-vla-intel-stringbt-fix.patch * gdb-vla-intel-tests.patch - Fedora patches added: * gdb-config.patch - Obsoleted patched dropped: * gdb-testsuite-avoid-pagination-in-attach-32.exp.patch * gdb-fix-toplevel-types-with-fdebug-types-section.patch * gdb-fix-range-loop-index-in-find_method.patch * gdb-fix-python3.9-related-runtime-problems.patch * gdb-fix-unused-function-error.patch * gdb-fix-the-thread-pool.c-compilation.patch * gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch * gdb-fix-debug-agent-odr-bool-int.patch * gdbserver-fix-build-with-make-3.81.patch * gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch - Fedora patch fixups added: * fixup-gdb-6.3-test-pie-20050107.patch * fixup-gdb-6.5-sharedlibrary-path.patch * fixup-gdb-6.6-buildid-locate.patch * fixup-gdb-6.8-bz442765-threaded-exec-test.patch * fixup-gdb-archer-vla-tests.patch * fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch * fixup-gdb-btrobust.patch * fixup-gdb-bz634108-solib_address.patch * fixup-gdb-dts-rhel6-python-compat.patch * fixup-gdb-gnat-dwarf-crash-3of3.patch * fixup-gdb-vla-intel-fortran-vla-strings.patch * fixup-gdb-vla-intel-tests.patch * fixup-gdb-6.3-threaded-watchpoints2-20050225.patch - Patches renamed: * gdb-testsuite-fix-perror-in-gdb.opt-fortran-string.exp.patch to fixup-2-gdb-archer-vla-tests.patch - Patches updated: * gdb-testsuite-ada-pie.patch - Backport from master: * gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch OBS-URL: https://build.opensuse.org/request/show/851872 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=144
This commit is contained in:
commit
20c750ab1d
41
fixup-2-gdb-archer-vla-tests.patch
Normal file
41
fixup-2-gdb-archer-vla-tests.patch
Normal file
@ -0,0 +1,41 @@
|
||||
fixup-2-gdb-archer-vla-tests
|
||||
|
||||
Fixup gdb-archer-vla-tests.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.opt/fortran-string.exp | 11 +++++++++--
|
||||
gdb/testsuite/gdb.opt/fortran-string.f90 | 1 +
|
||||
2 files changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp
|
||||
index 90a2bdf..5255424 100644
|
||||
--- a/gdb/testsuite/gdb.opt/fortran-string.exp
|
||||
+++ b/gdb/testsuite/gdb.opt/fortran-string.exp
|
||||
@@ -34,6 +34,13 @@ if ![runto $srcfile:[gdb_get_line_number "s = s"]] then {
|
||||
continue
|
||||
}
|
||||
|
||||
-gdb_test "frame" ".*s='foo'.*"
|
||||
-gdb_test "ptype s" "type = character\\*3"
|
||||
+gdb_test "info args" ".*s = 'foo'.*"
|
||||
+gdb_test_multiple "ptype s" "" {
|
||||
+ -re -wrap "type = character \\(3\\)" {
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+ -re -wrap "type = character\\*3" {
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+}
|
||||
gdb_test "p s" "\\$\[0-9\]* = 'foo'"
|
||||
diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90
|
||||
index e48d520..e3bb6ad 100644
|
||||
--- a/gdb/testsuite/gdb.opt/fortran-string.f90
|
||||
+++ b/gdb/testsuite/gdb.opt/fortran-string.f90
|
||||
@@ -21,6 +21,7 @@
|
||||
subroutine f(s)
|
||||
character*(*) s
|
||||
s = s
|
||||
+ print *, s
|
||||
end
|
||||
|
||||
program main
|
51
fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch
Normal file
51
fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch
Normal file
@ -0,0 +1,51 @@
|
||||
Fixup gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
|
||||
- Fix __malloc_check usage to fix "free: invalid pointer" error with
|
||||
GLIBC_TUNABLES=glibc.malloc.check=3.
|
||||
- Handle older libc, for which we run into glibc PR17702:
|
||||
Inconsistency detected by ld.so: dl-open.c: 222: dl_open_worker: Assertion \
|
||||
`_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT' failed!
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c | 1 +
|
||||
.../gdb.base/gdb-rhbz1156192-recursive-dlopen.exp | 15 +++++++++++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
|
||||
index 17b29904ef..7696666c16 100644
|
||||
--- a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
|
||||
@@ -94,6 +94,7 @@ custom_malloc_hook (size_t size, const void *caller)
|
||||
/* Called recursively. */
|
||||
result = malloc (size);
|
||||
/* Restore new hooks. */
|
||||
+ old_malloc_hook = __malloc_hook;
|
||||
__malloc_hook = custom_malloc_hook;
|
||||
return result;
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
index 6e4d3621a3..28e6e465ee 100644
|
||||
--- a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
@@ -49,6 +49,21 @@ if { [prepare_for_testing ${testfile}.exp ${executable} ${srcfile} \
|
||||
return -1
|
||||
}
|
||||
|
||||
+set supported 0
|
||||
+gdb_test_multiple "run" "initial trial run" {
|
||||
+ -re -wrap "exited normally.*" {
|
||||
+ set supported 1
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+ -re -wrap "exited with code.*" {
|
||||
+ untested "failed at $gdb_test_name"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { $supported == 0 } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
proc do_test { has_libfoo has_libbar } {
|
||||
global hex binfile_lib2 binfile_lib1 gdb_prompt
|
||||
set libbar_match "[string_to_regexp $binfile_lib2]"
|
24
fixup-3-gdb-archer-vla-tests.patch
Normal file
24
fixup-3-gdb-archer-vla-tests.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp
|
||||
index ef404244028..70afbcc3bc9 100644
|
||||
--- a/gdb/testsuite/gdb.cp/gdb9593.exp
|
||||
+++ b/gdb/testsuite/gdb.cp/gdb9593.exp
|
||||
@@ -141,9 +141,16 @@ gdb_test "step" \
|
||||
".*function1 ().*" \
|
||||
"step into finish, for until"
|
||||
|
||||
-gdb_test "until" \
|
||||
- ".*function1 ().*" \
|
||||
- "until with no argument 1"
|
||||
+gdb_test_multiple "until" "until with no argument 1" {
|
||||
+ -re -wrap ".*function1 ().*" {
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+ -re -wrap ".*$hex\t80\t \}" {
|
||||
+ # PR gcc/97774 - "Incorrect line info for try/catch"
|
||||
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97774
|
||||
+ xfail $gdb_test_name
|
||||
+ }
|
||||
+}
|
||||
|
||||
set line [gdb_get_line_number "marker for until" $testfile.cc]
|
||||
|
90
fixup-gdb-6.3-test-pie-20050107.patch
Normal file
90
fixup-gdb-6.3-test-pie-20050107.patch
Normal file
@ -0,0 +1,90 @@
|
||||
fixup-gdb-6.3-test-pie-20050107.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.pie/attach.exp | 4 ++--
|
||||
gdb/testsuite/gdb.pie/break.exp | 2 +-
|
||||
gdb/testsuite/gdb.pie/corefile.exp | 15 +++++++--------
|
||||
3 files changed, 10 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.pie/attach.exp b/gdb/testsuite/gdb.pie/attach.exp
|
||||
index 648c92608c3..2af242618de 100644
|
||||
--- a/gdb/testsuite/gdb.pie/attach.exp
|
||||
+++ b/gdb/testsuite/gdb.pie/attach.exp
|
||||
@@ -148,13 +148,13 @@ proc do_attach_tests {} {
|
||||
-re "Load new symbol table from.*y or n.*$" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
- -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
|
||||
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $"\
|
||||
{pass "(re)set file, before attach1"}
|
||||
-re "$gdb_prompt $" {fail "(re)set file, before attach1"}
|
||||
timeout {fail "(timeout) (re)set file, before attach1"}
|
||||
}
|
||||
}
|
||||
- -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
|
||||
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $"\
|
||||
{pass "set file, before attach1"}
|
||||
-re "$gdb_prompt $" {fail "set file, before attach1"}
|
||||
timeout {fail "(timeout) set file, before attach1"}
|
||||
diff --git a/gdb/testsuite/gdb.pie/break.exp b/gdb/testsuite/gdb.pie/break.exp
|
||||
index 97b87397c27..3e07d6a8b31 100644
|
||||
--- a/gdb/testsuite/gdb.pie/break.exp
|
||||
+++ b/gdb/testsuite/gdb.pie/break.exp
|
||||
@@ -319,7 +319,7 @@ if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "catch\n"
|
||||
gdb_expect {
|
||||
- -re "Catch requires an event name.*$gdb_prompt $"\
|
||||
+ -re "List of catch subcommands:.*$gdb_prompt $"\
|
||||
{pass "catch requires an event name"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "catch requires an event name"}
|
||||
diff --git a/gdb/testsuite/gdb.pie/corefile.exp b/gdb/testsuite/gdb.pie/corefile.exp
|
||||
index ca4b01be3eb..2194ccc926c 100644
|
||||
--- a/gdb/testsuite/gdb.pie/corefile.exp
|
||||
+++ b/gdb/testsuite/gdb.pie/corefile.exp
|
||||
@@ -83,11 +83,10 @@ if { $found == 0 } {
|
||||
}
|
||||
}
|
||||
|
||||
-# Try to clean up after ourselves.
|
||||
-remote_file build delete [file join $coredir coremmap.data]
|
||||
-remote_exec build "rmdir $coredir"
|
||||
-
|
||||
if { $found == 0 } {
|
||||
+ # Try to clean up after ourselves.
|
||||
+ remote_file build delete [file join $coredir coremmap.data]
|
||||
+ remote_exec build "rmdir $coredir"
|
||||
warning "can't generate a core file - core tests suppressed - check ulimit -c"
|
||||
return 0
|
||||
}
|
||||
@@ -110,13 +109,13 @@ if { $found == 0 } {
|
||||
|
||||
gdb_exit
|
||||
if $verbose>1 then {
|
||||
- send_user "Spawning $GDB -nw $GDBFLAGS -core=[standard_output_file corefile]\n"
|
||||
+ send_user "Spawning $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS -core=[standard_output_file corefile]\n"
|
||||
}
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout [expr "$timeout + 60"]
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
-eval "spawn $GDB -nw $GDBFLAGS -core=[standard_output_file corefile]"
|
||||
+eval "spawn $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS -core=[standard_output_file corefile]"
|
||||
expect {
|
||||
-re "Couldn't find .* registers in core file.*$gdb_prompt $" {
|
||||
fail "args: -core=corefile (couldn't find regs)"
|
||||
@@ -143,11 +142,11 @@ expect {
|
||||
close;
|
||||
|
||||
if $verbose>1 then {
|
||||
- send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=[standard_output_file corefile]\n"
|
||||
+ send_user "Spawning $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=[standard_output_file corefile]\n"
|
||||
}
|
||||
|
||||
|
||||
-eval "spawn $GDB -nw $GDBFLAGS $binfile -core=[standard_output_file corefile]";
|
||||
+eval "spawn $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=[standard_output_file corefile]";
|
||||
expect {
|
||||
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
|
||||
pass "args: execfile -core=corefile"
|
22
fixup-gdb-6.3-threaded-watchpoints2-20050225.patch
Normal file
22
fixup-gdb-6.3-threaded-watchpoints2-20050225.patch
Normal file
@ -0,0 +1,22 @@
|
||||
Fixup
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.threads/watchthreads-threaded.exp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
||||
index e9cdd59771c..29c470292af 100644
|
||||
--- a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
|
||||
@@ -85,9 +85,9 @@ for {set i 0} {$i < 30} {incr i} {
|
||||
{ set args_2 1; set test_flag 1 }
|
||||
-re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $"
|
||||
{ set args_3 1; set test_flag 1 }
|
||||
- -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*in thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
|
||||
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
|
||||
{ set args_2 [expr $args_2+1]; set test_flag 1 }
|
||||
- -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*in thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
|
||||
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
|
||||
{ set args_3 [expr $args_3+1]; set test_flag 1 }
|
||||
}
|
||||
# If we fail above, don't bother continuing loop
|
41
fixup-gdb-6.5-sharedlibrary-path.patch
Normal file
41
fixup-gdb-6.5-sharedlibrary-path.patch
Normal file
@ -0,0 +1,41 @@
|
||||
[gdb/testsuite] Fixup gdb.threads/tls-sepdebug.exp
|
||||
|
||||
On factory, due to --as-needed we end up with a tls-sepdebug-main without
|
||||
dependency on tls-sepdebug-shared.so:
|
||||
...
|
||||
$ ldd tls-sepdebug-main
|
||||
linux-vdso.so.1 (0x00007fffe7fcf000)
|
||||
libc.so.6 => /lib64/libc.so.6 (0x00007f205f05f000)
|
||||
/lib64/ld-linux-x86-64.so.2 (0x00007f205f232000)
|
||||
...
|
||||
|
||||
Fix this by actually using the variable var (defined in
|
||||
tls-sepdebug-shared.so) in tls-sepdebug-main.
|
||||
|
||||
Likewise, we end up without a dependency on libpthread.so.0, which we need to
|
||||
read tls vars. Add a call to pthread_testcancel, as in
|
||||
gdb.threads/tls-var-main.c
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.threads/tls-sepdebug-main.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
||||
index ea5d0174d6a..87803f6d27e 100644
|
||||
--- a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
||||
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
|
||||
@@ -19,7 +19,13 @@
|
||||
Please email any bugs, comments, and/or additions to this file to:
|
||||
bug-gdb@prep.ai.mit.edu */
|
||||
|
||||
+#include <pthread.h>
|
||||
+
|
||||
+extern __thread int var;
|
||||
+
|
||||
int main()
|
||||
{
|
||||
- return 0;
|
||||
+ /* Ensure we link against pthreads even with --as-needed. */
|
||||
+ pthread_testcancel();
|
||||
+ return var;
|
||||
}
|
20
fixup-gdb-6.6-buildid-locate.patch
Normal file
20
fixup-gdb-6.6-buildid-locate.patch
Normal file
@ -0,0 +1,20 @@
|
||||
[gdb/testsuite] Fixup buildid-locate
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.base/gdbinit-history.exp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp
|
||||
index baa1b49153..1e9eabbb73 100644
|
||||
--- a/gdb/testsuite/gdb.base/gdbinit-history.exp
|
||||
+++ b/gdb/testsuite/gdb.base/gdbinit-history.exp
|
||||
@@ -181,7 +181,8 @@ proc test_empty_history_filename { } {
|
||||
global env
|
||||
global gdb_prompt
|
||||
|
||||
- set common_history [list "set height 0" "set width 0"]
|
||||
+ set common_history [list "set height 0" "set width 0" \
|
||||
+ "set build-id-verbose 0"]
|
||||
|
||||
set test_dir [standard_output_file history_test]
|
||||
remote_exec host "mkdir -p $test_dir"
|
19
fixup-gdb-6.8-bz442765-threaded-exec-test.patch
Normal file
19
fixup-gdb-6.8-bz442765-threaded-exec-test.patch
Normal file
@ -0,0 +1,19 @@
|
||||
Fixup gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.threads/threaded-exec.exp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
index 8c43162b36e..23f6339d8ff 100644
|
||||
--- a/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp
|
||||
@@ -37,7 +37,7 @@ gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
gdb_load ${binfile_nothreads}
|
||||
|
||||
-gdb_run_cmd ${binfile_nothreads} ${binfile_threads} 0
|
||||
+gdb_run_cmd [list ${binfile_nothreads} ${binfile_threads} 0]
|
||||
|
||||
gdb_test_multiple {} "Program exited" {
|
||||
-re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
|
26
fixup-gdb-archer-vla-tests.patch
Normal file
26
fixup-gdb-archer-vla-tests.patch
Normal file
@ -0,0 +1,26 @@
|
||||
Fixup gdb-archer-vla-tests.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.pascal/arrays.exp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arrays.exp
|
||||
index 22acdb86d87..6a176732599 100644
|
||||
--- a/gdb/testsuite/gdb.pascal/arrays.exp
|
||||
+++ b/gdb/testsuite/gdb.pascal/arrays.exp
|
||||
@@ -89,11 +89,15 @@ gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char"
|
||||
|
||||
if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
|
||||
setup_xfail "*-*-*"
|
||||
+} else {
|
||||
+ setup_kfail "*-*-*" pascal/26106
|
||||
}
|
||||
gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string"
|
||||
|
||||
if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
|
||||
setup_xfail "*-*-*"
|
||||
+} else {
|
||||
+ setup_kfail "*-*-*" pascal/26855
|
||||
}
|
||||
gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
|
||||
|
29
fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch
Normal file
29
fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch
Normal file
@ -0,0 +1,29 @@
|
||||
Fixup gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
index 4aa710b914..889f8c6f58 100644
|
||||
--- a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
@@ -43,6 +43,10 @@ gdb_test_multiple $test $test {
|
||||
untested "$test (no DWARF)"
|
||||
return 0
|
||||
}
|
||||
+ -re "type = <unknown return type> \\(\\)\r\n$gdb_prompt $" {
|
||||
+ untested "$test (no DWARF)"
|
||||
+ return 0
|
||||
+ }
|
||||
}
|
||||
|
||||
set addr ""
|
||||
@@ -111,5 +115,5 @@ gdb_test_multiple "print strstr" $test {
|
||||
}
|
||||
}
|
||||
|
||||
-gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
|
||||
-gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
|
||||
+gdb_test {print (char *)strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
|
||||
+gdb_test {print (char *)strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
|
28
fixup-gdb-btrobust.patch
Normal file
28
fixup-gdb-btrobust.patch
Normal file
@ -0,0 +1,28 @@
|
||||
diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp
|
||||
index 300a5be840d..68cb7d8d7e7 100644
|
||||
--- a/gdb/testsuite/gdb.python/py-framefilter.exp
|
||||
+++ b/gdb/testsuite/gdb.python/py-framefilter.exp
|
||||
@@ -277,9 +277,20 @@ gdb_test_multiple "bt 1" $test {
|
||||
# Now verify that we can see a quit.
|
||||
gdb_test_no_output "python name_error = KeyboardInterrupt" \
|
||||
"Change ErrorFilter to throw KeyboardInterrupt"
|
||||
-gdb_test "bt 1" "Quit" "bt 1 with KeyboardInterrupt"
|
||||
-
|
||||
-
|
||||
+set re1 [multi_line \
|
||||
+ "Python Exception <class 'KeyboardInterrupt'> whoops: " \
|
||||
+ "\\(More stack frames follow\.\.\.\\)"]
|
||||
+set re2 [multi_line \
|
||||
+ "Python Exception <type 'exceptions.KeyboardInterrupt'> whoops: " \
|
||||
+ "\\(More stack frames follow\.\.\.\\)"]
|
||||
+gdb_test_multiple "bt 1" "" {
|
||||
+ -re -wrap $re1 {
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+ -re -wrap $re2 {
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+}
|
||||
# Test with no debuginfo
|
||||
|
||||
# We cannot use prepare_for_testing as we have to set the safe-patch
|
16
fixup-gdb-bz634108-solib_address.patch
Normal file
16
fixup-gdb-bz634108-solib_address.patch
Normal file
@ -0,0 +1,16 @@
|
||||
Fixup gdb-bz634108-solib_address.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.python/rh634108-solib_address.exp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
index c0451cf09ed..99e6aaba831 100644
|
||||
--- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
@@ -21,4 +21,4 @@ gdb_start
|
||||
# Skip all tests if Python scripting is not enabled.
|
||||
if { [skip_python_tests] } { continue }
|
||||
|
||||
-gdb_test "python print gdb.solib_name(-1)" "None" "gdb.solib_name exists"
|
||||
+gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists"
|
49
fixup-gdb-dts-rhel6-python-compat.patch
Normal file
49
fixup-gdb-dts-rhel6-python-compat.patch
Normal file
@ -0,0 +1,49 @@
|
||||
Fixup gdb-dts-rhel6-python-compat.patch
|
||||
|
||||
---
|
||||
gdb/python/lib/gdb/command/backtrace.py | 12 +++++++++---
|
||||
gdb/testsuite/gdb.base/help.exp | 4 +++-
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py
|
||||
index eeea9093e8..5059b6518a 100644
|
||||
--- a/gdb/python/lib/gdb/command/backtrace.py
|
||||
+++ b/gdb/python/lib/gdb/command/backtrace.py
|
||||
@@ -81,13 +81,19 @@ Use of the 'raw' qualifier avoids any filtering by loadable modules.
|
||||
# FIXME: provide option to start at selected frame
|
||||
# However, should still number as if starting from newest
|
||||
newest_frame = gdb.newest_frame()
|
||||
- iter = itertools.imap (FrameWrapper,
|
||||
- FrameIterator (newest_frame))
|
||||
+ if sys.version_info.major >= 3:
|
||||
+ iter = map (FrameWrapper, FrameIterator (newest_frame))
|
||||
+ else:
|
||||
+ iter = itertools.imap (FrameWrapper,
|
||||
+ FrameIterator (newest_frame))
|
||||
if filter:
|
||||
iter = gdb.backtrace.create_frame_filter (iter)
|
||||
|
||||
# Now wrap in an iterator that numbers the frames.
|
||||
- iter = itertools.izip (itertools.count (0), iter)
|
||||
+ if sys.version_info.major >= 3:
|
||||
+ iter = zip (itertools.count (0), iter)
|
||||
+ else:
|
||||
+ iter = itertools.izip (itertools.count (0), iter)
|
||||
|
||||
# Reverse if the user wanted that.
|
||||
if self.reverse.value:
|
||||
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
|
||||
index 0b6893cf79..af5fb232ce 100644
|
||||
--- a/gdb/testsuite/gdb.base/help.exp
|
||||
+++ b/gdb/testsuite/gdb.base/help.exp
|
||||
@@ -129,7 +129,9 @@ gdb_test "apropos apropos" "apropos -- Search for commands matching a REGEXP.*"
|
||||
|
||||
# Test apropos for commands having aliases.
|
||||
gdb_test "apropos Print backtrace of all stack frames, or innermost COUNT frames\." \
|
||||
- "backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames\."
|
||||
+ [multi_line \
|
||||
+ "backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames\." \
|
||||
+ "new-backtrace -- Print backtrace of all stack frames, or innermost COUNT frames\."]
|
||||
|
||||
# Test help for commands having aliases.
|
||||
gdb_test "help bt" "backtrace, where, bt\[\r\n\]+Print backtrace of all stack frames, or innermost COUNT frames\..*"
|
51
fixup-gdb-gnat-dwarf-crash-3of3.patch
Normal file
51
fixup-gdb-gnat-dwarf-crash-3of3.patch
Normal file
@ -0,0 +1,51 @@
|
||||
Fixup gdb-gnat-dwarf-crash-3of3.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.threads/attach-stopped.exp | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
|
||||
index 7c06d849b14..097e8b2a683 100644
|
||||
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
|
||||
@@ -63,10 +63,10 @@ proc corefunc { threadtype } {
|
||||
set test "$threadtype: set file, before attach1 to stopped process"
|
||||
gdb_test_multiple "file $binfile" "$test" {
|
||||
-re "Load new symbol table from.*y or n. $" {
|
||||
- gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
|
||||
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*" \
|
||||
"$test (re-read)"
|
||||
}
|
||||
- -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
|
||||
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $" {
|
||||
pass "$test"
|
||||
}
|
||||
}
|
||||
@@ -93,15 +93,23 @@ proc corefunc { threadtype } {
|
||||
sleep 2
|
||||
|
||||
if [catch {open /proc/${testpid}/status r} fileid] {
|
||||
- set line2 "NOTFOUND"
|
||||
+ set line "NOTFOUND"
|
||||
} else {
|
||||
- gets $fileid line1;
|
||||
- gets $fileid line2;
|
||||
+ while { 1 } {
|
||||
+ if { [gets $fileid line] < 0 } {
|
||||
+ set line "EOF"
|
||||
+ break
|
||||
+ }
|
||||
+ if {[string match "State:*" $line]} {
|
||||
+ break
|
||||
+ }
|
||||
+ }
|
||||
close $fileid;
|
||||
}
|
||||
|
||||
set test "$threadtype: attach1, exit leaves process stopped"
|
||||
- if {[string match "*(stopped)*" $line2]} {
|
||||
+ verbose -log "line: $line"
|
||||
+ if {[string match "*(stopped)*" $line]} {
|
||||
pass $test
|
||||
} else {
|
||||
fail $test
|
18
fixup-gdb-rhbz1156192-recursive-dlopen-test.patch
Normal file
18
fixup-gdb-rhbz1156192-recursive-dlopen-test.patch
Normal file
@ -0,0 +1,18 @@
|
||||
Fixup gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
index 2c32676e504..6e4d3621a3e 100644
|
||||
--- a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
@@ -101,6 +101,7 @@ proc test_stop_on_solib_events { } {
|
||||
gdb_test_no_output "set stop-on-solib-events 1" "setting stop-on-solib-events"
|
||||
|
||||
gdb_run_cmd
|
||||
+ gdb_test "" "Wait for first prompt"
|
||||
foreach l $solib_event_order {
|
||||
incr pass
|
||||
with_test_prefix "pass #$pass" {
|
19
fixup-gdb-test-ivy-bridge.patch
Normal file
19
fixup-gdb-test-ivy-bridge.patch
Normal file
@ -0,0 +1,19 @@
|
||||
Fix gdb-test-ivy-bridge.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp
|
||||
index d1b1f27db4..ee4b8d4162 100644
|
||||
--- a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp
|
||||
+++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp
|
||||
@@ -20,7 +20,7 @@ if {![istarget "x86_64-*-*"]} then {
|
||||
set testfile amd64-ivy-bridge
|
||||
set test compilation
|
||||
if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m64 -nostdlib"]] {
|
||||
- fail $test
|
||||
+ unsupported $test
|
||||
return -1
|
||||
}
|
||||
pass $test
|
340
fixup-gdb-vla-intel-fortran-vla-strings.patch
Normal file
340
fixup-gdb-vla-intel-fortran-vla-strings.patch
Normal file
@ -0,0 +1,340 @@
|
||||
fixup gdb-vla-intel-fortran-vla-strings.patch
|
||||
|
||||
---
|
||||
gdb/f-typeprint.c | 2 +-
|
||||
gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp | 4 +--
|
||||
gdb/testsuite/gdb.fortran/mixed-lang-stack.exp | 5 +++
|
||||
gdb/testsuite/gdb.fortran/pointer-to-pointer.exp | 6 +++-
|
||||
gdb/testsuite/gdb.fortran/pointers.exp | 42 ++++++++++++------------
|
||||
gdb/testsuite/gdb.fortran/print_type.exp | 18 +++++-----
|
||||
gdb/testsuite/gdb.fortran/vla-strings.exp | 12 +++----
|
||||
gdb/testsuite/gdb.fortran/vla-value.exp | 8 ++---
|
||||
8 files changed, 53 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
|
||||
index 9c746fa91c3..c33bd68fe0f 100644
|
||||
--- a/gdb/f-typeprint.c
|
||||
+++ b/gdb/f-typeprint.c
|
||||
@@ -250,7 +250,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
case TYPE_CODE_REF:
|
||||
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
|
||||
arrayprint_recurse_level, false);
|
||||
- fprintf_filtered (stream, ")");
|
||||
+ fprintf_filtered (stream, " )");
|
||||
break;
|
||||
|
||||
case TYPE_CODE_FUNC:
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
|
||||
index 2f6b17c6dc5..35a4fd78e19 100644
|
||||
--- a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
|
||||
@@ -179,7 +179,7 @@ gdb_test "print foo.three_ptr'length" \
|
||||
" = 3"
|
||||
|
||||
gdb_test "ptype foo.three_ptr" \
|
||||
- " = access array \\(<>\\) of integer"
|
||||
+ " = access array \\(1 \.\. 3\\) of integer"
|
||||
|
||||
# foo.three_ptr_tdef.all
|
||||
|
||||
@@ -289,7 +289,7 @@ gdb_test "print foo.five_ptr'length" \
|
||||
" = 5"
|
||||
|
||||
gdb_test "ptype foo.five_ptr" \
|
||||
- " = access array \\(<>\\) of integer"
|
||||
+ " = access array \\(2 \.\. 6\\) of integer"
|
||||
|
||||
# foo.five_ptr_tdef.all
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
|
||||
index edf2508537d..617c6a36292 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
|
||||
@@ -54,6 +54,7 @@ proc run_tests { lang } {
|
||||
if { $lang == "c" || $lang == "c++" } {
|
||||
gdb_test "set language c" \
|
||||
"Warning: the current language does not match this frame."
|
||||
+ setup_kfail *-*-* bsc#1178580
|
||||
} else {
|
||||
gdb_test_no_output "set language $lang"
|
||||
}
|
||||
@@ -156,6 +157,10 @@ proc run_tests { lang } {
|
||||
"g = ${g_pattern}" \
|
||||
"_e = 6" ]
|
||||
|
||||
+ if { $lang == "c" || $lang == "c++" } {
|
||||
+ setup_kfail *-*-* bsc#1178580
|
||||
+ }
|
||||
+
|
||||
gdb_test "info args" $args_pattern \
|
||||
"info args in frame #7"
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp b/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp
|
||||
index 4c643c29903..c93300746de 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp
|
||||
@@ -43,7 +43,11 @@ set l_buffer_type [multi_line \
|
||||
"Type l_buffer" \
|
||||
" $real4 :: alpha\\(:\\)" \
|
||||
"End Type l_buffer" ]
|
||||
+set l_buffer_type_2 [multi_line \
|
||||
+ "Type l_buffer" \
|
||||
+ " $real4 :: alpha\\(5\\)" \
|
||||
+ "End Type l_buffer" ]
|
||||
|
||||
-gdb_test "ptype buffer" "type = PTR TO -> \\( ${l_buffer_type} \\)"
|
||||
+gdb_test "ptype buffer" "type = PTR TO -> \\( ${l_buffer_type_2} \\)"
|
||||
gdb_test "ptype *buffer" "type = ${l_buffer_type}"
|
||||
gdb_test "ptype buffer%alpha" "type = $real4 \\(5\\)"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/pointers.exp b/gdb/testsuite/gdb.fortran/pointers.exp
|
||||
index 916897005f2..ddcc1036765 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/pointers.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/pointers.exp
|
||||
@@ -35,28 +35,28 @@ set complex [fortran_complex4]
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
|
||||
gdb_continue_to_breakpoint "Before pointer assignment"
|
||||
-gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) 0x0" "print logp, not associated"
|
||||
+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"
|
||||
gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"
|
||||
-gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) 0x0" "print comp, not associated"
|
||||
+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"
|
||||
gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"
|
||||
-gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) 0x0" "print charp, not associated"
|
||||
+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"
|
||||
gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"
|
||||
-gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) 0x0" "print charap, not associated"
|
||||
+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"
|
||||
gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"
|
||||
-gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" "print intp, not associated"
|
||||
+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"
|
||||
gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"
|
||||
set test "print intap, not associated"
|
||||
gdb_test_multiple "print intap" $test {
|
||||
- -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not associated>\r\n$gdb_prompt $" {
|
||||
+ -re " = \\(PTR TO -> \\( $int \\(:,:\\) \\)\\) <not associated>\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
-re " = <not associated>\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
-gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) 0x0" "print realp, not associated"
|
||||
+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
|
||||
gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
|
||||
-gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0"
|
||||
+gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
|
||||
set test "print cyclicp1, not associated"
|
||||
gdb_test_multiple "print cyclicp1" $test {
|
||||
-re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
|
||||
@@ -68,10 +68,10 @@ gdb_test_multiple "print cyclicp1" $test {
|
||||
}
|
||||
set test "print cyclicp1%p, not associated"
|
||||
gdb_test_multiple "print cyclicp1%p" $test {
|
||||
- -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) 0x0\r\n$gdb_prompt $" {
|
||||
+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
- -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) <not associated>\r\n$gdb_prompt $" {
|
||||
+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
@@ -84,15 +84,15 @@ gdb_test "print *(twop)%ivla2" "= <not allocated>"
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "After value assignment"]
|
||||
gdb_continue_to_breakpoint "After value assignment"
|
||||
-gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *logp" "= \\.TRUE\\."
|
||||
-gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *comp" "= \\(1,2\\)"
|
||||
-gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *charp" "= 'a'"
|
||||
-gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *charap" "= 'abc'"
|
||||
-gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *intp" "= 10"
|
||||
set test_name "print intap, associated"
|
||||
gdb_test_multiple "print intap" $test_name {
|
||||
@@ -114,16 +114,16 @@ gdb_test_multiple "print intvlap" $test_name {
|
||||
pass $test_name
|
||||
}
|
||||
}
|
||||
-gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *realp" "= 3\\.14000\\d+"
|
||||
-gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"
|
||||
set test_name "print arrayOfPtr(3)%p"
|
||||
gdb_test_multiple $test_name $test_name {
|
||||
- -re "= \\(PTR TO -> \\( Type two\\)\\) <not associated>\r\n$gdb_prompt $" {
|
||||
+ -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {
|
||||
pass $test_name
|
||||
}
|
||||
- -re "= \\(PTR TO -> \\( Type two\\)\\) 0x0\r\n$gdb_prompt $" {
|
||||
+ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {
|
||||
pass $test_name
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name {
|
||||
}
|
||||
}
|
||||
gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
|
||||
-gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer\\)\\) $hex\( <.*>\)?"
|
||||
+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
|
||||
gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
|
||||
gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
|
||||
-gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\) \\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
|
||||
+gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\) \\(\\) \\)\\) $hex <pointers\\+\\d+>" "Print program counter"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp
|
||||
index 5a4aa35d7cb..529a78e5b89 100755
|
||||
--- a/gdb/testsuite/gdb.fortran/print_type.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/print_type.exp
|
||||
@@ -43,7 +43,7 @@ set complex [fortran_complex4]
|
||||
# matches the string TYPE.
|
||||
proc check_pointer_type { var_name type } {
|
||||
gdb_test "ptype ${var_name}" \
|
||||
- "type = PTR TO -> \\( ${type}\\)"
|
||||
+ "type = PTR TO -> \\( ${type} \\)"
|
||||
}
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
|
||||
@@ -88,7 +88,7 @@ gdb_test "ptype twop" \
|
||||
[multi_line "type = PTR TO -> \\( Type two" \
|
||||
" $int, allocatable :: ivla1\\(:\\)" \
|
||||
" $int, allocatable :: ivla2\\(:,:\\)" \
|
||||
- "End Type two\\)"]
|
||||
+ "End Type two \\)"]
|
||||
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "After value assignment"]
|
||||
@@ -101,18 +101,18 @@ gdb_test "ptype intv" "type = $int"
|
||||
gdb_test "ptype inta" "type = $int \\(10,2\\)"
|
||||
gdb_test "ptype realv" "type = $real"
|
||||
|
||||
-gdb_test "ptype logp" "type = PTR TO -> \\( $logical\\)"
|
||||
-gdb_test "ptype comp" "type = PTR TO -> \\( $complex\\)"
|
||||
-gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1\\)"
|
||||
-gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3\\)"
|
||||
-gdb_test "ptype intp" "type = PTR TO -> \\( $int\\)"
|
||||
+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)"
|
||||
+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)"
|
||||
+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)"
|
||||
+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)"
|
||||
+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)"
|
||||
set test "ptype intap"
|
||||
gdb_test_multiple $test $test {
|
||||
-re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
- -re "type = PTR TO -> \\( $int \\(10,2\\)\\)\r\n$gdb_prompt $" {
|
||||
+ -re "type = PTR TO -> \\( $int \\(10,2\\) \\)\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
-gdb_test "ptype realp" "type = PTR TO -> \\( $real\\)"
|
||||
+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp
|
||||
index 5d0662823a0..484fdcb652a 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-strings.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-strings.exp
|
||||
@@ -32,7 +32,7 @@ gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
|
||||
gdb_continue_to_breakpoint "var_char-allocated-1"
|
||||
set test "whatis var_char first time"
|
||||
gdb_test_multiple "whatis var_char" $test {
|
||||
- -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" {
|
||||
+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
-re "type = character\\*10\r\n$gdb_prompt $" {
|
||||
@@ -41,7 +41,7 @@ gdb_test_multiple "whatis var_char" $test {
|
||||
}
|
||||
set test "ptype var_char first time"
|
||||
gdb_test_multiple "ptype var_char" $test {
|
||||
- -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" {
|
||||
+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
-re "type = character\\*10\r\n$gdb_prompt $" {
|
||||
@@ -59,7 +59,7 @@ gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
|
||||
gdb_continue_to_breakpoint "var_char-filled-1"
|
||||
set test "print var_char, var_char-filled-1"
|
||||
gdb_test_multiple "print var_char" $test {
|
||||
- -re "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\r\n$gdb_prompt $" {
|
||||
+ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {
|
||||
gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"
|
||||
pass $test
|
||||
}
|
||||
@@ -69,7 +69,7 @@ gdb_test_multiple "print var_char" $test {
|
||||
}
|
||||
set test "ptype var_char, var_char-filled-1"
|
||||
gdb_test_multiple "ptype var_char" $test {
|
||||
- -re "type = PTR TO -> \\( character\\*3\\)\r\n$gdb_prompt $" {
|
||||
+ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
-re "type = character\\*3\r\n$gdb_prompt $" {
|
||||
@@ -84,7 +84,7 @@ gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
|
||||
gdb_continue_to_breakpoint "var_char-filled-2"
|
||||
set test "print var_char, var_char-filled-2"
|
||||
gdb_test_multiple "print var_char" $test {
|
||||
- -re "= \\(PTR TO -> \\( character\\*6\\)\\) $hex\r\n$gdb_prompt $" {
|
||||
+ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {
|
||||
gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"
|
||||
pass $test
|
||||
}
|
||||
@@ -94,7 +94,7 @@ gdb_test_multiple "print var_char" $test {
|
||||
}
|
||||
set test "ptype var_char, var_char-filled-2"
|
||||
gdb_test_multiple "ptype var_char" $test {
|
||||
- -re "type = PTR TO -> \\( character\\*6\\)\r\n$gdb_prompt $" {
|
||||
+ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
-re "type = character\\*6\r\n$gdb_prompt $" {
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
|
||||
index 49f22e7904e..be0a2d47fdf 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-value.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-value.exp
|
||||
@@ -37,7 +37,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"]
|
||||
gdb_continue_to_breakpoint "vla1-init"
|
||||
gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"
|
||||
gdb_test "print &vla1" \
|
||||
- " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\)\\\)\\\) $hex" \
|
||||
+ " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\) \\\)\\\) $hex" \
|
||||
"print non-allocated &vla1"
|
||||
gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \
|
||||
"print member in non-allocated vla1 (1)"
|
||||
@@ -58,7 +58,7 @@ with_timeout_factor 15 {
|
||||
"step over value assignment of vla1"
|
||||
}
|
||||
gdb_test "print &vla1" \
|
||||
- " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\)\\\)\\\) $hex" \
|
||||
+ " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\) \\\)\\\) $hex" \
|
||||
"print allocated &vla1"
|
||||
gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)"
|
||||
gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)"
|
||||
@@ -78,7 +78,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \
|
||||
# Try to access values in undefined pointer to VLA (dangling)
|
||||
gdb_test "print pvla" " = <not associated>" "print undefined pvla"
|
||||
gdb_test "print &pvla" \
|
||||
- " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
|
||||
+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\) \\\)\\\) $hex" \
|
||||
"print non-associated &pvla"
|
||||
gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
|
||||
"print undefined pvla(1,3,8)"
|
||||
@@ -87,7 +87,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated
|
||||
gdb_breakpoint [gdb_get_line_number "pvla-associated"]
|
||||
gdb_continue_to_breakpoint "pvla-associated"
|
||||
gdb_test "print &pvla" \
|
||||
- " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \
|
||||
+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\) \\\)\\\) $hex" \
|
||||
"print associated &pvla"
|
||||
gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)"
|
||||
gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)"
|
157
fixup-gdb-vla-intel-tests.patch
Normal file
157
fixup-gdb-vla-intel-tests.patch
Normal file
@ -0,0 +1,157 @@
|
||||
Fixup gdb-vla-intel-tests.patch
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.fortran/ptr-indentation.exp | 2 +-
|
||||
gdb/testsuite/gdb.fortran/ptype-on-functions.exp | 2 +-
|
||||
gdb/testsuite/gdb.fortran/vla-ptr-info.exp | 2 +-
|
||||
gdb/testsuite/gdb.fortran/vla-stringsold.exp | 36 ++++++++++++------------
|
||||
gdb/testsuite/gdb.fortran/whatis_type.exp | 4 +--
|
||||
5 files changed, 23 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
|
||||
index 5e459fdb62e..209809a2922 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
|
||||
@@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1"
|
||||
gdb_test "ptype tinsta" \
|
||||
[multi_line "type = Type tuserdef" \
|
||||
" $int :: i" \
|
||||
- " PTR TO -> \\( $real :: ptr\\)" \
|
||||
+ " PTR TO -> \\( $real :: ptr \\)" \
|
||||
"End Type tuserdef"]
|
||||
diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
|
||||
index 761432ea82e..93e984af243 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
|
||||
@@ -42,7 +42,7 @@ gdb_test "ptype say_numbers" \
|
||||
"type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)"
|
||||
|
||||
gdb_test "ptype fun_ptr" \
|
||||
- "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)"
|
||||
+ "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)"
|
||||
|
||||
gdb_test "ptype say_string" \
|
||||
"type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
|
||||
index ca8541bf92f..7ead9191b93 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
|
||||
@@ -33,5 +33,5 @@ set real4 [fortran_real4]
|
||||
# Check the status of a pointer to a dynamic array.
|
||||
gdb_breakpoint [gdb_get_line_number "pvla-associated"]
|
||||
gdb_continue_to_breakpoint "pvla-associated"
|
||||
-gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\)\\)\\) ${hex}" \
|
||||
+gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\) \\)\\) ${hex}" \
|
||||
"print pvla pointer information"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
|
||||
index 7d7876d71ab..c1bf7ef763a 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-stringsold.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
|
||||
@@ -31,11 +31,11 @@ if ![runto MAIN__] then {
|
||||
gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
|
||||
gdb_continue_to_breakpoint "var_char-allocated-1"
|
||||
gdb_test "print var_char" \
|
||||
- " = \\(PTR TO -> \\( character\\*10\\)\\) ${hex}" \
|
||||
+ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \
|
||||
"print var_char after allocated first time"
|
||||
-gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10\\)" \
|
||||
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \
|
||||
"whatis var_char first time"
|
||||
-gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10\\)" \
|
||||
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \
|
||||
"ptype var_char first time"
|
||||
gdb_test "next" "\\d+.*var_char = 'foo'.*" \
|
||||
"next to allocation status of var_char"
|
||||
@@ -44,13 +44,13 @@ gdb_test "print l" " = .TRUE." "print allocation status first time"
|
||||
gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
|
||||
gdb_continue_to_breakpoint "var_char-filled-1"
|
||||
gdb_test "print var_char" \
|
||||
- " = \\(PTR TO -> \\( character\\*3\\)\\) ${hex}" \
|
||||
+ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \
|
||||
"print var_char after filled first time"
|
||||
gdb_test "print *var_char" " = 'foo'" \
|
||||
"print *var_char after filled first time"
|
||||
-gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3\\)" \
|
||||
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \
|
||||
"whatis var_char after filled first time"
|
||||
-gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3\\)" \
|
||||
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \
|
||||
"ptype var_char after filled first time"
|
||||
gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
|
||||
gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
|
||||
@@ -58,44 +58,44 @@ gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
|
||||
gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
|
||||
gdb_continue_to_breakpoint "var_char-filled-2"
|
||||
gdb_test "print var_char" \
|
||||
- " = \\(PTR TO -> \\( character\\*6\\)\\) ${hex}" \
|
||||
+ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \
|
||||
"print var_char after allocated second time"
|
||||
gdb_test "print *var_char" " = 'foobar'" \
|
||||
"print *var_char after allocated second time"
|
||||
-gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6\\)" \
|
||||
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \
|
||||
"whatis var_char second time"
|
||||
-gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6\\)" \
|
||||
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \
|
||||
"ptype var_char second time"
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "var_char-empty"]
|
||||
gdb_continue_to_breakpoint "var_char-empty"
|
||||
gdb_test "print var_char" \
|
||||
- " = \\(PTR TO -> \\( character\\*0\\)\\) ${hex}" \
|
||||
+ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \
|
||||
"print var_char after set empty"
|
||||
gdb_test "print *var_char" " = \"\"" "print *var_char after set empty"
|
||||
-gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0\\)" \
|
||||
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \
|
||||
"whatis var_char after set empty"
|
||||
-gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0\\)" \
|
||||
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \
|
||||
"ptype var_char after set empty"
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"]
|
||||
gdb_continue_to_breakpoint "var_char-allocated-3"
|
||||
gdb_test "print var_char" \
|
||||
- " = \\(PTR TO -> \\( character\\*21\\)\\) ${hex}" \
|
||||
+ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \
|
||||
"print var_char after allocated third time"
|
||||
-gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21\\)" \
|
||||
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \
|
||||
"whatis var_char after allocated third time"
|
||||
-gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21\\)" \
|
||||
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \
|
||||
"ptype var_char after allocated third time"
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "var_char_p-associated"]
|
||||
gdb_continue_to_breakpoint "var_char_p-associated"
|
||||
gdb_test "print var_char_p" \
|
||||
- " = \\(PTR TO -> \\( character\\*7\\)\\) ${hex}" \
|
||||
+ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \
|
||||
"print var_char_p after associated"
|
||||
gdb_test "print *var_char_p" " = 'johndoe'" \
|
||||
"print *var_char_ after associated"
|
||||
-gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7\\)" \
|
||||
+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
|
||||
"whatis var_char_p after associated"
|
||||
-gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7\\)" \
|
||||
+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
|
||||
"ptype var_char_p after associated"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
|
||||
index e2a56a63410..4b0cbf9c28d 100644
|
||||
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
|
||||
@@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2"
|
||||
gdb_test "whatis t2v" "type = Type t2"
|
||||
gdb_test "whatis t3" "type = Type t3"
|
||||
gdb_test "whatis t3v" "type = Type t3"
|
||||
-gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)"
|
||||
+gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)"
|
||||
|
||||
gdb_test "ptype t1" \
|
||||
[multi_line "type = Type t1" \
|
||||
@@ -73,4 +73,4 @@ gdb_test "ptype t3p" \
|
||||
[multi_line "type = PTR TO -> \\( Type t3" \
|
||||
" $int :: t3_i" \
|
||||
" Type t2 :: t2_n" \
|
||||
- "End Type t3\\)"]
|
||||
+ "End Type t3 \\)"]
|
3
gdb-10.1.tar.bz2
Normal file
3
gdb-10.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:707fcf55bb2ce2bb4afdfa3ec922063d7bf9fed5e91943be6f36e7cad8e98a88
|
||||
size 31081288
|
@ -1,115 +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.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
|
||||
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 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 2 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, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ pause ();
|
||||
+ return 1;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
|
||||
@@ -0,0 +1,72 @@
|
||||
+# Copyright 2007
|
||||
+
|
||||
+# 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 2 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, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
|
||||
+
|
||||
+# This test only works on Linux
|
||||
+if { ![istarget "*-*-linux-gnu*"] } {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "attach-see-vdso"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]]
|
||||
+
|
||||
+# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
|
||||
+#
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+set testpid [eval exec $binfile &]
|
||||
+
|
||||
+# Avoid some race:
|
||||
+sleep 2
|
||||
+
|
||||
+# Start with clean gdb
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+# Never call: gdb_load ${binfile}
|
||||
+# as the former problem would not reproduce otherwise.
|
||||
+
|
||||
+set test "attach"
|
||||
+gdb_test_multiple "attach $testpid" "$test" {
|
||||
+ -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
|
||||
+
|
||||
+# Exit and detach the process.
|
||||
+
|
||||
+gdb_exit
|
||||
+
|
||||
+# Make sure we don't leave a process around to confuse
|
||||
+# the next test run (and prevent the compile by keeping
|
||||
+# the text file busy), in case the "set should_exit" didn't
|
||||
+# work.
|
||||
+
|
||||
+remote_exec build "kill -9 ${testpid}"
|
@ -16,7 +16,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
|
||||
@@ -1768,7 +1768,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
|
||||
@@ -1726,7 +1726,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
|
||||
install: all
|
||||
@$(MAKE) $(FLAGS_TO_PASS) install-only
|
||||
|
||||
@ -25,7 +25,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 \
|
||||
@@ -1817,7 +1817,25 @@ install-guile:
|
||||
@@ -1775,7 +1775,25 @@ install-guile:
|
||||
install-python:
|
||||
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
|
||||
|
||||
@ -52,7 +52,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 \
|
||||
@@ -1840,6 +1858,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
@@ -1798,6 +1816,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
fi
|
||||
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
||||
|
||||
|
@ -1,323 +0,0 @@
|
||||
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
|
||||
mode on 64-bit systems.
|
||||
* gdb.base/attach-32.c: Ditto.
|
||||
* gdb.base/attach-32b.c: Ditto.
|
||||
|
||||
2007-12-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32.c b/gdb/testsuite/gdb.base/attach-32.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+/* This program is intended to be started outside of gdb, and then
|
||||
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
||||
+ is exited when & if the variable 'should_exit' is non-zero. (It
|
||||
+ is initialized to zero in this program, so the loop will never
|
||||
+ exit unless/until gdb sets the variable to non-zero.)
|
||||
+ */
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+int should_exit = 0;
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ int local_i = 0;
|
||||
+
|
||||
+ while (! should_exit)
|
||||
+ {
|
||||
+ local_i++;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attach-32.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32.exp
|
||||
@@ -0,0 +1,245 @@
|
||||
+# Copyright 2005 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 2 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, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+#
|
||||
+# This test was based on attach.exp and modified for 32/64 bit Linux systems. */
|
||||
+
|
||||
+# On HP-UX 11.0, this test is causing a process running the program
|
||||
+# "attach" to be left around spinning. Until we figure out why, I am
|
||||
+# commenting out the test to avoid polluting tiamat (our 11.0 nightly
|
||||
+# test machine) with these processes. RT
|
||||
+#
|
||||
+# Setting the magic bit in the target app should work. I added a
|
||||
+# "kill", and also a test for the R3 register warning. JB
|
||||
+if { ![istarget "x86_64*-*linux*"]
|
||||
+ && ![istarget "powerpc64*-*linux*"]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# are we on a target board
|
||||
+if [is_remote target] then {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "attach-32"
|
||||
+set srcfile ${testfile}.c
|
||||
+set srcfile2 ${testfile}b.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set binfile2 [standard_output_file ${testfile}b]
|
||||
+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]]
|
||||
+
|
||||
+#execute_anywhere "rm -f ${binfile} ${binfile2}"
|
||||
+remote_exec build "rm -f ${binfile} ${binfile2}"
|
||||
+# For debugging this test
|
||||
+#
|
||||
+#log_user 1
|
||||
+
|
||||
+# build the first test case
|
||||
+#
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-m32"]] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+# Build the in-system-call test
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable [list debug "additional_flags=-m32"]] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+proc do_attach_tests {} {
|
||||
+ global gdb_prompt
|
||||
+ global binfile
|
||||
+ global escapedbinfile
|
||||
+ global srcfile
|
||||
+ global testfile
|
||||
+ global objdir
|
||||
+ global subdir
|
||||
+ global timeout
|
||||
+ global testpid
|
||||
+
|
||||
+ # Verify that we can "see" the variable "should_exit" in the
|
||||
+ # program, and that it is zero.
|
||||
+
|
||||
+ gdb_test "print should_exit" " = 0" "after attach-32, print should_exit"
|
||||
+
|
||||
+ # Verify that we can modify the variable "should_exit" in the
|
||||
+ # program.
|
||||
+
|
||||
+ gdb_test "set should_exit=1" "" "after attach-32, set should_exit"
|
||||
+
|
||||
+ # Verify that the modification really happened.
|
||||
+
|
||||
+ send_gdb "tbreak 19\n"
|
||||
+ gdb_expect {
|
||||
+ -re "reakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" {
|
||||
+ pass "after attach-32, set tbreak postloop"
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ fail "after attach-32, set tbreak postloop"
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "(timeout) after attach-32, set tbreak postloop"
|
||||
+ }
|
||||
+ }
|
||||
+ send_gdb "continue\n"
|
||||
+ gdb_expect {
|
||||
+ -re "main.*at.*$srcfile:19.*$gdb_prompt $" {
|
||||
+ pass "after attach-32, reach tbreak postloop"
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ fail "after attach-32, reach tbreak postloop"
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "(timeout) after attach-32, reach tbreak postloop"
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ # Allow the test process to exit, to cleanup after ourselves.
|
||||
+
|
||||
+ gdb_test "continue" {\[Inferior .* exited normally\]} "after attach-32, exit"
|
||||
+
|
||||
+ # Make sure we don't leave a process around to confuse
|
||||
+ # the next test run (and prevent the compile by keeping
|
||||
+ # the text file busy), in case the "set should_exit" didn't
|
||||
+ # work.
|
||||
+
|
||||
+ remote_exec build "kill -9 ${testpid}"
|
||||
+
|
||||
+ # Start the program running and then wait for a bit, to be sure
|
||||
+ # that it can be attached to.
|
||||
+
|
||||
+ set testpid [eval exec $binfile &]
|
||||
+ exec sleep 2
|
||||
+ if { [istarget "*-*-cygwin*"] } {
|
||||
+ # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
|
||||
+ # different due to the way fork/exec works.
|
||||
+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
+ }
|
||||
+
|
||||
+ # Verify that we can attach to the process, and find its a.out
|
||||
+ # when we're cd'd to some directory that doesn't contain the
|
||||
+ # a.out. (We use the source path set by the "dir" command.)
|
||||
+
|
||||
+ gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \
|
||||
+ "set source path"
|
||||
+
|
||||
+ gdb_test "cd /tmp" "Working directory /tmp." \
|
||||
+ "cd away from process working directory"
|
||||
+
|
||||
+ # Explicitly flush out any knowledge of the previous attachment.
|
||||
+
|
||||
+ set test "before attach-32-3, flush symbols"
|
||||
+ gdb_test_multiple "symbol" "$test" {
|
||||
+ -re "Discard symbol table from.*y or n. $" {
|
||||
+ gdb_test "y" "No symbol file now." \
|
||||
+ "$test"
|
||||
+ }
|
||||
+ -re "No symbol file now.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ gdb_test "exec" "No executable file now." \
|
||||
+ "before attach-32-3, flush exec"
|
||||
+
|
||||
+ gdb_test "attach $testpid" \
|
||||
+ "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*" \
|
||||
+ "attach-32 when process' a.out not in cwd"
|
||||
+
|
||||
+ set test "after attach-32-3, exit"
|
||||
+ gdb_test_multiple "kill" "$test" {
|
||||
+ -re "Kill the program being debugged.*y or n. $" {
|
||||
+ gdb_test "y" "" "$test"
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ # Another "don't leave a process around"
|
||||
+ remote_exec build "kill -9 ${testpid}"
|
||||
+}
|
||||
+
|
||||
+proc do_call_attach_tests {} {
|
||||
+ global gdb_prompt
|
||||
+ global binfile2
|
||||
+ global testpid
|
||||
+
|
||||
+ # See if other registers are problems
|
||||
+
|
||||
+ set test "info other register"
|
||||
+ gdb_test_multiple "i r r3" "$test" {
|
||||
+ -re "warning: reading register.*$gdb_prompt $" {
|
||||
+ fail "$test"
|
||||
+ }
|
||||
+ -re "r3.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ # Get rid of the process
|
||||
+
|
||||
+ gdb_test "p should_exit = 1"
|
||||
+ gdb_test "c" {\[Inferior .* exited normally\]}
|
||||
+
|
||||
+ # Be paranoid
|
||||
+
|
||||
+ remote_exec build "kill -9 ${testpid}"
|
||||
+}
|
||||
+
|
||||
+
|
||||
+# Start with a fresh gdb
|
||||
+
|
||||
+gdb_exit
|
||||
+set testpid [eval exec $binfile &]
|
||||
+exec sleep 3
|
||||
+if { [istarget "*-*-cygwin*"] } {
|
||||
+ # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
|
||||
+ # different due to the way fork/exec works.
|
||||
+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
+}
|
||||
+
|
||||
+set GDBFLAGS_orig $GDBFLAGS
|
||||
+set GDBFLAGS "--pid=$testpid"
|
||||
+gdb_start
|
||||
+set GDBFLAGS $GDBFLAGS_orig
|
||||
+
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+# This is a test of gdb's ability to attach to a running process.
|
||||
+
|
||||
+do_attach_tests
|
||||
+
|
||||
+# Test attaching when the target is inside a system call
|
||||
+
|
||||
+gdb_exit
|
||||
+set testpid [eval exec $binfile2 &]
|
||||
+exec sleep 3
|
||||
+if { [istarget "*-*-cygwin*"] } {
|
||||
+ # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
|
||||
+ # different due to the way fork/exec works.
|
||||
+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
+}
|
||||
+
|
||||
+set GDBFLAGS_orig $GDBFLAGS
|
||||
+set GDBFLAGS "--pid=$testpid"
|
||||
+gdb_start
|
||||
+set GDBFLAGS $GDBFLAGS_orig
|
||||
+
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+do_call_attach_tests
|
||||
+
|
||||
+return 0
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32b.c b/gdb/testsuite/gdb.base/attach-32b.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32b.c
|
||||
@@ -0,0 +1,24 @@
|
||||
+/* This program is intended to be started outside of gdb, and then
|
||||
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
||||
+ is exited when & if the variable 'should_exit' is non-zero. (It
|
||||
+ is initialized to zero in this program, so the loop will never
|
||||
+ exit unless/until gdb sets the variable to non-zero.)
|
||||
+ */
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int should_exit = 0;
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ int local_i = 0;
|
||||
+
|
||||
+ sleep( 10 ); /* System call causes register fetch to fail */
|
||||
+ /* This is a known HPUX "feature" */
|
||||
+ while (! should_exit)
|
||||
+ {
|
||||
+ local_i++;
|
||||
+ }
|
||||
+ return (0);
|
||||
+}
|
@ -17,7 +17,7 @@ Subject: gdb-6.3-test-self-20050110.patch
|
||||
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
|
||||
--- a/gdb/testsuite/lib/selftest-support.exp
|
||||
+++ b/gdb/testsuite/lib/selftest-support.exp
|
||||
@@ -151,18 +151,18 @@ proc do_self_tests {function body} {
|
||||
@@ -152,18 +152,18 @@ proc do_self_tests {function body} {
|
||||
}
|
||||
|
||||
# Remove any old copy lying around.
|
||||
|
@ -1,938 +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-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
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.c
|
||||
@@ -0,0 +1,301 @@
|
||||
+/*
|
||||
+ * The point of this program is to crash in a multi-threaded app.
|
||||
+ * There are seven threads, doing the following things:
|
||||
+ * * Spinning
|
||||
+ * * Spinning inside a signal handler
|
||||
+ * * Spinning inside a signal handler executing on the altstack
|
||||
+ * * In a syscall
|
||||
+ * * In a syscall inside a signal handler
|
||||
+ * * In a syscall inside a signal handler executing on the altstack
|
||||
+ * * Finally, the main thread crashes in main, with no frills.
|
||||
+ *
|
||||
+ * These are the things threads in JRockit tend to be doing. If gdb
|
||||
+ * can handle those things, both in core files and during live
|
||||
+ * debugging, that will help (at least) JRockit development.
|
||||
+ *
|
||||
+ * Let the program create a core file, then load the core file into
|
||||
+ * gdb. Inside gdb, you should be able to do something like this:
|
||||
+ *
|
||||
+ * (gdb) t a a bt
|
||||
+ *
|
||||
+ * Thread 7 (process 4352):
|
||||
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
|
||||
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
|
||||
+ * #2 0x080488a2 in makeSyscall (ignored=0x0) at threadcrash.c:118
|
||||
+ * #3 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #4 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 6 (process 4353):
|
||||
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
|
||||
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
|
||||
+ * #2 0x0804898f in syscallingSighandler (signo=10, info=0xb6be76f0, context=0xb6be7770)
|
||||
+ * at threadcrash.c:168
|
||||
+ * #3 <signal handler called>
|
||||
+ * #4 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x08048a51 in makeSyscallFromSighandler (ignored=0x0) at threadcrash.c:204
|
||||
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 5 (process 4354):
|
||||
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
|
||||
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
|
||||
+ * #2 0x08048936 in syscallingAltSighandler (signo=3, info=0x959cd70, context=0x959cdf0)
|
||||
+ * at threadcrash.c:144
|
||||
+ * #3 <signal handler called>
|
||||
+ * #4 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x080489e2 in makeSyscallFromAltSighandler (ignored=0x0) at threadcrash.c:190
|
||||
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 4 (process 4355):
|
||||
+ * #0 spin (ignored=0x0) at threadcrash.c:242
|
||||
+ * #1 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #2 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 3 (process 4356):
|
||||
+ * #0 spinningSighandler (signo=12, info=0xb4de46f0, context=0xb4de4770) at threadcrash.c:180
|
||||
+ * #1 <signal handler called>
|
||||
+ * #2 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #3 0x08048b2f in spinFromSighandler (ignored=0x0) at threadcrash.c:232
|
||||
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 2 (process 4357):
|
||||
+ * #0 spinningAltSighandler (signo=14, info=0x959ee50, context=0x959eed0) at threadcrash.c:156
|
||||
+ * #1 <signal handler called>
|
||||
+ * #2 0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
|
||||
+ * #3 0x08048ac0 in spinFromAltSighandler (ignored=0x0) at threadcrash.c:218
|
||||
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
|
||||
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
|
||||
+ *
|
||||
+ * Thread 1 (process 4351):
|
||||
+ * #0 0x08048cf3 in main (argc=1, argv=0xbfff9d74) at threadcrash.c:273
|
||||
+ * (gdb)
|
||||
+ */
|
||||
+
|
||||
+#include <pthread.h>
|
||||
+#include <signal.h>
|
||||
+#include <assert.h>
|
||||
+#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#define SIGSYSCALL_ALT SIGQUIT
|
||||
+#define SIGSYSCALL SIGUSR1
|
||||
+#define SIGSPIN_ALT SIGALRM
|
||||
+#define SIGSPIN SIGUSR2
|
||||
+
|
||||
+typedef void (*sigaction_t)(int, siginfo_t *, void *);
|
||||
+
|
||||
+static void installHandler(int signo, sigaction_t handler, int onAltstack) {
|
||||
+ struct sigaction action;
|
||||
+ sigset_t sigset;
|
||||
+ int result;
|
||||
+ stack_t altstack;
|
||||
+ stack_t oldaltstack;
|
||||
+
|
||||
+ memset(&action, 0, sizeof(action));
|
||||
+ memset(&altstack, 0, sizeof(altstack));
|
||||
+ memset(&oldaltstack, 0, sizeof(oldaltstack));
|
||||
+
|
||||
+ if (onAltstack) {
|
||||
+ altstack.ss_sp = malloc(SIGSTKSZ);
|
||||
+ assert(altstack.ss_sp != NULL);
|
||||
+ altstack.ss_size = SIGSTKSZ;
|
||||
+ altstack.ss_flags = 0;
|
||||
+ result = sigaltstack(&altstack, &oldaltstack);
|
||||
+ assert(result == 0);
|
||||
+ assert(oldaltstack.ss_flags == SS_DISABLE);
|
||||
+ }
|
||||
+
|
||||
+ sigemptyset(&sigset);
|
||||
+
|
||||
+ action.sa_handler = NULL;
|
||||
+ action.sa_sigaction = handler;
|
||||
+ action.sa_mask = sigset;
|
||||
+ action.sa_flags = SA_SIGINFO;
|
||||
+ if (onAltstack) {
|
||||
+ action.sa_flags |= SA_ONSTACK;
|
||||
+ }
|
||||
+
|
||||
+ result = sigaction(signo, &action, NULL);
|
||||
+ assert(result == 0);
|
||||
+}
|
||||
+
|
||||
+static void installNormalHandler(int signo, sigaction_t handler) {
|
||||
+ installHandler(signo, handler, 0);
|
||||
+}
|
||||
+
|
||||
+static void installAlthandler(int signo, sigaction_t handler) {
|
||||
+ installHandler(signo, handler, 1);
|
||||
+}
|
||||
+
|
||||
+static void *makeSyscall(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ sleep(42);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Return true if we're currently executing on the altstack */
|
||||
+static int onAltstack(void) {
|
||||
+ stack_t stack;
|
||||
+ int result;
|
||||
+
|
||||
+ result = sigaltstack(NULL, &stack);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ return stack.ss_flags & SS_ONSTACK;
|
||||
+}
|
||||
+
|
||||
+static void syscallingAltSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (!onAltstack()) {
|
||||
+ printf("%s() not running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ sleep(42);
|
||||
+}
|
||||
+
|
||||
+static void spinningAltSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (!onAltstack()) {
|
||||
+ printf("%s() not running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ while (1);
|
||||
+}
|
||||
+
|
||||
+static void syscallingSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (onAltstack()) {
|
||||
+ printf("%s() running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ sleep(42);
|
||||
+}
|
||||
+
|
||||
+static void spinningSighandler(int signo, siginfo_t *info, void *context) {
|
||||
+ (void)signo;
|
||||
+ (void)info;
|
||||
+ (void)context;
|
||||
+
|
||||
+ if (onAltstack()) {
|
||||
+ printf("%s() running on altstack!\n", __FUNCTION__);
|
||||
+ }
|
||||
+
|
||||
+ while (1);
|
||||
+}
|
||||
+
|
||||
+static void *makeSyscallFromAltSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installAlthandler(SIGSYSCALL_ALT, syscallingAltSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSYSCALL_ALT);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *makeSyscallFromSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installNormalHandler(SIGSYSCALL, syscallingSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSYSCALL);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *spinFromAltSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installAlthandler(SIGSPIN_ALT, spinningAltSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSPIN_ALT);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *spinFromSighandler(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ int result;
|
||||
+
|
||||
+ installNormalHandler(SIGSPIN, spinningSighandler);
|
||||
+
|
||||
+ result = pthread_kill(pthread_self(), SIGSPIN);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void *spin(void *ignored) {
|
||||
+ (void)ignored;
|
||||
+
|
||||
+ while (1);
|
||||
+
|
||||
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+int main(int argc, char *argv[]) {
|
||||
+ int result;
|
||||
+ pthread_t thread;
|
||||
+ volatile int bad;
|
||||
+
|
||||
+ result = pthread_create(&thread, NULL, makeSyscall, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, makeSyscallFromSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, makeSyscallFromAltSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, spin, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, spinFromSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+ result = pthread_create(&thread, NULL, spinFromAltSighandler, NULL);
|
||||
+ assert(result == 0);
|
||||
+
|
||||
+ // Give threads some time to get going
|
||||
+ sleep(3);
|
||||
+
|
||||
+ // Crash
|
||||
+ bad = *(int*)7;
|
||||
+
|
||||
+ /* Workaround: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29628
|
||||
+ Simulate use to ensure `DW_AT_location' for them:
|
||||
+ readelf -a --debug threadcrash|grep -A5 -w argc
|
||||
+ --> DW_AT_location : 2 byte block: 71 0 (DW_OP_breg1: 0)
|
||||
+ This case verified on: gcc-4.1.1-30.i386
|
||||
+ Keep it late to ensure persistency in the registers. */
|
||||
+ bad = (int) argc;
|
||||
+ bad = (unsigned long) argv;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
|
||||
@@ -0,0 +1,37 @@
|
||||
+# threadcrash.exp - The point of this program is to crash in a multi-threaded app.
|
||||
+
|
||||
+
|
||||
+set testfile threadcrash
|
||||
+set srcfile ${testfile}.c
|
||||
+set shellfile ${srcdir}/${subdir}/${testfile}.sh
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+set GDB_abs ${GDB}
|
||||
+if [regexp "^\[^/\]" ${GDB_abs}] {
|
||||
+ set GDB_abs $env(PWD)/${GDB_abs}
|
||||
+}
|
||||
+
|
||||
+if [istarget "*-*-linux"] then {
|
||||
+ set target_cflags "-D_MIT_POSIX_THREADS"
|
||||
+} else {
|
||||
+ set target_cflags ""
|
||||
+}
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# ${shellfile} argument must not contain any directories.
|
||||
+set fd [open "|bash ${shellfile} ${binfile} $GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]" r]
|
||||
+while { [gets $fd line] >= 0 } {
|
||||
+ if [regexp " PASS: (.*)$" $line trash message] {
|
||||
+ pass $message
|
||||
+ } elseif [regexp " FAIL: (.*)$" $line trash message] {
|
||||
+ fail $message
|
||||
+ }
|
||||
+}
|
||||
+catch {
|
||||
+ close $fd
|
||||
+}
|
||||
+
|
||||
+return 0
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh b/gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.sh
|
||||
@@ -0,0 +1,324 @@
|
||||
+#! /bin/bash
|
||||
+
|
||||
+# NOTE: threadcrash.c *must* be built with debugging symbols
|
||||
+#
|
||||
+# The point of this shell script is to crash treadcrash.c, load the
|
||||
+# resulting core file into gdb and verify that gdb can extract enough
|
||||
+# information from the core file.
|
||||
+#
|
||||
+# The return code from this script is the number of failed tests.
|
||||
+
|
||||
+LOG=gdbresult.log
|
||||
+
|
||||
+if [ $# = 0 ] ; then
|
||||
+ echo >&2 Syntax: $0 \<name of threadcrash binary\> [\<gdb binary\> \<args...\>]
|
||||
+ exit 1
|
||||
+fi
|
||||
+RUNME="$1"
|
||||
+shift
|
||||
+GDB="${*:-gdb}"
|
||||
+
|
||||
+
|
||||
+pf_prefix=""
|
||||
+function pf_prefix() {
|
||||
+ pf_prefix="$*"
|
||||
+}
|
||||
+
|
||||
+set_test=""
|
||||
+function set_test() {
|
||||
+ if [ -n "$set_test" ] ; then
|
||||
+ echo >&2 "DEJAGNU-BASH ERROR: set_test already set"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ set_test="$*"
|
||||
+ if [ -n "$pf_prefix" ] ; then
|
||||
+ set_test="$pf_prefix: $set_test"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+# INTERNAL
|
||||
+function record_test {
|
||||
+ if [ -z "$set_test" ] ; then
|
||||
+ echo >&2 "DEJAGNU-BASH ERROR: set_test not set"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ # Provide the leading whitespace delimiter:
|
||||
+ echo " $1: $set_test"
|
||||
+ set_test=""
|
||||
+}
|
||||
+
|
||||
+function pass() {
|
||||
+ record_test PASS
|
||||
+}
|
||||
+function fail() {
|
||||
+ record_test FAIL
|
||||
+}
|
||||
+
|
||||
+
|
||||
+# Verify that the gdb output doesn't contain $1.
|
||||
+function mustNotHave() {
|
||||
+ local BADWORD=$1
|
||||
+ set_test gdb output contains "$BADWORD"
|
||||
+ if grep -q "$BADWORD" $LOG ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains exactly $1 $2s.
|
||||
+function mustHaveCorrectAmount() {
|
||||
+ local WANTEDNUMBER=$1
|
||||
+ local GOODWORD=$2
|
||||
+ local ACTUALNUMBER=$(grep "$GOODWORD" $LOG | wc -l)
|
||||
+ set_test gdb output contained $ACTUALNUMBER \""$GOODWORD"\", not $WANTEDNUMBER as expected
|
||||
+ if [ $ACTUALNUMBER != $WANTEDNUMBER ] ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains seven threads
|
||||
+function mustHaveSevenThreads() {
|
||||
+ NTHREADS=$(egrep "^Thread [1-7] \(" $LOG | wc -l)
|
||||
+ set_test gdb output contains $NTHREADS threads, not 7 as expected
|
||||
+ if [ $NTHREADS != 7 ] ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output has all parameters on consecutive lines
|
||||
+function mustHaveSequence() {
|
||||
+ SEQUENCE="$*"
|
||||
+ NPARTS=$#
|
||||
+ grep "$1" -A$((NPARTS - 1)) $LOG > matches.log
|
||||
+
|
||||
+ while [ $# -gt 1 ] ; do
|
||||
+ shift
|
||||
+ ((NPARTS--))
|
||||
+ grep "$1" -A$((NPARTS - 1)) matches.log > temp.log
|
||||
+ mv temp.log matches.log
|
||||
+ done
|
||||
+ LASTPART=$1
|
||||
+
|
||||
+ set_test gdb output does not contain the sequence: $SEQUENCE
|
||||
+ if ! grep -q "$LASTPART" matches.log ; then
|
||||
+ fail
|
||||
+ return 1
|
||||
+ fi
|
||||
+ pass
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that $LOG contains all information we want
|
||||
+function verifyLog() {
|
||||
+ local FAILURES=0
|
||||
+
|
||||
+ mustNotHave '??' || ((FAILURES++))
|
||||
+ mustHaveCorrectAmount 11 threadcrash.c: || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSevenThreads || ((FAILURES++))
|
||||
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
|
||||
+
|
||||
+ return $FAILURES
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromCore() {
|
||||
+ # Make sure we get a core file
|
||||
+ set_test Make sure we get a core file
|
||||
+ if ! ulimit -c unlimited ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Run the crasher
|
||||
+ ./$(basename "$RUNME")
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ # Verify that we actually crashed
|
||||
+ set_test $RUNME should have been killed by a signal, got non-signal exit code $EXITCODE
|
||||
+ if [ $EXITCODE -lt 128 ] ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Verify that we got a core file
|
||||
+ set_test $RUNME did not create a core file
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a gcore file in $LOG
|
||||
+function getLogFromGcore() {
|
||||
+ # Create the core file
|
||||
+ rm -f core*
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+run
|
||||
+gcore
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" > /dev/null
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code when creating gcore file
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE when creating gcore file
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Verify that we got a core file from gcore
|
||||
+ set_test gdb gcore did not create a core file
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ fail
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ pass
|
||||
+
|
||||
+ # Run gdb on the gcore file
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code when examining gcore file
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE when examining gcore file
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromLiveProcess() {
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+set width 0
|
||||
+run
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ set_test gdb exited with error code
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >&2 gdb exited with error code $EXITCODE
|
||||
+ fail
|
||||
+ fi
|
||||
+ pass
|
||||
+}
|
||||
+
|
||||
+####### Main program follows #####################
|
||||
+
|
||||
+# Make sure we don't clobber anybody else's (core) file(s)
|
||||
+WORKDIR=/tmp/$PPID
|
||||
+mkdir -p $WORKDIR
|
||||
+cp "$RUNME" $WORKDIR
|
||||
+cd $WORKDIR
|
||||
+
|
||||
+# Count problems
|
||||
+FAILURES=0
|
||||
+
|
||||
+echo === Testing gdb vs core file...
|
||||
+pf_prefix core file
|
||||
+getLogFromCore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+pf_prefix
|
||||
+echo === Core file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs gcore file...
|
||||
+pf_prefix gcore file
|
||||
+getLogFromGcore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+pf_prefix
|
||||
+echo === Gcore file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs live process...
|
||||
+pf_prefix live process
|
||||
+getLogFromLiveProcess
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+pf_prefix
|
||||
+echo === Live process tests done.
|
||||
+
|
||||
+# Executive summary
|
||||
+echo
|
||||
+if [ $FAILURES == 0 ] ; then
|
||||
+ echo All tests passed!
|
||||
+else
|
||||
+ echo $FAILURES tests failed!
|
||||
+ echo
|
||||
+ echo Make sure the threadcrash binary contains debugging information \(build with \"gcc -g\"\).
|
||||
+fi
|
||||
+
|
||||
+# Clean up
|
||||
+cd /
|
||||
+rm -rf $WORKDIR
|
||||
+
|
||||
+exit $FAILURES
|
||||
diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh-orig b/gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/threadcrash.sh-orig
|
||||
@@ -0,0 +1,248 @@
|
||||
+#! /bin/bash
|
||||
+
|
||||
+# NOTE: threadcrash.c *must* be built with debugging symbols
|
||||
+#
|
||||
+# The point of this shell script is to crash treadcrash.c, load the
|
||||
+# resulting core file into gdb and verify that gdb can extract enough
|
||||
+# information from the core file.
|
||||
+#
|
||||
+# The return code from this script is the number of failed tests.
|
||||
+
|
||||
+LOG=gdbresult.log
|
||||
+
|
||||
+if [ $# != 1 ] ; then
|
||||
+ echo > /dev/stderr Syntax: $0 \<name of threadcrash binary\>
|
||||
+ exit 1
|
||||
+fi
|
||||
+RUNME="$1"
|
||||
+
|
||||
+# Verify that the gdb output doesn't contain $1.
|
||||
+function mustNotHave() {
|
||||
+ local BADWORD=$1
|
||||
+ if grep -q "$BADWORD" $LOG ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output contains "$BADWORD"
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains exactly $1 $2s.
|
||||
+function mustHaveCorrectAmount() {
|
||||
+ local WANTEDNUMBER=$1
|
||||
+ local GOODWORD=$2
|
||||
+ local ACTUALNUMBER=$(grep "$GOODWORD" $LOG | wc -l)
|
||||
+ if [ $ACTUALNUMBER != $WANTEDNUMBER ] ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output contained $ACTUALNUMBER \""$GOODWORD"\", not $WANTEDNUMBER as expected
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output contains seven threads
|
||||
+function mustHaveSevenThreads() {
|
||||
+ NTHREADS=$(egrep "^Thread [1-7] \(" $LOG | wc -l)
|
||||
+ if [ $NTHREADS != 7 ] ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output contains $NTHREADS threads, not 7 as expected
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that the gdb output has all parameters on consecutive lines
|
||||
+function mustHaveSequence() {
|
||||
+ SEQUENCE="$*"
|
||||
+ NPARTS=$#
|
||||
+ grep "$1" -A$((NPARTS - 1)) $LOG > matches.log
|
||||
+
|
||||
+ while [ $# -gt 1 ] ; do
|
||||
+ shift
|
||||
+ ((NPARTS--))
|
||||
+ grep "$1" -A$((NPARTS - 1)) matches.log > temp.log
|
||||
+ mv temp.log matches.log
|
||||
+ done
|
||||
+ LASTPART=$1
|
||||
+
|
||||
+ if ! grep -q "$LASTPART" matches.log ; then
|
||||
+ echo >> /dev/stderr WARNING: gdb output does not contain the sequence: $SEQUENCE
|
||||
+ return 1
|
||||
+ fi
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Verify that $LOG contains all information we want
|
||||
+function verifyLog() {
|
||||
+ local FAILURES=0
|
||||
+
|
||||
+ mustNotHave '??' || ((FAILURES++))
|
||||
+ mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSevenThreads || ((FAILURES++))
|
||||
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
|
||||
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
|
||||
+
|
||||
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
|
||||
+
|
||||
+ return $FAILURES
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromCore() {
|
||||
+ # Make sure we get a core file
|
||||
+ ulimit -c unlimited || exit 1
|
||||
+
|
||||
+ # Run the crasher
|
||||
+ ./$(basename "$RUNME")
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ # Verify that we actually crashed
|
||||
+ if [ $EXITCODE -lt 128 ] ; then
|
||||
+ echo >> /dev/stderr ERROR: $RUNME should have been killed by a signal, got non-signal exit code $EXITCODE
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ # Verify that we got a core file
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ echo >> /dev/stderr ERROR: $RUNME did not create a core file
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a gcore file in $LOG
|
||||
+function getLogFromGcore() {
|
||||
+ # Create the core file
|
||||
+ rm -f core*
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+run
|
||||
+gcore
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" > /dev/null
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when creating gcore file
|
||||
+ fi
|
||||
+
|
||||
+ # Verify that we got a core file from gcore
|
||||
+ if [ ! -r core* ] ; then
|
||||
+ echo >> /dev/stderr ERROR: gdb gcore did not create a core file
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ # Run gdb on the gcore file
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+set width 0
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" core* > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when examining gcore file
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+# Put result of debugging a core file in $LOG
|
||||
+function getLogFromLiveProcess() {
|
||||
+ # Run gdb
|
||||
+ cat > gdbscript.gdb <<EOF
|
||||
+handle SIGQUIT pass noprint nostop
|
||||
+handle SIGUSR1 pass noprint nostop
|
||||
+handle SIGUSR2 pass noprint nostop
|
||||
+handle SIGALRM pass noprint nostop
|
||||
+set width 0
|
||||
+run
|
||||
+t a a bt 100
|
||||
+quit
|
||||
+EOF
|
||||
+ cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" > $LOG
|
||||
+ EXITCODE=$?
|
||||
+
|
||||
+ if [ $EXITCODE != 0 ] ; then
|
||||
+ ((FAILURES++))
|
||||
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+####### Main program follows #####################
|
||||
+
|
||||
+# Make sure we don't clobber anybody else's (core) file(s)
|
||||
+WORKDIR=/tmp/$PPID
|
||||
+mkdir -p $WORKDIR
|
||||
+cp "$RUNME" $WORKDIR
|
||||
+cd $WORKDIR
|
||||
+
|
||||
+# Count problems
|
||||
+FAILURES=0
|
||||
+
|
||||
+echo === Testing gdb vs core file...
|
||||
+getLogFromCore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+echo === Core file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs gcore file...
|
||||
+getLogFromGcore
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+echo === Gcore file tests done.
|
||||
+
|
||||
+echo
|
||||
+
|
||||
+echo === Testing gdb vs live process...
|
||||
+getLogFromLiveProcess
|
||||
+verifyLog
|
||||
+((FAILURES+=$?))
|
||||
+echo === Live process tests done.
|
||||
+
|
||||
+# Executive summary
|
||||
+echo
|
||||
+if [ $FAILURES == 0 ] ; then
|
||||
+ echo All tests passed!
|
||||
+else
|
||||
+ echo $FAILURES tests failed!
|
||||
+ echo
|
||||
+ echo Make sure the threadcrash binary contains debugging information \(build with \"gcc -g\"\).
|
||||
+fi
|
||||
+
|
||||
+# Clean up
|
||||
+cd /
|
||||
+rm -rf $WORKDIR
|
||||
+
|
||||
+exit $FAILURES
|
@ -44,7 +44,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
|
||||
@@ -1214,6 +1214,10 @@ print_command_1 (const char *args, int voidprint)
|
||||
@@ -1210,6 +1210,10 @@ print_command_1 (const char *args, int voidprint)
|
||||
|
||||
if (exp != nullptr && *exp)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ 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
|
||||
@@ -3166,6 +3166,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
@@ -3169,6 +3169,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
msymbol->linkage_name ()); */
|
||||
;
|
||||
/* fall through */
|
||||
@ -23,5 +23,5 @@ diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", msymbol.minsym->linkage_name (), paddress (target_gdbarch (), pc));
|
||||
+ /* fall through */
|
||||
else
|
||||
return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
|
||||
}
|
||||
{
|
||||
/* Detect an obvious case of infinite recursion. If this
|
||||
|
@ -1,149 +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-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
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
|
||||
@@ -0,0 +1,37 @@
|
||||
+/* 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 2 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, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#define MEGS 64
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ void *mem;
|
||||
+
|
||||
+ mem = malloc (MEGS * 1024ULL * 1024ULL);
|
||||
+
|
||||
+ for (;;)
|
||||
+ sleep (1);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
|
||||
@@ -0,0 +1,94 @@
|
||||
+# 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 2 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, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile gcore-excessive-memory
|
||||
+set srcfile ${testfile}.c
|
||||
+set shfile [standard_output_file ${testfile}-gdb.sh]
|
||||
+set corefile [standard_output_file ${testfile}.core]
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set f [open "|getconf PAGESIZE" "r"]
|
||||
+gets $f pagesize
|
||||
+close $f
|
||||
+
|
||||
+set pid_of_bin [eval exec $binfile &]
|
||||
+sleep 2
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
|
||||
+
|
||||
+gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
|
||||
+gdb_test "up 99" "in main .*" "verify we can get to main"
|
||||
+
|
||||
+proc memory_v_pages_get {} {
|
||||
+ global pid_of_gdb pagesize
|
||||
+ set fd [open "/proc/$pid_of_gdb/statm"]
|
||||
+ gets $fd line
|
||||
+ close $fd
|
||||
+ # number of pages of virtual memory
|
||||
+ scan $line "%d" drs
|
||||
+ return $drs
|
||||
+}
|
||||
+
|
||||
+set pages_found [memory_v_pages_get]
|
||||
+
|
||||
+# It must be definitely less than `MEGS' of `gcore-excessive-memory.c'.
|
||||
+set mb_gcore_reserve 4
|
||||
+verbose -log "pages_found = $pages_found, mb_gcore_reserve = $mb_gcore_reserve"
|
||||
+set kb_found [expr $pages_found * $pagesize / 1024]
|
||||
+set kb_permit [expr $kb_found + 1 * 1024 + $mb_gcore_reserve * 1024]
|
||||
+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
|
||||
+
|
||||
+# Create the ulimit wrapper.
|
||||
+set f [open $shfile "w"]
|
||||
+puts $f "#! /bin/sh"
|
||||
+puts $f "ulimit -v $kb_permit"
|
||||
+puts $f "exec $GDB \"\$@\""
|
||||
+close $f
|
||||
+remote_exec host "chmod +x $shfile"
|
||||
+
|
||||
+gdb_exit
|
||||
+set GDBold $GDB
|
||||
+set GDB "$shfile"
|
||||
+gdb_start
|
||||
+set GDB $GDBold
|
||||
+
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
|
||||
+
|
||||
+gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
|
||||
+gdb_test "up 99" "in main .*" "verify we can get to main"
|
||||
+
|
||||
+verbose -log "kb_found before gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
|
||||
+
|
||||
+gdb_test "gcore $corefile" "Saved corefile \[^\n\r\]*" "Save the core file"
|
||||
+
|
||||
+verbose -log "kb_found after gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
|
||||
+
|
||||
+# Cleanup.
|
||||
+exec kill -9 $pid_of_bin
|
@ -1,95 +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-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
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.c b/gdb/testsuite/gdb.base/watchpoint-during-step.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.c
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 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 2 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, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+static int var;
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ var = 1;
|
||||
+ var = 2;
|
||||
+ var = 3;
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.exp b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
|
||||
@@ -0,0 +1,44 @@
|
||||
+# Copyright 2007 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 2 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, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile watchpoint-during-step
|
||||
+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}
|
||||
+
|
||||
+runto_main
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "var = 2"]
|
||||
+gdb_continue_to_breakpoint "Find the first var set"
|
||||
+
|
||||
+gdb_test "step" ".*var = 3;" "Step to the next var set"
|
||||
+
|
||||
+gdb_test "watch var" "atchpoint .*: var" "Set the watchpoint"
|
||||
+
|
||||
+# Here is the target point. Be careful to not have breakpoint set on the line
|
||||
+# 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"
|
@ -73,7 +73,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
#include "frame.h"
|
||||
#include "inferior.h"
|
||||
#include "target.h"
|
||||
@@ -345,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
@@ -495,12 +497,27 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
|
||||
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
|
||||
{
|
||||
@ -88,8 +88,8 @@ diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
/* Make sure to close exec_bfd, or else "run" might try to use
|
||||
it. */
|
||||
exec_close ();
|
||||
- error (_("\"%s\": not in executable format: %s"),
|
||||
- scratch_pathname,
|
||||
- error (_("\"%ps\": not in executable format: %s"),
|
||||
- styled_string (file_name_style.style (), scratch_pathname),
|
||||
- gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
+
|
||||
+ if (is_core != 0)
|
||||
@ -98,29 +98,16 @@ diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
+ "Please specify an executable to debug."),
|
||||
+ scratch_pathname);
|
||||
+ else
|
||||
+ error (_("\"%ss\": not in executable format: %s"),
|
||||
+ scratch_pathname,
|
||||
+ error (_("\"%ps\": not in executable format: %s"),
|
||||
+ styled_string (file_name_style.style (), scratch_pathname),
|
||||
+ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
}
|
||||
|
||||
if (build_section_table (exec_bfd, §ions, §ions_end))
|
||||
diff --git a/gdb/gdbsupport/common-exceptions.h b/gdb/gdbsupport/common-exceptions.h
|
||||
--- a/gdb/gdbsupport/common-exceptions.h
|
||||
+++ b/gdb/gdbsupport/common-exceptions.h
|
||||
@@ -106,6 +106,9 @@ enum errors {
|
||||
"_ERROR" is appended to the name. */
|
||||
MAX_COMPLETIONS_REACHED_ERROR,
|
||||
|
||||
+ /* Attempt to load a core file as executable. */
|
||||
+ IS_CORE_ERROR,
|
||||
+
|
||||
/* Add more errors here. */
|
||||
NR_ERRORS
|
||||
};
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -467,6 +467,34 @@ struct cmdarg
|
||||
@@ -524,6 +524,34 @@ struct cmdarg
|
||||
char *string;
|
||||
};
|
||||
|
||||
@ -155,7 +142,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
static void
|
||||
captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
@@ -907,6 +935,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -959,6 +987,8 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
symarg = argv[optind];
|
||||
execarg = argv[optind];
|
||||
@ -164,7 +151,7 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
optind++;
|
||||
}
|
||||
|
||||
@@ -1063,12 +1093,25 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -1114,12 +1144,25 @@ captured_main_1 (struct captured_main_args *context)
|
||||
&& symarg != NULL
|
||||
&& strcmp (execarg, symarg) == 0)
|
||||
{
|
||||
@ -194,3 +181,16 @@ diff --git a/gdb/main.c b/gdb/main.c
|
||||
ret = catch_command_errors (symbol_file_add_main_adapter,
|
||||
symarg, !batch_flag);
|
||||
}
|
||||
diff --git a/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
|
||||
--- a/gdbsupport/common-exceptions.h
|
||||
+++ b/gdbsupport/common-exceptions.h
|
||||
@@ -106,6 +106,9 @@ enum errors {
|
||||
"_ERROR" is appended to the name. */
|
||||
MAX_COMPLETIONS_REACHED_ERROR,
|
||||
|
||||
+ /* Attempt to load a core file as executable. */
|
||||
+ IS_CORE_ERROR,
|
||||
+
|
||||
/* Add more errors here. */
|
||||
NR_ERRORS
|
||||
};
|
||||
|
@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -709,6 +709,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
@@ -708,6 +708,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,7 @@ 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
|
||||
@@ -743,7 +743,11 @@ static int missing_rpm_list_entries;
|
||||
@@ -742,7 +742,11 @@ static int missing_rpm_list_entries;
|
||||
/* Returns the count of newly added rpms. */
|
||||
|
||||
static int
|
||||
@ -24,7 +24,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
{
|
||||
static int rpm_init_done = 0;
|
||||
rpmts ts;
|
||||
@@ -850,7 +854,11 @@ missing_rpm_enlist (const char *filename)
|
||||
@@ -849,7 +853,11 @@ missing_rpm_enlist (const char *filename)
|
||||
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
|
||||
if (mi != NULL)
|
||||
{
|
||||
@ -36,7 +36,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
{
|
||||
Header h;
|
||||
char *debuginfo, **slot, *s, *s2;
|
||||
@@ -968,6 +976,37 @@ missing_rpm_enlist (const char *filename)
|
||||
@@ -967,6 +975,37 @@ missing_rpm_enlist (const char *filename)
|
||||
xfree (debuginfo);
|
||||
count++;
|
||||
}
|
||||
@ -74,7 +74,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
|
||||
rpmdbFreeIterator_p (mi);
|
||||
}
|
||||
@@ -977,6 +1016,20 @@ missing_rpm_enlist (const char *filename)
|
||||
@@ -976,6 +1015,20 @@ missing_rpm_enlist (const char *filename)
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -95,10 +95,10 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
static bool
|
||||
missing_rpm_list_compar (const char *ap, const char *bp)
|
||||
{
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -3497,6 +3497,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -3025,6 +3025,16 @@ read_gdb_index_from_buffer (const char *filename,
|
||||
"set use-deprecated-index-sections on". */
|
||||
if (version < 6 && !deprecated_ok)
|
||||
{
|
||||
@ -115,7 +115,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
static int warning_printed = 0;
|
||||
if (!warning_printed)
|
||||
{
|
||||
@@ -3508,6 +3518,10 @@ to use the section anyway."),
|
||||
@@ -3036,6 +3046,10 @@ to use the section anyway."),
|
||||
warning_printed = 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -240,10 +240,10 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
#include "gdbcmd.h"
|
||||
#include "gdbcore.h"
|
||||
+#include "inferior.h"
|
||||
#include "libbfd.h"
|
||||
#include "objfiles.h"
|
||||
#include "observable.h"
|
||||
@@ -698,8 +699,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
#include "symfile.h"
|
||||
@@ -697,8 +698,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -619,7 +619,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
avoidance. */
|
||||
|
||||
struct missing_filepair
|
||||
@@ -753,11 +1120,17 @@ missing_filepair_change (void)
|
||||
@@ -752,11 +1119,17 @@ missing_filepair_change (void)
|
||||
/* All their memory came just from missing_filepair_OBSTACK. */
|
||||
missing_filepair_hash = NULL;
|
||||
}
|
||||
@ -637,7 +637,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
missing_filepair_change ();
|
||||
}
|
||||
|
||||
@@ -824,14 +1197,38 @@ debug_print_missing (const char *binary, const char *debug)
|
||||
@@ -823,14 +1196,38 @@ debug_print_missing (const char *binary, const char *debug)
|
||||
|
||||
*slot = missing_filepair;
|
||||
|
||||
@ -686,9 +686,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
diff --git a/gdb/config.in b/gdb/config.in
|
||||
--- a/gdb/config.in
|
||||
+++ b/gdb/config.in
|
||||
@@ -36,6 +36,9 @@
|
||||
/* Define to BFD's default target vector. */
|
||||
#undef DEFAULT_BFD_VEC
|
||||
@@ -39,6 +39,9 @@
|
||||
/* Handle .ctf type-info sections */
|
||||
#undef ENABLE_LIBCTF
|
||||
|
||||
+/* librpm version specific library name to dlopen. */
|
||||
+#undef DLOPEN_LIBRPM
|
||||
@ -696,7 +696,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
|
||||
@@ -245,6 +248,9 @@
|
||||
@@ -247,6 +250,9 @@
|
||||
/* Define if you have the mpfr library. */
|
||||
#undef HAVE_LIBMPFR
|
||||
|
||||
@ -709,7 +709,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
|
||||
@@ -761,6 +761,11 @@ CODESIGN_CERT
|
||||
@@ -769,6 +769,11 @@ PKG_CONFIG
|
||||
HAVE_NATIVE_GCORE_TARGET
|
||||
TARGET_OBS
|
||||
subdirs
|
||||
@ -721,7 +721,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
GDB_DATADIR
|
||||
DEBUGDIR
|
||||
MAKEINFO_EXTRA_FLAGS
|
||||
@@ -864,6 +869,7 @@ with_gdb_datadir
|
||||
@@ -873,6 +878,7 @@ with_gdb_datadir
|
||||
with_relocated_sources
|
||||
with_auto_load_dir
|
||||
with_auto_load_safe_path
|
||||
@ -729,42 +729,34 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
enable_targets
|
||||
enable_64_bit_bfd
|
||||
enable_gdbmi
|
||||
@@ -926,6 +932,11 @@ CCC
|
||||
CPP
|
||||
MAKEINFO
|
||||
MAKEINFOFLAGS
|
||||
+PKG_CONFIG
|
||||
+PKG_CONFIG_PATH
|
||||
+PKG_CONFIG_LIBDIR
|
||||
@@ -949,6 +955,8 @@ PKG_CONFIG_PATH
|
||||
PKG_CONFIG_LIBDIR
|
||||
DEBUGINFOD_CFLAGS
|
||||
DEBUGINFOD_LIBS
|
||||
+RPM_CFLAGS
|
||||
+RPM_LIBS
|
||||
YACC
|
||||
YFLAGS
|
||||
XMKMF'
|
||||
@@ -1598,6 +1609,8 @@ Optional Packages:
|
||||
[--with-auto-load-dir]
|
||||
--without-auto-load-safe-path
|
||||
@@ -1621,6 +1629,8 @@ Optional Packages:
|
||||
do not restrict auto-loaded files locations
|
||||
--with-debuginfod Enable debuginfo lookups with debuginfod
|
||||
(auto/yes/no)
|
||||
+ --with-rpm query rpm database for missing debuginfos (yes/no,
|
||||
+ def. auto=librpm.so)
|
||||
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
|
||||
--with-curses use the curses library instead of the termcap
|
||||
library
|
||||
@@ -1661,6 +1674,13 @@ Some influential environment variables:
|
||||
MAKEINFO Parent configure detects if it is of sufficient version.
|
||||
MAKEINFOFLAGS
|
||||
Parameters for MAKEINFO.
|
||||
+ PKG_CONFIG path to pkg-config utility
|
||||
+ PKG_CONFIG_PATH
|
||||
+ directories to add to pkg-config's search path
|
||||
+ PKG_CONFIG_LIBDIR
|
||||
+ path overriding pkg-config's built-in search path
|
||||
@@ -1702,6 +1712,8 @@ Some influential environment variables:
|
||||
C compiler flags for DEBUGINFOD, overriding pkg-config
|
||||
DEBUGINFOD_LIBS
|
||||
linker flags for DEBUGINFOD, overriding pkg-config
|
||||
+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
|
||||
+ RPM_LIBS linker flags for RPM, overriding pkg-config
|
||||
YACC The `Yet Another Compiler Compiler' implementation to use.
|
||||
Defaults to the first program found out of: `bison -y', `byacc',
|
||||
`yacc'.
|
||||
@@ -6587,6 +6607,494 @@ _ACEOF
|
||||
@@ -6666,6 +6678,494 @@ _ACEOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
|
||||
$as_echo "$with_auto_load_safe_path" >&6; }
|
||||
|
||||
@ -1262,7 +1254,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
|
||||
@@ -144,6 +144,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
|
||||
@@ -143,6 +143,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
|
||||
[Directories safe to hold auto-loaded files.])
|
||||
AC_MSG_RESULT([$with_auto_load_safe_path])
|
||||
|
||||
@ -1465,15 +1457,15 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
diff --git a/gdb/event-top.c b/gdb/event-top.c
|
||||
--- a/gdb/event-top.c
|
||||
+++ b/gdb/event-top.c
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "ser-event.h"
|
||||
#include "gdb_select.h"
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "gdbsupport/gdb_select.h"
|
||||
#include "gdbsupport/gdb-sigmask.h"
|
||||
#include "async-event.h"
|
||||
+#include "symfile.h"
|
||||
|
||||
/* readline include files. */
|
||||
#include "readline/readline.h"
|
||||
@@ -363,6 +364,8 @@ display_gdb_prompt (const char *new_prompt)
|
||||
@@ -364,6 +365,8 @@ display_gdb_prompt (const char *new_prompt)
|
||||
/* Reset the nesting depth used when trace-commands is set. */
|
||||
reset_command_nest_depth ();
|
||||
|
||||
@ -1482,7 +1474,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. */
|
||||
@@ -772,7 +775,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
|
||||
@@ -773,7 +776,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
|
||||
command_handler (cmd);
|
||||
|
||||
if (ui->prompt_state != PROMPTED)
|
||||
@ -1497,12 +1489,11 @@ 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
|
||||
@@ -542,6 +542,8 @@ extern void generic_load (const char *args, int from_tty);
|
||||
@@ -560,6 +560,7 @@ extern void generic_load (const char *args, int from_tty);
|
||||
/* 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);
|
||||
+extern void debug_flush_missing (void);
|
||||
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
|
||||
#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
|
||||
|
||||
/* From dwarf2read.c */
|
||||
|
||||
|
@ -14,7 +14,7 @@ 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
|
||||
@@ -1346,14 +1346,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
@@ -1340,14 +1340,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
}
|
||||
|
||||
{
|
||||
@ -44,7 +44,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
if (build_id != NULL)
|
||||
{
|
||||
char *name, *build_id_filename;
|
||||
@@ -1368,23 +1381,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
@@ -1362,23 +1375,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
xfree (name);
|
||||
}
|
||||
else
|
||||
|
@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate.patch
|
||||
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
|
||||
--- a/bfd/libbfd-in.h
|
||||
+++ b/bfd/libbfd-in.h
|
||||
@@ -127,7 +127,7 @@ static inline char *
|
||||
@@ -121,7 +121,7 @@ static inline char *
|
||||
bfd_strdup (const char *str)
|
||||
{
|
||||
size_t len = strlen (str) + 1;
|
||||
@ -21,7 +21,7 @@ diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
|
||||
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
|
||||
--- a/bfd/libbfd.h
|
||||
+++ b/bfd/libbfd.h
|
||||
@@ -132,7 +132,7 @@ static inline char *
|
||||
@@ -126,7 +126,7 @@ static inline char *
|
||||
bfd_strdup (const char *str)
|
||||
{
|
||||
size_t len = strlen (str) + 1;
|
||||
@ -33,7 +33,7 @@ diff --git a/bfd/libbfd.h b/bfd/libbfd.h
|
||||
diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
--- a/gdb/build-id.c
|
||||
+++ b/gdb/build-id.c
|
||||
@@ -24,13 +24,71 @@
|
||||
@@ -24,13 +24,70 @@
|
||||
#include "gdbsupport/gdb_vecs.h"
|
||||
#include "symfile.h"
|
||||
#include "objfiles.h"
|
||||
@ -46,7 +46,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
+#include "gdb_bfd.h"
|
||||
+#include "gdbcmd.h"
|
||||
#include "gdbcore.h"
|
||||
+#include "libbfd.h"
|
||||
+#include "objfiles.h"
|
||||
+#include "observable.h"
|
||||
+#include "symfile.h"
|
||||
@ -106,7 +105,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
{
|
||||
if (!bfd_check_format (abfd, bfd_object)
|
||||
&& !bfd_check_format (abfd, bfd_core))
|
||||
@@ -43,6 +101,348 @@ build_id_bfd_get (bfd *abfd)
|
||||
@@ -43,6 +100,348 @@ build_id_bfd_get (bfd *abfd)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -455,7 +454,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
/* See build-id.h. */
|
||||
|
||||
int
|
||||
@@ -51,7 +451,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
@@ -51,7 +450,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
const struct bfd_build_id *found;
|
||||
int retval = 0;
|
||||
|
||||
@ -464,7 +463,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"),
|
||||
@@ -66,56 +466,159 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
@@ -66,56 +465,159 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -543,7 +542,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
+ 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);
|
||||
- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget);
|
||||
+ string_appendf (link, ".%u", seqno);
|
||||
+ }
|
||||
|
||||
@ -651,7 +650,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
}
|
||||
|
||||
/* Common code for finding BFDs of a given build-id. This function
|
||||
@@ -124,7 +627,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
|
||||
@@ -124,7 +626,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
|
||||
|
||||
static gdb_bfd_ref_ptr
|
||||
build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
@ -660,7 +659,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
{
|
||||
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
|
||||
cause "/.build-id/..." lookups. */
|
||||
@@ -147,16 +650,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
@@ -147,16 +649,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
if (size > 0)
|
||||
{
|
||||
size--;
|
||||
@ -681,7 +680,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
if (debug_bfd != NULL)
|
||||
return debug_bfd;
|
||||
|
||||
@@ -170,7 +674,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
@@ -170,7 +673,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
|
||||
{
|
||||
link = gdb_sysroot + link;
|
||||
@ -691,7 +690,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
|
||||
if (debug_bfd != NULL)
|
||||
return debug_bfd;
|
||||
}
|
||||
@@ -179,38 +684,208 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
@@ -179,38 +683,208 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -907,7 +906,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 ()),
|
||||
@@ -223,3 +898,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
|
||||
@@ -223,3 +897,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
|
||||
|
||||
return std::string ();
|
||||
}
|
||||
@ -1003,8 +1002,8 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
#include "inferior.h"
|
||||
#include "infrun.h"
|
||||
#include "symtab.h"
|
||||
@@ -322,6 +326,8 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
|
||||
inferior_ptid = ptid; /* Yes, make it current. */
|
||||
@@ -362,6 +366,8 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
|
||||
switch_to_thread (thr); /* Yes, make it current. */
|
||||
}
|
||||
|
||||
+static bool build_id_core_loads = true;
|
||||
@ -1012,7 +1011,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
|
||||
@@ -358,19 +364,25 @@ core_file_command (const char *filename, int from_tty)
|
||||
@@ -398,19 +404,25 @@ core_file_command (const char *filename, int from_tty)
|
||||
static void
|
||||
locate_exec_from_corefile_build_id (bfd *abfd, int from_tty)
|
||||
{
|
||||
@ -1040,10 +1039,10 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
|
||||
}
|
||||
|
||||
/* See gdbcore.h. */
|
||||
@@ -998,4 +1010,11 @@ void
|
||||
_initialize_corelow (void)
|
||||
{
|
||||
add_target (core_target_info, core_target_open, filename_completer);
|
||||
@@ -1189,4 +1201,11 @@ _initialize_corelow ()
|
||||
maintenance_print_core_file_backed_mappings,
|
||||
_("Print core file's file-backed mappings."),
|
||||
&maintenanceprintlist);
|
||||
+
|
||||
+ add_setshow_boolean_cmd ("build-id-core-loads", class_files,
|
||||
+ &build_id_core_loads, _("\
|
||||
@ -1055,7 +1054,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
|
||||
@@ -20862,6 +20862,27 @@ information files.
|
||||
@@ -21074,6 +21074,27 @@ information files.
|
||||
|
||||
@end table
|
||||
|
||||
@ -1083,10 +1082,10 @@ 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
|
||||
@@ -94,7 +94,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
|
||||
--- a/gdb/dwarf2/index-cache.c
|
||||
+++ b/gdb/dwarf2/index-cache.c
|
||||
@@ -95,7 +95,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
|
||||
return;
|
||||
|
||||
/* Get build id of objfile. */
|
||||
@ -1095,7 +1094,7 @@ diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
|
||||
if (build_id == nullptr)
|
||||
{
|
||||
if (debug_index_cache)
|
||||
@@ -112,7 +112,8 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
@@ -113,7 +113,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
|
||||
|
||||
if (dwz != nullptr)
|
||||
{
|
||||
@ -1105,28 +1104,28 @@ diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
|
||||
|
||||
if (dwz_build_id == nullptr)
|
||||
{
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -2718,7 +2718,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -2218,7 +2218,7 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd)
|
||||
}
|
||||
|
||||
if (dwz_bfd == NULL)
|
||||
- dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid);
|
||||
+ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL);
|
||||
|
||||
if (dwz_bfd == NULL)
|
||||
error (_("could not find '.gnu_debugaltlink' file for %s"),
|
||||
@@ -6276,7 +6276,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
|
||||
if (dwz_bfd == nullptr)
|
||||
{
|
||||
@@ -5980,7 +5980,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)
|
||||
get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
|
||||
{
|
||||
- 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 {};
|
||||
|
||||
@@ -6289,7 +6289,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
|
||||
@@ -5993,7 +5993,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
|
||||
static gdb::array_view<const gdb_byte>
|
||||
get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
|
||||
{
|
||||
@ -1138,7 +1137,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
diff --git a/gdb/elfread.c b/gdb/elfread.c
|
||||
--- a/gdb/elfread.c
|
||||
+++ b/gdb/elfread.c
|
||||
@@ -1299,7 +1299,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
@@ -1298,7 +1298,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
&& objfile->separate_debug_objfile == NULL
|
||||
&& objfile->separate_debug_objfile_backlink == NULL)
|
||||
{
|
||||
@ -1149,35 +1148,61 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
|
||||
|
||||
if (debugfile.empty ())
|
||||
debugfile = find_separate_debug_file_by_debuglink (objfile);
|
||||
@@ -1311,8 +1313,12 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
|
||||
symfile_flags, objfile);
|
||||
}
|
||||
- else
|
||||
- has_dwarf2 = false;
|
||||
+ /* Check if any separate debug info has been extracted out. */
|
||||
+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
|
||||
+ != NULL)
|
||||
+ debug_print_missing (objfile_name (objfile), build_id_filename.get ());
|
||||
+ else
|
||||
+ has_dwarf2 = false;
|
||||
}
|
||||
@@ -1313,7 +1315,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
else
|
||||
{
|
||||
has_dwarf2 = false;
|
||||
- const struct bfd_build_id *build_id = build_id_bfd_get (objfile->obfd);
|
||||
+ const struct bfd_build_id *build_id = build_id_bfd_shdr_get (objfile->obfd);
|
||||
|
||||
/* Read the CTF section only if there is no DWARF info. */
|
||||
if (build_id != nullptr)
|
||||
{
|
||||
@@ -1338,6 +1340,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
has_dwarf2 = true;
|
||||
}
|
||||
}
|
||||
+ /* Check if any separate debug info has been extracted out. */
|
||||
+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
|
||||
+ != NULL)
|
||||
+ debug_print_missing (objfile_name (objfile), build_id_filename.get ());
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
--- a/gdb/exec.c
|
||||
+++ b/gdb/exec.c
|
||||
@@ -264,7 +264,7 @@ validate_exec_file (int from_tty)
|
||||
reopen_exec_file ();
|
||||
current_exec_file = get_exec_file (0);
|
||||
|
||||
- const bfd_build_id *exec_file_build_id = build_id_bfd_get (exec_bfd);
|
||||
+ const bfd_build_id *exec_file_build_id = build_id_bfd_shdr_get (exec_bfd);
|
||||
if (exec_file_build_id != nullptr)
|
||||
{
|
||||
/* Prepend the target prefix, to force gdb_bfd_open to open the
|
||||
@@ -277,7 +277,7 @@ validate_exec_file (int from_tty)
|
||||
if (abfd != nullptr)
|
||||
{
|
||||
const bfd_build_id *target_exec_file_build_id
|
||||
- = build_id_bfd_get (abfd.get ());
|
||||
+ = build_id_bfd_shdr_get (abfd.get ());
|
||||
|
||||
if (target_exec_file_build_id != nullptr)
|
||||
{
|
||||
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
|
||||
--- a/gdb/objfiles.h
|
||||
+++ b/gdb/objfiles.h
|
||||
@@ -627,6 +627,10 @@ struct objfile
|
||||
htab_up static_links;
|
||||
@@ -714,6 +714,10 @@ struct objfile
|
||||
bool skip_jit_symbol_lookup = false;
|
||||
};
|
||||
|
||||
+/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */
|
||||
+
|
||||
+#define OBJF_BUILD_ID_CORE_LOADED static_cast<enum objfile_flag>(1 << 12)
|
||||
+
|
||||
/* Declarations for functions defined in objfiles.c */
|
||||
/* A deleter for objfile. */
|
||||
|
||||
extern struct gdbarch *get_objfile_arch (const struct objfile *);
|
||||
struct objfile_deleter
|
||||
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
|
||||
@ -1210,7 +1235,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);
|
||||
@@ -1344,9 +1345,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
@@ -1338,9 +1339,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1265,10 +1290,22 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
|
||||
/* If this entry has no name, or its name matches the name
|
||||
for the main executable, don't include it in the list. */
|
||||
diff --git a/gdb/source.c b/gdb/source.c
|
||||
--- a/gdb/source.c
|
||||
+++ b/gdb/source.c
|
||||
@@ -1165,7 +1165,7 @@ open_source_file (struct symtab *s)
|
||||
srcpath += s->filename;
|
||||
}
|
||||
|
||||
- const struct bfd_build_id *build_id = build_id_bfd_get (ofp->obfd);
|
||||
+ const struct bfd_build_id *build_id = build_id_bfd_shdr_get (ofp->obfd);
|
||||
|
||||
/* Query debuginfod for the source file. */
|
||||
if (build_id != nullptr && !srcpath.empty ())
|
||||
diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
--- a/gdb/symfile.h
|
||||
+++ b/gdb/symfile.h
|
||||
@@ -532,12 +532,17 @@ void expand_symtabs_matching
|
||||
@@ -550,12 +550,18 @@ void expand_symtabs_matching
|
||||
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
|
||||
int need_fullname);
|
||||
|
||||
@ -1282,6 +1319,7 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
+/* 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);
|
||||
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
|
||||
+
|
||||
/* From dwarf2read.c */
|
||||
|
||||
@ -1289,7 +1327,7 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h
|
||||
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
|
||||
--- a/gdb/testsuite/gdb.base/corefile.exp
|
||||
+++ b/gdb/testsuite/gdb.base/corefile.exp
|
||||
@@ -311,3 +311,33 @@ gdb_test_multiple "core-file $corefile" $test {
|
||||
@@ -343,3 +343,33 @@ gdb_test_multiple "core-file $corefile" $test {
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
@ -1337,7 +1375,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
|
||||
@@ -1891,6 +1891,17 @@ proc default_gdb_start { } {
|
||||
@@ -2011,6 +2011,17 @@ proc default_gdb_start { } {
|
||||
}
|
||||
}
|
||||
|
||||
@ -1358,7 +1396,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
||||
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
|
||||
--- a/gdb/testsuite/lib/mi-support.exp
|
||||
+++ b/gdb/testsuite/lib/mi-support.exp
|
||||
@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } {
|
||||
@@ -308,6 +308,16 @@ proc default_mi_gdb_start { args } {
|
||||
warning "Couldn't set the width to 0."
|
||||
}
|
||||
}
|
||||
|
@ -1,130 +0,0 @@
|
||||
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>
|
||||
|
||||
* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
|
||||
[ stripped ]
|
||||
|
||||
2007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.7 - only the testcase left, patch has been reverted,
|
||||
char-vectors restricted.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/charsign.c b/gdb/testsuite/gdb.base/charsign.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/charsign.c
|
||||
@@ -0,0 +1,37 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 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 2 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, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+char n[]="A";
|
||||
+signed char s[]="A";
|
||||
+unsigned char u[]="A";
|
||||
+
|
||||
+typedef char char_n;
|
||||
+typedef signed char char_s;
|
||||
+typedef unsigned char char_u;
|
||||
+
|
||||
+char_n n_typed[]="A";
|
||||
+char_s s_typed[]="A";
|
||||
+char_u u_typed[]="A";
|
||||
diff --git a/gdb/testsuite/gdb.base/charsign.exp b/gdb/testsuite/gdb.base/charsign.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/charsign.exp
|
||||
@@ -0,0 +1,63 @@
|
||||
+# Copyright 2007 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 2 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, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+set testfile charsign
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc do_test { cflags } {
|
||||
+ global srcdir
|
||||
+ global binfile
|
||||
+ global subdir
|
||||
+ global srcfile
|
||||
+ global gdb_prompt
|
||||
+
|
||||
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+ }
|
||||
+
|
||||
+ # Get things started.
|
||||
+
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}
|
||||
+
|
||||
+ # For C programs, "start" should stop in main().
|
||||
+
|
||||
+ gdb_test "p n" \
|
||||
+ "= \"A\""
|
||||
+ gdb_test "p s" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+ gdb_test "p u" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+ gdb_test "p n_typed" \
|
||||
+ "= \"A\""
|
||||
+ gdb_test "p s_typed" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+ gdb_test "p u_typed" \
|
||||
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
||||
+}
|
||||
+
|
||||
+# The string identification works despite the compiler flags below due to
|
||||
+# gdbtypes.c:
|
||||
+# if (name && strcmp (name, "char") == 0)
|
||||
+# TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
|
||||
+
|
||||
+do_test {}
|
||||
+do_test {-fsigned-char}
|
||||
+do_test {-funsigned-char}
|
@ -28,7 +28,7 @@ frames-invalid can happen asynchronously.
|
||||
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
|
||||
--- a/gdb/testsuite/gdb.base/fileio.c
|
||||
+++ b/gdb/testsuite/gdb.base/fileio.c
|
||||
@@ -560,6 +560,28 @@ strerrno (int err)
|
||||
@@ -559,6 +559,28 @@ strerrno (int err)
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
@ -1,481 +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-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
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
|
||||
@@ -0,0 +1,328 @@
|
||||
+/* 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/>. */
|
||||
+
|
||||
+/*
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+void
|
||||
+func (void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ abort ();
|
||||
+}
|
||||
+*/
|
||||
+ .file "dw2-loclist-prelinked.c"
|
||||
+ .section .debug_abbrev,"",@progbits
|
||||
+.Ldebug_abbrev0:
|
||||
+ .section .debug_info,"",@progbits
|
||||
+.Ldebug_info0:
|
||||
+ .section .debug_line,"",@progbits
|
||||
+.Ldebug_line0:
|
||||
+ .text
|
||||
+.Ltext0:
|
||||
+.globl func
|
||||
+ .type func, @function
|
||||
+func:
|
||||
+.LFB2:
|
||||
+ .file 1 "dw2-loclist-prelinked.c"
|
||||
+ .loc 1 5 0
|
||||
+ pushl %ebp
|
||||
+.LCFI0:
|
||||
+ movl %esp, %ebp
|
||||
+.LCFI1:
|
||||
+ subl $24, %esp
|
||||
+.LCFI2:
|
||||
+ .loc 1 8 0
|
||||
+ call abort
|
||||
+.LFE2:
|
||||
+ .size func, .-func
|
||||
+ .section .debug_frame,"",@progbits
|
||||
+.Lframe0:
|
||||
+ .long .LECIE0-.LSCIE0
|
||||
+.LSCIE0:
|
||||
+ .long 0xffffffff
|
||||
+ .byte 0x1
|
||||
+ .string ""
|
||||
+ .uleb128 0x1
|
||||
+ .sleb128 -4
|
||||
+ .byte 0x8
|
||||
+ .byte 0xc
|
||||
+ .uleb128 0x4
|
||||
+ .uleb128 0x4
|
||||
+ .byte 0x88
|
||||
+ .uleb128 0x1
|
||||
+ .align 4
|
||||
+.LECIE0:
|
||||
+.LSFDE0:
|
||||
+ .long .LEFDE0-.LASFDE0
|
||||
+.LASFDE0:
|
||||
+ .long .Lframe0
|
||||
+ .long .LFB2
|
||||
+ .long .LFE2-.LFB2
|
||||
+ .byte 0x4
|
||||
+ .long .LCFI0-.LFB2
|
||||
+ .byte 0xe
|
||||
+ .uleb128 0x8
|
||||
+ .byte 0x85
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .long .LCFI1-.LCFI0
|
||||
+ .byte 0xd
|
||||
+ .uleb128 0x5
|
||||
+ .align 4
|
||||
+.LEFDE0:
|
||||
+ .text
|
||||
+.Letext0:
|
||||
+ .section .debug_loc,"",@progbits
|
||||
+.Ldebug_loc0:
|
||||
+.LLST0:
|
||||
+ .long .LFB2-.Ltext0
|
||||
+ .long .LCFI0-.Ltext0
|
||||
+ .value 0x2
|
||||
+ .byte 0x74
|
||||
+ .sleb128 4
|
||||
+ .long .LCFI0-.Ltext0
|
||||
+ .long .LCFI1-.Ltext0
|
||||
+ .value 0x2
|
||||
+ .byte 0x74
|
||||
+ .sleb128 8
|
||||
+ .long .LCFI1-.Ltext0
|
||||
+ .long .LFE2-.Ltext0
|
||||
+ .value 0x2
|
||||
+ .byte 0x75
|
||||
+ .sleb128 8
|
||||
+ .long 0x0
|
||||
+ .long 0x0
|
||||
+ .section .debug_info
|
||||
+ .long 0x94
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_abbrev0
|
||||
+ .byte 0x4
|
||||
+ .uleb128 0x1
|
||||
+ .long .LASF10
|
||||
+ .byte 0x1
|
||||
+ .long .LASF11
|
||||
+ .long .LASF12
|
||||
+ .long .Ltext0
|
||||
+ .long .Letext0
|
||||
+ .long .Ldebug_line0
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .byte 0x7
|
||||
+ .long .LASF0
|
||||
+ .uleb128 0x3
|
||||
+ .byte 0x4
|
||||
+ .byte 0x5
|
||||
+ .string "int"
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .byte 0x5
|
||||
+ .long .LASF1
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .byte 0x8
|
||||
+ .long .LASF2
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x2
|
||||
+ .byte 0x7
|
||||
+ .long .LASF3
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x4
|
||||
+ .byte 0x7
|
||||
+ .long .LASF4
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .byte 0x6
|
||||
+ .long .LASF5
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x2
|
||||
+ .byte 0x5
|
||||
+ .long .LASF6
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x8
|
||||
+ .byte 0x5
|
||||
+ .long .LASF7
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x8
|
||||
+ .byte 0x7
|
||||
+ .long .LASF8
|
||||
+ .uleb128 0x4
|
||||
+ .byte 0x4
|
||||
+ .byte 0x7
|
||||
+ .uleb128 0x2
|
||||
+ .byte 0x1
|
||||
+ .byte 0x6
|
||||
+ .long .LASF9
|
||||
+ .uleb128 0x5
|
||||
+ .byte 0x1
|
||||
+ .long .LASF13
|
||||
+ .byte 0x1
|
||||
+ .byte 0x5
|
||||
+ .byte 0x1
|
||||
+ .long .LFB2
|
||||
+ .long .LFE2
|
||||
+ .long .LLST0
|
||||
+ .uleb128 0x6
|
||||
+ .string "i"
|
||||
+ .byte 0x1
|
||||
+ .byte 0x6
|
||||
+ .long 0x2c
|
||||
+ .byte 0x2
|
||||
+ .byte 0x91
|
||||
+ .sleb128 -12
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .section .debug_abbrev
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x11
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x25
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x1b
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x11
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x12
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x10
|
||||
+ .uleb128 0x6
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0xe
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x4
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x5
|
||||
+ .uleb128 0x2e
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x3f
|
||||
+ .uleb128 0xc
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x27
|
||||
+ .uleb128 0xc
|
||||
+ .uleb128 0x11
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x12
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x40
|
||||
+ .uleb128 0x6
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x6
|
||||
+ .uleb128 0x34
|
||||
+ .byte 0x0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0xa
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .byte 0x0
|
||||
+ .section .debug_pubnames,"",@progbits
|
||||
+ .long 0x17
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_info0
|
||||
+ .long 0x98
|
||||
+ .long 0x75
|
||||
+ .string "func"
|
||||
+ .long 0x0
|
||||
+ .section .debug_aranges,"",@progbits
|
||||
+ .long 0x1c
|
||||
+ .value 0x2
|
||||
+ .long .Ldebug_info0
|
||||
+ .byte 0x4
|
||||
+ .byte 0x0
|
||||
+ .value 0x0
|
||||
+ .value 0x0
|
||||
+ .long .Ltext0
|
||||
+ .long .Letext0-.Ltext0
|
||||
+ .long 0x0
|
||||
+ .long 0x0
|
||||
+ .section .debug_str,"MS",@progbits,1
|
||||
+.LASF7:
|
||||
+ .string "long long int"
|
||||
+.LASF0:
|
||||
+ .string "unsigned int"
|
||||
+.LASF11:
|
||||
+ .string "dw2-loclist-prelinked.c"
|
||||
+.LASF12:
|
||||
+ .string "gdb-6.8/gdb/testsuite/gdb.dwarf2"
|
||||
+.LASF4:
|
||||
+ .string "long unsigned int"
|
||||
+.LASF8:
|
||||
+ .string "long long unsigned int"
|
||||
+.LASF2:
|
||||
+ .string "unsigned char"
|
||||
+.LASF9:
|
||||
+ .string "char"
|
||||
+.LASF1:
|
||||
+ .string "long int"
|
||||
+.LASF3:
|
||||
+ .string "short unsigned int"
|
||||
+.LASF5:
|
||||
+ .string "signed char"
|
||||
+.LASF10:
|
||||
+ .string "GNU C 4.3.2 20081007 (Red Hat 4.3.2-6)"
|
||||
+.LASF13:
|
||||
+ .string "func"
|
||||
+.LASF6:
|
||||
+ .string "short int"
|
||||
+ .ident "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)"
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* 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/>. */
|
||||
+
|
||||
+/* dw2-loclist-prelinked-func.S */
|
||||
+extern void func (void);
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ func ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
|
||||
@@ -0,0 +1,102 @@
|
||||
+# 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 2 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, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Minimal DWARF-2 unit test
|
||||
+
|
||||
+# This test can only be run on i386/x86_64 targets which support DWARF-2.
|
||||
+# For now pick a sampling of likely targets.
|
||||
+if {(![istarget *-*-linux*]
|
||||
+ && ![istarget *-*-gnu*]
|
||||
+ && ![istarget *-*-elf*]
|
||||
+ && ![istarget *-*-openbsd*])
|
||||
+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "dw2-loclist-prelinked"
|
||||
+set srcfuncfile ${testfile}-func.S
|
||||
+set binsharedfuncfile [standard_output_file ${testfile}.so]
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+remote_exec build "rm -f ${binfile}"
|
||||
+
|
||||
+# get the value of gcc_compiled
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# This test can only be run on gcc as we use additional_flags=FIXME
|
||||
+if {$gcc_compiled == 0} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfuncfile}" "${binsharedfuncfile}" {debug additional_flags=-m32}] != "" } {
|
||||
+ untested "Couldn't compile test library"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# The new separate debug info file will be stored in the .debug subdirectory.
|
||||
+
|
||||
+if [gdb_gnu_strip_debug ${binsharedfuncfile}] {
|
||||
+ # check that you have a recent version of strip and objcopy installed
|
||||
+ unsupported "cannot produce separate debug info files"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if {[catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${binsharedfuncfile}\""] != 0} {
|
||||
+ # Maybe we don't have prelink.
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" \
|
||||
+ "${binfile}" executable [list debug additional_flags=-m32 shlib=${binsharedfuncfile}]] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+gdb_run_cmd
|
||||
+
|
||||
+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
|
||||
+
|
||||
+# Incorrect:
|
||||
+# #0 0x00110430 in __kernel_vsyscall ()
|
||||
+# No symbol table info available.
|
||||
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #3 0x44f10437 in func () at dw2-loclist-prelinked.c:8
|
||||
+# i = Could not find the frame base for "func".
|
||||
+
|
||||
+# Correct:
|
||||
+# #0 0x00110430 in __kernel_vsyscall ()
|
||||
+# No symbol table info available.
|
||||
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
|
||||
+# No symbol table info available.
|
||||
+# #3 0x4ae36437 in func () at dw2-loclist-prelinked.c:8
|
||||
+# i = 3827288
|
||||
+# #4 0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c:24
|
||||
+# No locals.
|
||||
+
|
||||
+# `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()"
|
@ -16,7 +16,7 @@ on the debugger termination).
|
||||
diff --git a/gdb/defs.h b/gdb/defs.h
|
||||
--- a/gdb/defs.h
|
||||
+++ b/gdb/defs.h
|
||||
@@ -168,6 +168,10 @@ extern void default_quit_handler (void);
|
||||
@@ -177,6 +177,10 @@ extern void default_quit_handler (void);
|
||||
/* Flag that function quit should call quit_force. */
|
||||
extern volatile int sync_quit_force_run;
|
||||
|
||||
@ -30,24 +30,24 @@ diff --git a/gdb/defs.h b/gdb/defs.h
|
||||
diff --git a/gdb/extension.c b/gdb/extension.c
|
||||
--- a/gdb/extension.c
|
||||
+++ b/gdb/extension.c
|
||||
@@ -823,6 +823,11 @@ check_quit_flag (void)
|
||||
int i, result = 0;
|
||||
const struct extension_language_defn *extlang;
|
||||
@@ -769,6 +769,11 @@ check_quit_flag (void)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+ if (quit_flag_cleanup)
|
||||
+ return 0;
|
||||
+#endif
|
||||
+
|
||||
ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
|
||||
for (const struct extension_language_defn *extlang : extension_languages)
|
||||
{
|
||||
if (extlang->ops->check_quit_flag != NULL)
|
||||
if (extlang->ops != nullptr
|
||||
diff --git a/gdb/top.c b/gdb/top.c
|
||||
--- a/gdb/top.c
|
||||
+++ b/gdb/top.c
|
||||
@@ -1703,7 +1703,13 @@ quit_force (int *exit_arg, int from_tty)
|
||||
|
||||
qt.from_tty = from_tty;
|
||||
@@ -1770,7 +1770,13 @@ quit_force (int *exit_arg, int from_tty)
|
||||
else if (return_child_result)
|
||||
exit_code = return_child_result_value;
|
||||
|
||||
+#ifndef NEED_DETACH_SIGSTOP
|
||||
/* We want to handle any quit errors and exit regardless. */
|
||||
@ -62,7 +62,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
|
||||
@@ -102,6 +102,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
|
||||
@@ -103,6 +103,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
|
||||
|
||||
static bool debug_timestamp = false;
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:623cd2e188c7d4ccd31b14c0c2d92f8d6c85a9268d81118050a8de15745f9bee
|
||||
size 30228104
|
@ -1,34 +0,0 @@
|
||||
[AArch64] Fix erroneous use of spu architecture bfd
|
||||
|
||||
While investigating some SVE code, i noticed the use of two spu bfd variables.
|
||||
|
||||
This looks like an oversight, as the "id" field is available for non-spu
|
||||
architectures as well, even though its primary use was the Cell BE
|
||||
architecture.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-01-05 Luis Machado <luis.machado@linaro.org>
|
||||
|
||||
* aarch64-linux-nat.c
|
||||
(aarch64_linux_nat_target::thread_architecture): Use bfd_arch_aarch64
|
||||
and bfd_mach_aarch64.
|
||||
|
||||
---
|
||||
gdb/ChangeLog | 6 ++++++
|
||||
gdb/aarch64-linux-nat.c | 2 +-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
|
||||
index 62f5cdb1fc..4e712ebfb7 100644
|
||||
--- a/gdb/aarch64-linux-nat.c
|
||||
+++ b/gdb/aarch64-linux-nat.c
|
||||
@@ -970,7 +970,7 @@ aarch64_linux_nat_target::thread_architecture (ptid_t ptid)
|
||||
unavailable, to distinguish from an unset value of 0. */
|
||||
struct gdbarch_info info;
|
||||
gdbarch_info_init (&info);
|
||||
- info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu);
|
||||
+ info.bfd_arch_info = bfd_lookup_arch (bfd_arch_aarch64, bfd_mach_aarch64);
|
||||
info.id = (int *) (vq == 0 ? -1 : vq);
|
||||
return gdbarch_find_by_info (info);
|
||||
}
|
@ -8,12 +8,12 @@ Subject: gdb-archer-pie-addons-keep-disabled.patch
|
||||
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
--- a/gdb/breakpoint.c
|
||||
+++ b/gdb/breakpoint.c
|
||||
@@ -15396,6 +15396,51 @@ static struct cmd_list_element *enablebreaklist = NULL;
|
||||
@@ -15431,6 +15431,50 @@ static struct cmd_list_element *enablebreaklist = NULL;
|
||||
|
||||
cmd_list_element *commands_cmd_element = nullptr;
|
||||
|
||||
+void
|
||||
+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
|
||||
+breakpoints_relocate (struct objfile *objfile, section_offsets &delta)
|
||||
+{
|
||||
+ struct bp_location *bl, **blp_tmp;
|
||||
+ int changed = 0;
|
||||
@ -32,7 +32,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
+ CORE_ADDR relocated_address;
|
||||
+ CORE_ADDR delta_offset;
|
||||
+
|
||||
+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
|
||||
+ delta_offset = delta[osect->the_bfd_section->index];
|
||||
+ if (delta_offset == 0)
|
||||
+ continue;
|
||||
+ relocated_address = bl->address + delta_offset;
|
||||
@ -56,19 +56,18 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
|
||||
+ bp_location_is_less_than);
|
||||
+}
|
||||
+
|
||||
+void _initialize_breakpoint (void);
|
||||
void _initialize_breakpoint ();
|
||||
void
|
||||
_initialize_breakpoint (void)
|
||||
{
|
||||
_initialize_breakpoint ()
|
||||
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
|
||||
--- a/gdb/breakpoint.h
|
||||
+++ b/gdb/breakpoint.h
|
||||
@@ -1696,6 +1696,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
|
||||
@@ -1691,6 +1691,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);
|
||||
|
||||
+extern void breakpoints_relocate (struct objfile *objfile,
|
||||
+ struct section_offsets *delta);
|
||||
+ section_offsets &delta);
|
||||
+
|
||||
/* Print the specified breakpoint. */
|
||||
extern void print_breakpoint (breakpoint *bp);
|
||||
@ -76,7 +75,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
|
||||
@@ -816,6 +816,11 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
@@ -742,6 +742,11 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
obj_section_addr (s));
|
||||
}
|
||||
|
||||
@ -88,15 +87,3 @@ diff --git a/gdb/objfiles.c b/gdb/objfiles.c
|
||||
/* Data changed. */
|
||||
return 1;
|
||||
}
|
||||
diff --git a/gdb/value.c b/gdb/value.c
|
||||
--- a/gdb/value.c
|
||||
+++ b/gdb/value.c
|
||||
@@ -2840,7 +2840,7 @@ value_static_field (struct type *type, int fieldno)
|
||||
case FIELD_LOC_KIND_PHYSADDR:
|
||||
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
|
||||
TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
|
||||
- + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))]));
|
||||
+ + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
|
||||
break;
|
||||
case FIELD_LOC_KIND_PHYSNAME:
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ Subject: gdb-archer-pie-addons.patch
|
||||
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
--- a/gdb/gdbtypes.h
|
||||
+++ b/gdb/gdbtypes.h
|
||||
@@ -516,6 +516,7 @@ enum field_loc_kind
|
||||
@@ -649,6 +649,7 @@ enum field_loc_kind
|
||||
{
|
||||
FIELD_LOC_KIND_BITPOS, /**< bitpos */
|
||||
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
|
||||
@ -16,7 +16,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 */
|
||||
@@ -566,6 +567,7 @@ union field_location
|
||||
@@ -699,6 +700,7 @@ union field_location
|
||||
field. Otherwise, physname is the mangled label of the
|
||||
static field. */
|
||||
|
||||
@ -24,37 +24,13 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
CORE_ADDR physaddr;
|
||||
const char *physname;
|
||||
|
||||
@@ -1474,6 +1476,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)
|
||||
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
||||
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
|
||||
#define SET_FIELD_BITPOS(thisfld, bitpos) \
|
||||
@@ -1485,6 +1488,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))
|
||||
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
#define SET_FIELD_PHYSADDR(thisfld, addr) \
|
||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
|
||||
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
|
||||
@@ -1501,6 +1505,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))
|
||||
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
||||
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
|
||||
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
|
||||
diff --git a/gdb/value.c b/gdb/value.c
|
||||
--- a/gdb/value.c
|
||||
+++ b/gdb/value.c
|
||||
@@ -2839,7 +2839,8 @@ value_static_field (struct type *type, int fieldno)
|
||||
@@ -2850,7 +2850,8 @@ value_static_field (struct type *type, int fieldno)
|
||||
{
|
||||
case FIELD_LOC_KIND_PHYSADDR:
|
||||
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
|
||||
retval = value_at_lazy (type->field (fieldno).type (),
|
||||
- TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
|
||||
+ TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
|
||||
+ + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))]));
|
||||
|
@ -3689,7 +3689,7 @@ new file mode 100644
|
||||
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
|
||||
@@ -170,6 +170,11 @@ proc gdb_unload {} {
|
||||
@@ -224,6 +224,11 @@ proc gdb_unload {} {
|
||||
send_gdb "y\n" answer
|
||||
exp_continue
|
||||
}
|
||||
@ -3705,12 +3705,12 @@ diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
|
||||
--- a/gdb/testsuite/lib/pascal.exp
|
||||
+++ b/gdb/testsuite/lib/pascal.exp
|
||||
@@ -37,6 +37,9 @@ proc pascal_init {} {
|
||||
global pascal_compiler_is_fpc
|
||||
global gpc_compiler
|
||||
global fpc_compiler
|
||||
+ global fpcversion_major
|
||||
+ global fpcversion_minor
|
||||
+ global fpcversion_release
|
||||
gdb_persistent_global pascal_compiler_is_fpc
|
||||
gdb_persistent_global gpc_compiler
|
||||
gdb_persistent_global fpc_compiler
|
||||
+ gdb_persistent_global fpcversion_major
|
||||
+ gdb_persistent_global fpcversion_minor
|
||||
+ gdb_persistent_global fpcversion_release
|
||||
global env
|
||||
|
||||
if { $pascal_init_done == 1 } {
|
||||
|
@ -45,7 +45,7 @@ gdb/gdbserver/
|
||||
diff --git a/gdb/config.in b/gdb/config.in
|
||||
--- a/gdb/config.in
|
||||
+++ b/gdb/config.in
|
||||
@@ -251,6 +251,9 @@
|
||||
@@ -253,6 +253,9 @@
|
||||
/* Define if librpm library is being used. */
|
||||
#undef HAVE_LIBRPM
|
||||
|
||||
@ -55,7 +55,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
|
||||
|
||||
@@ -386,6 +389,9 @@
|
||||
@@ -388,6 +391,9 @@
|
||||
/* Define to 1 if you have the `scm_new_smob' function. */
|
||||
#undef HAVE_SCM_NEW_SMOB
|
||||
|
||||
@ -68,7 +68,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
|
||||
@@ -16434,6 +16434,64 @@ cat >>confdefs.h <<_ACEOF
|
||||
@@ -16861,6 +16861,64 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
@ -136,7 +136,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
|
||||
@@ -1964,6 +1964,10 @@ case $host_os in
|
||||
@@ -1900,6 +1900,10 @@ case $host_os in
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
|
||||
|
||||
@ -147,136 +147,10 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
dnl Handle optional features that can be enabled.
|
||||
|
||||
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
|
||||
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
|
||||
--- a/gdb/gdbserver/config.in
|
||||
+++ b/gdb/gdbserver/config.in
|
||||
@@ -125,6 +125,9 @@
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
+/* Define to 1 if you have the `selinux' library (-lselinux). */
|
||||
+#undef HAVE_LIBSELINUX
|
||||
+
|
||||
/* Define if the target supports branch tracing. */
|
||||
#undef HAVE_LINUX_BTRACE
|
||||
|
||||
@@ -210,6 +213,9 @@
|
||||
/* Define to 1 if you have the `pwrite' function. */
|
||||
#undef HAVE_PWRITE
|
||||
|
||||
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
|
||||
+#undef HAVE_SELINUX_SELINUX_H
|
||||
+
|
||||
/* Define to 1 if you have the `setns' function. */
|
||||
#undef HAVE_SETNS
|
||||
|
||||
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
|
||||
--- a/gdb/gdbserver/configure
|
||||
+++ b/gdb/gdbserver/configure
|
||||
@@ -9398,6 +9398,64 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+for ac_header in selinux/selinux.h
|
||||
+do :
|
||||
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_SELINUX_SELINUX_H 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+done
|
||||
+
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
|
||||
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
|
||||
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lselinux $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char security_get_boolean_active ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return security_get_boolean_active ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=yes
|
||||
+else
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
|
||||
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
|
||||
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSELINUX 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lselinux $LIBS"
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
|
||||
|
||||
|
||||
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
|
||||
--- a/gdb/gdbserver/configure.ac
|
||||
+++ b/gdb/gdbserver/configure.ac
|
||||
@@ -465,6 +465,10 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+dnl Check security_get_boolean_active availability.
|
||||
+AC_CHECK_HEADERS(selinux/selinux.h)
|
||||
+AC_CHECK_LIB(selinux, security_get_boolean_active)
|
||||
+
|
||||
AC_SUBST(GDBSERVER_DEPFILES)
|
||||
AC_SUBST(GDBSERVER_LIBS)
|
||||
AC_SUBST(srv_xmlbuiltin)
|
||||
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
|
||||
--- a/gdb/gdbserver/linux-low.c
|
||||
+++ b/gdb/gdbserver/linux-low.c
|
||||
@@ -968,7 +968,16 @@ linux_ptrace_fun ()
|
||||
{
|
||||
if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0,
|
||||
(PTRACE_TYPE_ARG4) 0) < 0)
|
||||
- trace_start_error_with_name ("ptrace");
|
||||
+ {
|
||||
+ int save_errno = errno;
|
||||
+
|
||||
+ std::string msg (linux_ptrace_create_warnings ());
|
||||
+
|
||||
+ msg += _("Cannot trace created process");
|
||||
+
|
||||
+ errno = save_errno;
|
||||
+ trace_start_error_with_name (msg.c_str ());
|
||||
+ }
|
||||
|
||||
if (setpgid (0, 0) < 0)
|
||||
trace_start_error_with_name ("setpgid");
|
||||
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
--- a/gdb/linux-nat.c
|
||||
+++ b/gdb/linux-nat.c
|
||||
@@ -1092,7 +1092,16 @@ linux_nat_target::create_inferior (const char *exec_file,
|
||||
@@ -1103,7 +1103,16 @@ linux_nat_target::create_inferior (const char *exec_file,
|
||||
/* Make sure we report all signals during startup. */
|
||||
pass_signals ({});
|
||||
|
||||
@ -354,3 +228,129 @@ 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);
|
||||
diff --git a/gdbserver/config.in b/gdbserver/config.in
|
||||
--- a/gdbserver/config.in
|
||||
+++ b/gdbserver/config.in
|
||||
@@ -143,6 +143,9 @@
|
||||
/* Define if you have the ipt library. */
|
||||
#undef HAVE_LIBIPT
|
||||
|
||||
+/* Define to 1 if you have the `selinux' library (-lselinux). */
|
||||
+#undef HAVE_LIBSELINUX
|
||||
+
|
||||
/* Define if the target supports branch tracing. */
|
||||
#undef HAVE_LINUX_BTRACE
|
||||
|
||||
@@ -249,6 +252,9 @@
|
||||
/* Define to 1 if you have the `sbrk' function. */
|
||||
#undef HAVE_SBRK
|
||||
|
||||
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
|
||||
+#undef HAVE_SELINUX_SELINUX_H
|
||||
+
|
||||
/* Define to 1 if you have the `setns' function. */
|
||||
#undef HAVE_SETNS
|
||||
|
||||
diff --git a/gdbserver/configure b/gdbserver/configure
|
||||
--- a/gdbserver/configure
|
||||
+++ b/gdbserver/configure
|
||||
@@ -10683,6 +10683,64 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+for ac_header in selinux/selinux.h
|
||||
+do :
|
||||
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_SELINUX_SELINUX_H 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+done
|
||||
+
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
|
||||
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
|
||||
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lselinux $LIBS"
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char security_get_boolean_active ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return security_get_boolean_active ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=yes
|
||||
+else
|
||||
+ ac_cv_lib_selinux_security_get_boolean_active=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
|
||||
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
|
||||
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define HAVE_LIBSELINUX 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ LIBS="-lselinux $LIBS"
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
|
||||
|
||||
|
||||
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
|
||||
--- a/gdbserver/configure.ac
|
||||
+++ b/gdbserver/configure.ac
|
||||
@@ -401,6 +401,10 @@ if $want_ipa ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+dnl Check security_get_boolean_active availability.
|
||||
+AC_CHECK_HEADERS(selinux/selinux.h)
|
||||
+AC_CHECK_LIB(selinux, security_get_boolean_active)
|
||||
+
|
||||
AC_SUBST(GDBSERVER_DEPFILES)
|
||||
AC_SUBST(GDBSERVER_LIBS)
|
||||
AC_SUBST(srv_xmlbuiltin)
|
||||
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
|
||||
--- a/gdbserver/linux-low.cc
|
||||
+++ b/gdbserver/linux-low.cc
|
||||
@@ -932,7 +932,16 @@ linux_ptrace_fun ()
|
||||
{
|
||||
if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0,
|
||||
(PTRACE_TYPE_ARG4) 0) < 0)
|
||||
- trace_start_error_with_name ("ptrace");
|
||||
+ {
|
||||
+ int save_errno = errno;
|
||||
+
|
||||
+ std::string msg (linux_ptrace_create_warnings ());
|
||||
+
|
||||
+ msg += _("Cannot trace created process");
|
||||
+
|
||||
+ errno = save_errno;
|
||||
+ trace_start_error_with_name (msg.c_str ());
|
||||
+ }
|
||||
|
||||
if (setpgid (0, 0) < 0)
|
||||
trace_start_error_with_name ("setpgid");
|
||||
|
@ -80,7 +80,7 @@ gdb/testsuite/ChangeLog
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -1148,7 +1148,10 @@ captured_main_1 (struct captured_main_args *context)
|
||||
@@ -1199,7 +1199,10 @@ captured_main_1 (struct captured_main_args *context)
|
||||
{
|
||||
ret = catch_command_errors (attach_command, pid_or_core_arg,
|
||||
!batch_flag);
|
||||
|
@ -1,130 +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-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
|
||||
current DWARF's point of view the is a function call which you skip by "next".
|
||||
|
||||
If you hide any /usr/lib/debug such as using:
|
||||
gdb -nx -ex 'set debug-file-directory /qwe' -ex 'file ./tpcommon_gfortran44'
|
||||
and use "step" command instead of "next" there it will work.
|
||||
(You need to hide debuginfo from libgomp as you would step into libgomp sources
|
||||
to maintain the threads for execution.)
|
||||
|
||||
There should be some DWARF extension for it, currently tried to detect
|
||||
substring ".omp_fn." as this function is called "MAIN__.omp_fn.0" and do not
|
||||
consider such sub-function as a skippable by "next".
|
||||
|
||||
Another problem is that with "set scheduler-locking" being "off" (default
|
||||
upstream) or "step" (default in F/RHEL) the simultaneous execution of the
|
||||
threads is inconvenient. Setting it to "on" will lockup the debugging as the
|
||||
threads need to get synchronized at some point. This is a more general
|
||||
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
|
||||
@@ -6453,6 +6453,16 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
|
||||
{
|
||||
+ struct symbol *stop_fn = find_pc_function (stop_pc);
|
||||
+ struct minimal_symbol *stopf = lookup_minimal_symbol_by_pc (stop_pc).minsym;
|
||||
+
|
||||
+ if ((stop_fn == NULL
|
||||
+ || strstr (stop_fn->linkage_name (), ".omp_fn.") == NULL)
|
||||
+ /* gcc-4.7.2-9.fc19.x86_64 uses a new format. */
|
||||
+ && (stopf == NULL
|
||||
+ || strstr (stopf->linkage_name (), "._omp_fn.") == NULL))
|
||||
+{ /* ".omp_fn." */
|
||||
+
|
||||
/* We're doing a "next".
|
||||
|
||||
Normal (forward) execution: set a breakpoint at the
|
||||
@@ -6486,6 +6496,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
keep_going (ecs);
|
||||
return;
|
||||
+} /* ".omp_fn." */
|
||||
}
|
||||
|
||||
/* If we are in a function call trampoline (a stub between the
|
||||
diff --git a/gdb/testsuite/gdb.fortran/omp-step.exp b/gdb/testsuite/gdb.fortran/omp-step.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.fortran/omp-step.exp
|
||||
@@ -0,0 +1,31 @@
|
||||
+# Copyright 2009 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 "omp-step"
|
||||
+set srcfile ${testfile}.f90
|
||||
+if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90 additional_flags=-fopenmp}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if ![runto [gdb_get_line_number "start-here"]] {
|
||||
+ perror "Couldn't run to start-here"
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+gdb_test "next" {!\$omp parallel} "step closer"
|
||||
+gdb_test "next" {a\(omp_get_thread_num\(\) \+ 1\) = 1} "step into omp"
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "success"]
|
||||
+gdb_continue_to_breakpoint "success" ".*success.*"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/omp-step.f90 b/gdb/testsuite/gdb.fortran/omp-step.f90
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.fortran/omp-step.f90
|
||||
@@ -0,0 +1,32 @@
|
||||
+! Copyright 2009 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/>.
|
||||
+
|
||||
+ use omp_lib
|
||||
+ integer nthreads, i, a(1000)
|
||||
+ nthreads = omp_get_num_threads()
|
||||
+ if (nthreads .gt. 1000) call abort
|
||||
+
|
||||
+ do i = 1, nthreads
|
||||
+ a(i) = 0
|
||||
+ end do
|
||||
+ print *, "start-here"
|
||||
+!$omp parallel
|
||||
+ a(omp_get_thread_num() + 1) = 1
|
||||
+!$omp end parallel
|
||||
+ do i = 1, nthreads
|
||||
+ if (a(i) .ne. 1) call abort
|
||||
+ end do
|
||||
+ print *, "success"
|
||||
+ end
|
56
gdb-config.patch
Normal file
56
gdb-config.patch
Normal file
@ -0,0 +1,56 @@
|
||||
diff -Nrup a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4
|
||||
--- a/gnulib/import/m4/alloca.m4 2019-11-18 18:49:20.000000000 -0700
|
||||
+++ b/gnulib/import/m4/alloca.m4 2020-01-11 01:07:36.200483085 -0700
|
||||
@@ -89,7 +89,7 @@ AC_CACHE_CHECK([stack direction for C al
|
||||
[ac_cv_c_stack_direction],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
-int
|
||||
+__attribute__ (noinline,noclone)) int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
int dir, dummy = 0;
|
||||
diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
|
||||
--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700
|
||||
+++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700
|
||||
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
|
||||
-[AC_TRY_RUN([find_stack_direction ()
|
||||
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
|
||||
{
|
||||
static char *addr = 0;
|
||||
auto char dummy;
|
||||
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
|
||||
index 55dddcf1..ba906efc 100644
|
||||
--- a/config/intdiv0.m4
|
||||
+++ b/config/intdiv0.m4
|
||||
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
|
||||
exit (sig != SIGFPE);
|
||||
}
|
||||
|
||||
-int x = 1;
|
||||
-int y = 0;
|
||||
-int z;
|
||||
-int nan;
|
||||
+volatile int x = 1;
|
||||
+volatile int y = 0;
|
||||
+volatile int z;
|
||||
+volatile int nan;
|
||||
|
||||
int main ()
|
||||
{
|
||||
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
|
||||
index f1ce7601..fc20d228 100644
|
||||
--- a/libiberty/configure.ac
|
||||
+++ b/libiberty/configure.ac
|
||||
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
|
||||
for v in $vars; do
|
||||
AC_MSG_CHECKING([for $v])
|
||||
AC_CACHE_VAL(libiberty_cv_var_$v,
|
||||
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
|
||||
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
|
||||
[eval "libiberty_cv_var_$v=yes"],
|
||||
[eval "libiberty_cv_var_$v=no"])])
|
||||
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
|
@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -13916,7 +13916,17 @@ remote_target::pid_to_exec_file (int pid)
|
||||
@@ -14031,7 +14031,17 @@ remote_target::pid_to_exec_file (int pid)
|
||||
char *annex = NULL;
|
||||
|
||||
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
|
||||
@ -26,5 +26,5 @@ diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
inf = find_inferior_pid (pid);
|
||||
inferior *inf = find_inferior_pid (this, pid);
|
||||
if (inf == NULL)
|
||||
|
@ -0,0 +1,69 @@
|
||||
[gdb] Don't return non-existing path in debuginfod_source_query
|
||||
|
||||
When setting env var DEBUGINFOD_URLS to " " and running the testsuite, we run
|
||||
into these regressions:
|
||||
...
|
||||
FAIL: gdb.base/list-missing-source.exp: info source
|
||||
FAIL: gdb.base/source-dir.exp: info source before setting directory search list
|
||||
...
|
||||
|
||||
Setting var DEBUGINFOD_URLS to " " allows the debuginfod query function
|
||||
debuginfod_source_query to get past its early exit.
|
||||
|
||||
The function debuginfod_source_query is documented as: "If the file is
|
||||
successfully retrieved, its path on the local machine is stored in DESTNAME".
|
||||
|
||||
However, in case we get back -ENOENT from libdebuginfod, we still set
|
||||
DESTNAME:
|
||||
....
|
||||
if (fd.get () < 0 && fd.get () != -ENOENT)
|
||||
printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"),
|
||||
safe_strerror (-fd.get ()),
|
||||
styled_string (file_name_style.style (), srcpath));
|
||||
else
|
||||
*destname = make_unique_xstrdup (srcpath);
|
||||
|
||||
return fd;
|
||||
...
|
||||
|
||||
Fix this by making debuginfod_source_query fit it's documentation and only
|
||||
setting DESTNAME when successfully retrieving a file. Likewise in
|
||||
debuginfod_debuginfo_query.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-11-16 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* debuginfod-support.c (debuginfod_source_query)
|
||||
(debuginfod_debuginfo_query): Only set DESTNAME if successful.
|
||||
|
||||
---
|
||||
gdb/debuginfod-support.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
|
||||
index 0dc88c2c2a1..1282fc0e9da 100644
|
||||
--- a/gdb/debuginfod-support.c
|
||||
+++ b/gdb/debuginfod-support.c
|
||||
@@ -120,7 +120,8 @@ debuginfod_source_query (const unsigned char *build_id,
|
||||
printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"),
|
||||
safe_strerror (-fd.get ()),
|
||||
styled_string (file_name_style.style (), srcpath));
|
||||
- else
|
||||
+
|
||||
+ if (fd.get () >= 0)
|
||||
destname->reset (xstrdup (srcpath));
|
||||
|
||||
debuginfod_end (c);
|
||||
@@ -154,8 +155,10 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
|
||||
safe_strerror (-fd.get ()),
|
||||
styled_string (file_name_style.style (), filename));
|
||||
|
||||
- destname->reset (dname);
|
||||
+ if (fd.get () >= 0)
|
||||
+ destname->reset (dname);
|
||||
debuginfod_end (c);
|
||||
+
|
||||
return fd;
|
||||
}
|
||||
#endif
|
@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -9375,6 +9375,7 @@ if test x"$prefer_curses" = xyes; then
|
||||
@@ -9649,6 +9649,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 +20,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 :
|
||||
@@ -9399,7 +9400,7 @@ return waddstr ();
|
||||
@@ -9673,7 +9674,7 @@ return waddstr ();
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
@@ -9473,6 +9474,7 @@ case $host_os in
|
||||
@@ -9747,6 +9748,7 @@ case $host_os in
|
||||
esac
|
||||
|
||||
# These are the libraries checked by Readline.
|
||||
@ -37,7 +37,7 @@ 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 :
|
||||
@@ -9497,7 +9499,7 @@ return tgetent ();
|
||||
@@ -9771,7 +9773,7 @@ return tgetent ();
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
@ -49,7 +49,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
|
||||
@@ -717,7 +717,8 @@ if test x"$prefer_curses" = xyes; then
|
||||
@@ -712,7 +712,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,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
|
||||
if test "$ac_cv_search_waddstr" != no; then
|
||||
curses_found=yes
|
||||
@@ -759,7 +760,8 @@ case $host_os in
|
||||
@@ -754,7 +755,8 @@ case $host_os in
|
||||
esac
|
||||
|
||||
# These are the libraries checked by Readline.
|
||||
|
24
gdb-fix-assert-in-process-event-stop-test.patch
Normal file
24
gdb-fix-assert-in-process-event-stop-test.patch
Normal file
@ -0,0 +1,24 @@
|
||||
Fix assert in process_event_stop_test
|
||||
|
||||
Fixes PR26881 - "infrun.c:6384: internal-error: void
|
||||
process_event_stop_test(execution_control_state*): Assertion
|
||||
`ecs->event_thread->control.exception_resume_breakpoint != NULL' failed".
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=26881
|
||||
|
||||
---
|
||||
gdb/infrun.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
index 4c2e1f56d24..6000c58c142 100644
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -6431,6 +6431,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
else
|
||||
{
|
||||
/* Case 3. */
|
||||
+ ecs->event_thread->stepping_over_breakpoint = 1;
|
||||
keep_going (ecs);
|
||||
return;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
Fix odr error
|
||||
|
||||
---
|
||||
gdb/gdbserver/ax.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
|
||||
index 213db410a0..42d28128fa 100644
|
||||
--- a/gdb/gdbserver/ax.c
|
||||
+++ b/gdb/gdbserver/ax.c
|
||||
@@ -25,7 +25,7 @@
|
||||
static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
|
||||
|
||||
#ifdef IN_PROCESS_AGENT
|
||||
-int debug_agent = 0;
|
||||
+bool debug_agent = 0;
|
||||
#endif
|
||||
|
||||
static void
|
27
gdb-fix-filename-in-not-in-executable-format-error.patch
Normal file
27
gdb-fix-filename-in-not-in-executable-format-error.patch
Normal file
@ -0,0 +1,27 @@
|
||||
diff --git a/gdb/exec.c b/gdb/exec.c
|
||||
index 676f3dc3f7d..7693236019b 100644
|
||||
--- a/gdb/exec.c
|
||||
+++ b/gdb/exec.c
|
||||
@@ -482,9 +482,8 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
|
||||
if (!exec_bfd)
|
||||
{
|
||||
- error (_("\"%ps\": could not open as an executable file: %s."),
|
||||
- styled_string (file_name_style.style (), scratch_pathname),
|
||||
- bfd_errmsg (bfd_get_error ()));
|
||||
+ error (_("\"%s\": could not open as an executable file: %s."),
|
||||
+ scratch_pathname, bfd_errmsg (bfd_get_error ()));
|
||||
}
|
||||
|
||||
/* gdb_realpath_keepfile resolves symlinks on the local
|
||||
@@ -515,8 +514,8 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
"Please specify an executable to debug."),
|
||||
scratch_pathname);
|
||||
else
|
||||
- error (_("\"%ps\": not in executable format: %s"),
|
||||
- styled_string (file_name_style.style (), scratch_pathname),
|
||||
+ error (_("\"%s\": not in executable format: %s"),
|
||||
+ scratch_pathname,
|
||||
gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
}
|
||||
|
@ -1,216 +0,0 @@
|
||||
Fix Python3.9 related runtime problems
|
||||
|
||||
Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support
|
||||
can be built using the configure switch -with-python=/usr/bin/python3.9.
|
||||
|
||||
Attempting to run gdb/Python3.9 segfaults on startup:
|
||||
|
||||
#0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
|
||||
#1 0x000000000069ccbf in do_start_initialization ()
|
||||
at worktree-test1/gdb/python/python.c:1789
|
||||
#2 _initialize_python ()
|
||||
at worktree-test1/gdb/python/python.c:1877
|
||||
#3 0x00000000007afb0a in initialize_all_files () at init.c:237
|
||||
...
|
||||
|
||||
Consulting the the documentation...
|
||||
|
||||
https://docs.python.org/3/c-api/init.html
|
||||
|
||||
...we find that PyEval_ReleaseLock() has been deprecated since version
|
||||
3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread()
|
||||
instead. In do_start_initialization, in gdb/python/python.c, we
|
||||
can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock()
|
||||
with a single call to PyEval_SaveThread. (Thanks to Keith Seitz
|
||||
for working this out.)
|
||||
|
||||
With that in place, GDB gets a little bit further. It still dies
|
||||
on startup, but the backtrace is different:
|
||||
|
||||
#0 0x00007ffff7b04306 in PyOS_InterruptOccurred ()
|
||||
from /lib64/libpython3.9.so.1.0
|
||||
#1 0x0000000000576e86 in check_quit_flag ()
|
||||
at worktree-test1/gdb/extension.c:776
|
||||
#2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 <extension_language_python>)
|
||||
at worktree-test1/gdb/extension.c:705
|
||||
#3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0,
|
||||
gdbarch=0x0, language=0x0)
|
||||
at worktree-test1/gdb/python/python.c:211
|
||||
#4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10)
|
||||
at worktree-test1/gdb/python/py-inferior.c:251
|
||||
#5 0x00000000005d9fb9 in std::function<void (inferior*)>::operator()(inferior*) const (__args#0=<optimized out>, this=0xccad20)
|
||||
at /usr/include/c++/10/bits/std_function.h:617
|
||||
#6 gdb::observers::observable<inferior*>::notify (args#0=0xddeb10,
|
||||
this=<optimized out>)
|
||||
at worktree-test1/gdb/../gdbsupport/observable.h:106
|
||||
#7 add_inferior_silent (pid=0)
|
||||
at worktree-test1/gdb/inferior.c:113
|
||||
#8 0x00000000005dbcb8 in initialize_inferiors ()
|
||||
at worktree-test1/gdb/inferior.c:947
|
||||
...
|
||||
|
||||
We checked with some Python Developers and were told that we should
|
||||
acquire the GIL prior to calling any Python C API function. We
|
||||
definitely don't have the GIL for calls of PyOS_InterruptOccurred().
|
||||
|
||||
I moved class_gdbpy_gil earlier in the file and use it in
|
||||
gdbpy_check_quit_flag() to acquire (and automatically release) the
|
||||
GIL.
|
||||
|
||||
With those changes in place, I was able to run to a GDB prompt. But,
|
||||
when trying to quit, it segfaulted again due to due to some other
|
||||
problems with gdbpy_check_quit_flag():
|
||||
|
||||
Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
|
||||
0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
|
||||
(top-gdb) bt 8
|
||||
#0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
|
||||
#1 0x00007ffff7afa5ea in PyGILState_Ensure.cold ()
|
||||
from /lib64/libpython3.9.so.1.0
|
||||
#2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>)
|
||||
at worktree-test1/gdb/python/python.c:278
|
||||
#3 gdbpy_check_quit_flag (extlang=<optimized out>)
|
||||
at worktree-test1/gdb/python/python.c:278
|
||||
#4 0x0000000000576e96 in check_quit_flag ()
|
||||
at worktree-test1/gdb/extension.c:776
|
||||
#5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050)
|
||||
at worktree-test1/gdb/extension.c:729
|
||||
#6 0x000000000088913a in do_my_cleanups (
|
||||
pmy_chain=0xc31870 <final_cleanup_chain>,
|
||||
old_chain=0xae5720 <sentinel_cleanup>)
|
||||
at worktree-test1/gdbsupport/cleanups.cc:131
|
||||
#7 do_final_cleanups ()
|
||||
at worktree-test1/gdbsupport/cleanups.cc:143
|
||||
|
||||
In this case, we're trying to call a Python C API function after
|
||||
Py_Finalize() has been called from finalize_python(). I made
|
||||
finalize_python set gdb_python_initialized to false and then cause
|
||||
check_quit_flag() to return early when it's false.
|
||||
|
||||
With these changes in place, GDB seems to be working again with
|
||||
Python3.9b1. I think it likely that there are other problems lurking.
|
||||
I wouldn't be surprised to find that there are other calls into Python
|
||||
where we don't first make sure that we have the GIL. Further changes
|
||||
may well be needed.
|
||||
|
||||
I see no regressions testing on Rawhide using a GDB built with the
|
||||
default Python version (3.8.3) versus one built using Python 3.9b1.
|
||||
|
||||
I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using
|
||||
the default (though updated) system installed versions of Python on
|
||||
those OSes. This means that I've tested against Python versions
|
||||
2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB
|
||||
still builds without problem and shows no regressions after applying
|
||||
this patch.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-MM-DD Kevin Buettner <kevinb@redhat.com>
|
||||
Keith Seitz <keiths@redhat.com>
|
||||
|
||||
* python/python.c (do_start_initialization): For Python 3.9 and
|
||||
later, call PyEval_SaveThread instead of PyEval_ReleaseLock.
|
||||
(class gdbpy_gil): Move to earlier in file.
|
||||
(finalize_python): Set gdb_python_initialized.
|
||||
(gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early
|
||||
when not initialized.
|
||||
|
||||
---
|
||||
gdb/python/python.c | 56 ++++++++++++++++++++++++++++-------------------------
|
||||
2 files changed, 40 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
index 67f362b852..4bdd2201ab 100644
|
||||
--- a/gdb/python/python.c
|
||||
+++ b/gdb/python/python.c
|
||||
@@ -238,6 +238,30 @@ gdbpy_enter::~gdbpy_enter ()
|
||||
PyGILState_Release (m_state);
|
||||
}
|
||||
|
||||
+/* A helper class to save and restore the GIL, but without touching
|
||||
+ the other globals that are handled by gdbpy_enter. */
|
||||
+
|
||||
+class gdbpy_gil
|
||||
+{
|
||||
+public:
|
||||
+
|
||||
+ gdbpy_gil ()
|
||||
+ : m_state (PyGILState_Ensure ())
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ ~gdbpy_gil ()
|
||||
+ {
|
||||
+ PyGILState_Release (m_state);
|
||||
+ }
|
||||
+
|
||||
+ DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
|
||||
+
|
||||
+private:
|
||||
+
|
||||
+ PyGILState_STATE m_state;
|
||||
+};
|
||||
+
|
||||
/* Set the quit flag. */
|
||||
|
||||
static void
|
||||
@@ -251,6 +275,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang)
|
||||
static int
|
||||
gdbpy_check_quit_flag (const struct extension_language_defn *extlang)
|
||||
{
|
||||
+ if (!gdb_python_initialized)
|
||||
+ return 0;
|
||||
+
|
||||
+ gdbpy_gil gil;
|
||||
return PyOS_InterruptOccurred ();
|
||||
}
|
||||
|
||||
@@ -943,30 +971,6 @@ gdbpy_source_script (const struct extension_language_defn *extlang,
|
||||
|
||||
/* Posting and handling events. */
|
||||
|
||||
-/* A helper class to save and restore the GIL, but without touching
|
||||
- the other globals that are handled by gdbpy_enter. */
|
||||
-
|
||||
-class gdbpy_gil
|
||||
-{
|
||||
-public:
|
||||
-
|
||||
- gdbpy_gil ()
|
||||
- : m_state (PyGILState_Ensure ())
|
||||
- {
|
||||
- }
|
||||
-
|
||||
- ~gdbpy_gil ()
|
||||
- {
|
||||
- PyGILState_Release (m_state);
|
||||
- }
|
||||
-
|
||||
- DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
|
||||
-
|
||||
-private:
|
||||
-
|
||||
- PyGILState_STATE m_state;
|
||||
-};
|
||||
-
|
||||
/* A single event. */
|
||||
struct gdbpy_event
|
||||
{
|
||||
@@ -1616,6 +1620,7 @@ finalize_python (void *ignore)
|
||||
|
||||
Py_Finalize ();
|
||||
|
||||
+ gdb_python_initialized = false;
|
||||
restore_active_ext_lang (previous_active);
|
||||
}
|
||||
|
||||
@@ -1785,8 +1790,7 @@ do_start_initialization ()
|
||||
return false;
|
||||
|
||||
/* Release the GIL while gdb runs. */
|
||||
- PyThreadState_Swap (NULL);
|
||||
- PyEval_ReleaseLock ();
|
||||
+ PyEval_SaveThread ();
|
||||
|
||||
make_final_cleanup (finalize_python, NULL);
|
||||
|
@ -1,132 +0,0 @@
|
||||
[gdb] Fix range loop index in find_method
|
||||
|
||||
With target board debug-types, we have:
|
||||
...
|
||||
FAIL: gdb.cp/cpexprs.exp: list policy1::function
|
||||
...
|
||||
|
||||
This is a regression triggered by commit 770479f223e "gdb: Fix toplevel types
|
||||
with -fdebug-types-section".
|
||||
|
||||
However, the FAIL is caused by commit 4dedf84da98 "Change
|
||||
decode_compound_collector to use std::vector" which changes a VEC_iterate loop
|
||||
into a range loop:
|
||||
...
|
||||
- for (ix = 0; VEC_iterate (symbolp, sym_classes, ix, sym); ++ix)
|
||||
+ unsigned int ix = 0;
|
||||
+ for (const auto &sym : *sym_classes)
|
||||
...
|
||||
but fails to ensure that the increment of ix happens every iteration.
|
||||
|
||||
Fix this by calculating the index variable at the start of the loop body:
|
||||
...
|
||||
for (const auto &elt : *sym_classes)
|
||||
{
|
||||
unsigned int ix = &elt - &*sym_classes->begin ();
|
||||
...
|
||||
|
||||
Tested on x86_64-linux, with native and target board debug-types.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-04-29 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
PR symtab/25889
|
||||
* linespec.c (find_method): Fix ix calculation.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-04-29 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
PR symtab/25889
|
||||
* gdb.cp/cpexprs.exp: Adapt for inclusion.
|
||||
* gdb.cp/cpexprs-debug-types.exp: New file. Set -fdebug-types-section
|
||||
and include cpexprs.exp.
|
||||
|
||||
---
|
||||
gdb/linespec.c | 3 +--
|
||||
gdb/testsuite/gdb.cp/cpexprs-debug-types.exp | 20 ++++++++++++++++++++
|
||||
gdb/testsuite/gdb.cp/cpexprs.exp | 14 ++++++++++++--
|
||||
5 files changed, 45 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: gdb-9.1/gdb/linespec.c
|
||||
===================================================================
|
||||
--- gdb-9.1.orig/gdb/linespec.c
|
||||
+++ gdb-9.1/gdb/linespec.c
|
||||
@@ -3670,12 +3670,12 @@ find_method (struct linespec_state *self
|
||||
because we collect data across the program space before deciding
|
||||
what to do. */
|
||||
last_result_len = 0;
|
||||
- unsigned int ix = 0;
|
||||
for (const auto &elt : *sym_classes)
|
||||
{
|
||||
struct type *t;
|
||||
struct program_space *pspace;
|
||||
struct symbol *sym = elt.symbol;
|
||||
+ unsigned int ix = &elt - &*sym_classes->begin ();
|
||||
|
||||
/* Program spaces that are executing startup should have
|
||||
been filtered out earlier. */
|
||||
@@ -3706,7 +3706,6 @@ find_method (struct linespec_state *self
|
||||
|
||||
superclass_vec.clear ();
|
||||
last_result_len = result_names.size ();
|
||||
- ++ix;
|
||||
}
|
||||
}
|
||||
|
||||
Index: gdb-9.1/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ gdb-9.1/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
|
||||
@@ -0,0 +1,20 @@
|
||||
+# Copyright 2020 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/>.
|
||||
+
|
||||
+# This file is part of the gdb testsuite.
|
||||
+
|
||||
+# Run cpexprs.exp with -fdebug-types-section.
|
||||
+set flags {additional_flags=-fdebug-types-section}
|
||||
+source $srcdir/$subdir/cpexprs.exp
|
||||
Index: gdb-9.1/gdb/testsuite/gdb.cp/cpexprs.exp
|
||||
===================================================================
|
||||
--- gdb-9.1.orig/gdb/testsuite/gdb.cp/cpexprs.exp
|
||||
+++ gdb-9.1/gdb/testsuite/gdb.cp/cpexprs.exp
|
||||
@@ -685,13 +685,23 @@ if {[skip_cplus_tests]} { continue }
|
||||
# test running programs
|
||||
#
|
||||
|
||||
-standard_testfile .cc
|
||||
+standard_testfile cpexprs.cc
|
||||
|
||||
if {[get_compiler_info "c++"]} {
|
||||
return -1
|
||||
}
|
||||
|
||||
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
|
||||
+if { [info exists flags] } {
|
||||
+ # Already set externally.
|
||||
+} else {
|
||||
+ # Initialize to empty.
|
||||
+ set flags {}
|
||||
+}
|
||||
+
|
||||
+# Include required flags.
|
||||
+set flags "$flags debug c++"
|
||||
+
|
||||
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile "$flags"]} {
|
||||
return -1
|
||||
}
|
||||
|
105
gdb-fix-section-matching-in-find_pc_sect_compunit.patch
Normal file
105
gdb-fix-section-matching-in-find_pc_sect_compunit.patch
Normal file
@ -0,0 +1,105 @@
|
||||
[gdb/testsuite] Fix section matching in find_pc_sect_compunit_symtab
|
||||
|
||||
When running test-case gdb.base/list-ambiguous.exp with target board readnow,
|
||||
we run into:
|
||||
...
|
||||
FAIL: gdb.base/list-ambiguous.exp: list ambiguous_fun
|
||||
...
|
||||
|
||||
The test-case contains two static functions ambiguous_fun, one in
|
||||
list-ambiguous0.c and one in list-ambiguous1.c.
|
||||
|
||||
The list command is supposed to show both, but only the one from
|
||||
list-ambiguous0.c is shown.
|
||||
|
||||
This is due to the section check in find_pc_sect_compunit_symtab. It checks
|
||||
whether the candidate compunit_symtab contains a symbol that has the required
|
||||
section. This check is only done for GLOBAL_BLOCK symbols.
|
||||
|
||||
The check succeeds for the compunit_symtab for list-ambiguous0.c, because it
|
||||
contains main, but it fails for list-ambiguous0.c because it has no global
|
||||
symbols.
|
||||
|
||||
Fix this by extending the section check to STATIC_BLOCK symbols.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-10-27 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* symtab.c (find_pc_sect_compunit_symtab): Include STATIC_BLOCK
|
||||
symbols in section check.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-10-27 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.base/list-ambiguous-readnow.exp: New file.
|
||||
---
|
||||
gdb/symtab.c | 18 ++++++++++-----
|
||||
.../gdb.base/list-ambiguous-readnow.exp | 22 +++++++++++++++++++
|
||||
4 files changed, 43 insertions(+), 6 deletions(-)
|
||||
create mode 100644 gdb/testsuite/gdb.base/list-ambiguous-readnow.exp
|
||||
|
||||
diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
index eda33a7eb4f..f6e24758009 100644
|
||||
--- a/gdb/symtab.c
|
||||
+++ b/gdb/symtab.c
|
||||
@@ -2954,13 +2954,19 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
||||
struct symbol *sym = NULL;
|
||||
struct block_iterator iter;
|
||||
|
||||
- ALL_BLOCK_SYMBOLS (global_block, iter, sym)
|
||||
+ for (int b_index = GLOBAL_BLOCK;
|
||||
+ b_index <= STATIC_BLOCK && sym == NULL;
|
||||
+ ++b_index)
|
||||
{
|
||||
- fixup_symbol_section (sym, obj_file);
|
||||
- if (matching_obj_sections (SYMBOL_OBJ_SECTION (obj_file,
|
||||
- sym),
|
||||
- section))
|
||||
- break;
|
||||
+ const struct block *b = BLOCKVECTOR_BLOCK (bv, b_index);
|
||||
+ ALL_BLOCK_SYMBOLS (b, iter, sym)
|
||||
+ {
|
||||
+ fixup_symbol_section (sym, obj_file);
|
||||
+ if (matching_obj_sections (SYMBOL_OBJ_SECTION (obj_file,
|
||||
+ sym),
|
||||
+ section))
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
if (sym == NULL)
|
||||
continue; /* No symbol in this symtab matches
|
||||
diff --git a/gdb/testsuite/gdb.base/list-ambiguous-readnow.exp b/gdb/testsuite/gdb.base/list-ambiguous-readnow.exp
|
||||
new file mode 100644
|
||||
index 00000000000..347a71ba52a
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/list-ambiguous-readnow.exp
|
||||
@@ -0,0 +1,22 @@
|
||||
+# Copyright 2020 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/>.
|
||||
+
|
||||
+# Run list-ambiguous.exp with -readnow.
|
||||
+
|
||||
+save_vars { GDBFLAGS } {
|
||||
+ append GDBFLAGS " -readnow"
|
||||
+
|
||||
+ source $srcdir/$subdir/list-ambiguous.exp
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
54
gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch
Normal file
54
gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch
Normal file
@ -0,0 +1,54 @@
|
||||
Fix selftest FAILs with gdb build with -O2 -flto
|
||||
|
||||
---
|
||||
gdb/complaints.h | 5 +++--
|
||||
gdb/main.c | 5 +++++
|
||||
gdb/testsuite/gdb.gdb/selftest.exp | 2 +-
|
||||
3 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gdb/complaints.h b/gdb/complaints.h
|
||||
index 6ad056d257..cac09ff573 100644
|
||||
--- a/gdb/complaints.h
|
||||
+++ b/gdb/complaints.h
|
||||
@@ -42,9 +42,10 @@ extern int stop_whining;
|
||||
while (0)
|
||||
|
||||
/* Clear out / initialize all complaint counters that have ever been
|
||||
- incremented. */
|
||||
+ incremented. Prevent inlining this function for the benefit of GDB's
|
||||
+ selftests in the testsuite. */
|
||||
|
||||
-extern void clear_complaints ();
|
||||
+extern void clear_complaints () __attribute__((noinline));
|
||||
|
||||
|
||||
#endif /* !defined (COMPLAINTS_H) */
|
||||
diff --git a/gdb/main.c b/gdb/main.c
|
||||
index 19bbb92388..9d35f9baa8 100644
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -1235,6 +1235,11 @@ captured_main_1 (struct captured_main_args *context)
|
||||
}
|
||||
}
|
||||
|
||||
+/* Prevent inlining this function for the benefit of GDB's selftests in the
|
||||
+ testsuite. */
|
||||
+
|
||||
+static void captured_main (void *data) __attribute__((noinline));
|
||||
+
|
||||
static void
|
||||
captured_main (void *data)
|
||||
{
|
||||
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
index 43043e58ea..992d79f5cf 100644
|
||||
--- a/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
@@ -143,7 +143,7 @@ proc test_with_self { } {
|
||||
setup_xfail "i*86-pc-linuxaout-gnu"
|
||||
set description "backtrace through signal handler"
|
||||
gdb_test_multiple "backtrace" "$description" {
|
||||
- -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
|
||||
+ -re "#0.*(read|poll).* main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
Fix the thread-pool.c compilation
|
||||
|
||||
A recent commit removed DIAGNOSTIC_IGNORE_UNUSED_FUNCTION, which was
|
||||
used in thread-pool.c. This patch changes this code to use
|
||||
ATTRIBUTE_UNUSED instead.
|
||||
|
||||
Tested by rebuilding.
|
||||
|
||||
gdb/ChangeLog
|
||||
2019-12-12 Tom Tromey <tromey@adacore.com>
|
||||
|
||||
* gdbsupport/thread-pool.c (set_thread_name): Use
|
||||
ATTRIBUTE_UNUSED.
|
||||
|
||||
Change-Id: I56d46eaac73690565d0e52db1791411567a918dd
|
||||
|
||||
---
|
||||
gdb/ChangeLog | 5 +++++
|
||||
gdb/gdbsupport/thread-pool.c | 10 ++--------
|
||||
2 files changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gdb/gdbsupport/thread-pool.c b/gdb/gdbsupport/thread-pool.c
|
||||
index 1b3e44c670..fc83ff765f 100644
|
||||
--- a/gdb/gdbsupport/thread-pool.c
|
||||
+++ b/gdb/gdbsupport/thread-pool.c
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "gdbsupport/alt-stack.h"
|
||||
#include "gdbsupport/block-signals.h"
|
||||
#include <algorithm>
|
||||
-#include "diagnostics.h"
|
||||
|
||||
/* On the off chance that we have the pthread library on a Windows
|
||||
host, but std::thread is not using it, avoid calling
|
||||
@@ -40,14 +39,11 @@
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
-DIAGNOSTIC_PUSH
|
||||
-DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
|
||||
-
|
||||
/* Handle platform discrepancies in pthread_setname_np: macOS uses a
|
||||
single-argument form, while Linux uses a two-argument form. This
|
||||
wrapper handles the difference. */
|
||||
|
||||
-static void
|
||||
+ATTRIBUTE_UNUSED static void
|
||||
set_thread_name (int (*set_name) (pthread_t, const char *), const char *name)
|
||||
{
|
||||
set_name (pthread_self (), name);
|
||||
@@ -55,14 +51,12 @@ set_thread_name (int (*set_name) (pthread_t, const char *), const char *name)
|
||||
|
||||
/* The macOS man page says that pthread_setname_np returns "void", but
|
||||
the headers actually declare it returning "int". */
|
||||
-static void
|
||||
+ATTRIBUTE_UNUSED static void
|
||||
set_thread_name (int (*set_name) (const char *), const char *name)
|
||||
{
|
||||
set_name (name);
|
||||
}
|
||||
|
||||
-DIAGNOSTIC_POP
|
||||
-
|
||||
#endif /* USE_PTHREAD_SETNAME_NP */
|
||||
|
||||
namespace gdb
|
@ -1,87 +0,0 @@
|
||||
Index: gdb-9.1/gdb/dwarf2read.c
|
||||
===================================================================
|
||||
--- gdb-9.1.orig/gdb/dwarf2read.c
|
||||
+++ gdb-9.1/gdb/dwarf2read.c
|
||||
@@ -11759,6 +11759,7 @@ dwarf2_cu::setup_type_unit_groups (struc
|
||||
COMPUNIT_DIRNAME (cust),
|
||||
compunit_language (cust),
|
||||
0, cust));
|
||||
+ list_in_scope = get_builder ()->get_file_symbols ();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -11810,6 +11811,7 @@ dwarf2_cu::setup_type_unit_groups (struc
|
||||
COMPUNIT_DIRNAME (cust),
|
||||
compunit_language (cust),
|
||||
0, cust));
|
||||
+ list_in_scope = get_builder ()->get_file_symbols ();
|
||||
|
||||
auto &file_names = line_header->file_names ();
|
||||
for (i = 0; i < file_names.size (); ++i)
|
||||
Index: gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc
|
||||
@@ -0,0 +1,21 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2020 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/>. */
|
||||
+
|
||||
+struct X {} x;
|
||||
+struct Y {} y;
|
||||
+struct Z {} z;
|
||||
+int main() {}
|
||||
Index: gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp
|
||||
@@ -0,0 +1,36 @@
|
||||
+# Copyright 2020 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/>.
|
||||
+
|
||||
+# Test dwarf4 signatured types (DW_TAG_type_unit).
|
||||
+
|
||||
+standard_testfile .cc
|
||||
+
|
||||
+# This test is intended for targets which support DWARF-4.
|
||||
+# Since we pass an explicit -gdwarf-4 -fdebug-types-section to the compiler,
|
||||
+# we let that be the test of whether the target supports it.
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" "${testfile}" \
|
||||
+ $srcfile {debug c++ additional_flags=-gdwarf-4 \
|
||||
+ additional_flags=-fdebug-types-section}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if ![runto_main] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_test "ptype X" "type = struct X {.*"
|
||||
+gdb_test "ptype Y" "type = struct Y {.*"
|
||||
+gdb_test "ptype Z" "type = struct Z {.*"
|
@ -1,123 +0,0 @@
|
||||
Fix unused function error
|
||||
|
||||
Attempting to build GDB in Ubuntu 16.04.6 LTS on x86_64, I ran into warnings
|
||||
that caused the build to fail:
|
||||
|
||||
binutils-gdb/gdb/gdbsupport/safe-strerror.c:44:1: error: ‘char* select_strerror_r(char*, char*)’ defined but not used [-Werror=unused-function] select_strerror_r (char *res, char *)
|
||||
|
||||
The diagnostic macro DIAGNOSTIC_IGNORE_UNUSED_FUNCTION seems to expand
|
||||
correctly to its respective pragma, but this doesn't seem to have an effect on
|
||||
the warning. I tried to use the pragma explicitly and got the same result.
|
||||
|
||||
ATTRIBUTE_UNUSED works fine in this case if you put it in both functions,
|
||||
which should fix warnings for both gdb and gdbserver builds.
|
||||
|
||||
The compiler version is gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609.
|
||||
|
||||
This is likely the result of PR64079 in GCC, which was fixed by commit
|
||||
9e96f1e1b9731c4e1ef4fbbbf0997319973f0537.
|
||||
|
||||
To prevent other developers from attempting to use this macro, only to get
|
||||
confused by it not working as expected, it seems better to not define this
|
||||
particular macro.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2019-12-12 Luis Machado <luis.machado@linaro.org>
|
||||
|
||||
* gdbsupport/safe-strerror.c: Don't include diagnostics.h.
|
||||
(select_strerror_r): Use ATTRIBUTE_UNUSED instead of the diagnostics
|
||||
macros.
|
||||
|
||||
include/ChangeLog:
|
||||
|
||||
2019-12-12 Luis Machado <luis.machado@linaro.org>
|
||||
|
||||
* diagnostics.h (DIAGNOSTIC_IGNORE_UNUSED_FUNCTION). Remove
|
||||
definitions.
|
||||
|
||||
Change-Id: Iad6123d61d76d111e3ef8d24aa8c60112304c749
|
||||
|
||||
---
|
||||
gdb/ChangeLog | 6 ++++++
|
||||
gdb/gdbsupport/safe-strerror.c | 12 ++----------
|
||||
include/ChangeLog | 5 +++++
|
||||
include/diagnostics.h | 9 ---------
|
||||
4 files changed, 13 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c
|
||||
index 9973fa6785..a5ddf74835 100644
|
||||
--- a/gdb/gdbsupport/safe-strerror.c
|
||||
+++ b/gdb/gdbsupport/safe-strerror.c
|
||||
@@ -18,7 +18,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "common-defs.h"
|
||||
-#include "diagnostics.h"
|
||||
#include <string.h>
|
||||
|
||||
/* There are two different versions of strerror_r; one is GNU-specific, the
|
||||
@@ -27,27 +26,20 @@
|
||||
to solve this for us because IPA does not use Gnulib but uses this
|
||||
function. */
|
||||
|
||||
-/* We only ever use one of the two overloads, so suppress the warning for
|
||||
- an unused function. */
|
||||
-DIAGNOSTIC_PUSH
|
||||
-DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
|
||||
-
|
||||
/* Called if we have a XSI-compliant strerror_r. */
|
||||
-static char *
|
||||
+ATTRIBUTE_UNUSED static char *
|
||||
select_strerror_r (int res, char *buf)
|
||||
{
|
||||
return res == 0 ? buf : nullptr;
|
||||
}
|
||||
|
||||
/* Called if we have a GNU strerror_r. */
|
||||
-static char *
|
||||
+ATTRIBUTE_UNUSED static char *
|
||||
select_strerror_r (char *res, char *)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
-DIAGNOSTIC_POP
|
||||
-
|
||||
/* Implementation of safe_strerror as defined in common-utils.h. */
|
||||
|
||||
const char *
|
||||
diff --git a/include/diagnostics.h b/include/diagnostics.h
|
||||
index 2adaa4d3a0..019ade2567 100644
|
||||
--- a/include/diagnostics.h
|
||||
+++ b/include/diagnostics.h
|
||||
@@ -53,8 +53,6 @@
|
||||
DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
|
||||
# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
|
||||
DIAGNOSTIC_IGNORE ("-Wdeprecated-register")
|
||||
-# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
|
||||
- DIAGNOSTIC_IGNORE ("-Wunused-function")
|
||||
# if __has_warning ("-Wenum-compare-switch")
|
||||
# define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \
|
||||
DIAGNOSTIC_IGNORE ("-Wenum-compare-switch")
|
||||
@@ -65,9 +63,6 @@
|
||||
|
||||
#elif defined (__GNUC__) /* GCC */
|
||||
|
||||
-# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
|
||||
- DIAGNOSTIC_IGNORE ("-Wunused-function")
|
||||
-
|
||||
# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
|
||||
DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
|
||||
|
||||
@@ -88,10 +83,6 @@
|
||||
# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
|
||||
#endif
|
||||
|
||||
-#ifndef DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
|
||||
-# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
|
||||
-#endif
|
||||
-
|
||||
#ifndef DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
|
||||
# define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
|
||||
#endif
|
14
gdb-fortran-fix-print-dynamic-array.patch
Normal file
14
gdb-fortran-fix-print-dynamic-array.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
|
||||
index 7467e518d06..fc9bd7a15f3 100644
|
||||
--- a/gdb/f-valprint.c
|
||||
+++ b/gdb/f-valprint.c
|
||||
@@ -117,7 +117,8 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
|
||||
LONGEST lowerbound, upperbound;
|
||||
LONGEST i;
|
||||
|
||||
- get_discrete_bounds (range_type, &lowerbound, &upperbound);
|
||||
+ if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
|
||||
+ lowerbound = 0, upperbound = -1;
|
||||
|
||||
if (nss != ndimensions)
|
||||
{
|
50
gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch
Normal file
50
gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch
Normal file
@ -0,0 +1,50 @@
|
||||
[gdb/fortran] Handle DW_AT_string_length with loclistptr
|
||||
|
||||
Fixes PR26910 - "[fortran] Printing dynamic string with DW_AT_string_length
|
||||
of class loclistpr fails".
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=26910
|
||||
|
||||
---
|
||||
gdb/dwarf2/read.c | 24 ++++++++++++++++++++----
|
||||
1 file changed, 20 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
index 05a50515ce4..798585dd380 100644
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -18175,14 +18175,30 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
|
||||
}
|
||||
else if (attr->form_is_constant ())
|
||||
prop->set_const_val (attr->constant_value (0));
|
||||
- else
|
||||
+ else if (attr->form_is_section_offset ())
|
||||
{
|
||||
- dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form),
|
||||
- dwarf2_name (die, cu));
|
||||
- return 0;
|
||||
+ switch (attr->name)
|
||||
+ {
|
||||
+ case DW_AT_string_length:
|
||||
+ baton = XOBNEW (obstack, struct dwarf2_property_baton);
|
||||
+ baton->property_type = default_type;
|
||||
+ fill_in_loclist_baton (cu, &baton->loclist, attr);
|
||||
+ prop->set_loclist (baton);
|
||||
+ gdb_assert (prop->baton () != NULL);
|
||||
+ break;
|
||||
+ default:
|
||||
+ goto invalid;
|
||||
+ }
|
||||
}
|
||||
+ else
|
||||
+ goto invalid;
|
||||
|
||||
return 1;
|
||||
+
|
||||
+ invalid:
|
||||
+ dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form),
|
||||
+ dwarf2_name (die, cu));
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/* See read.h. */
|
@ -39,10 +39,10 @@ gdb/
|
||||
|
||||
* dwarf2read.c (process_die): Change gdb_assert to complaint.
|
||||
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -10657,6 +10657,13 @@ private:
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -10162,6 +10162,13 @@ class process_die_scope
|
||||
static void
|
||||
process_die (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
@ -56,27 +56,10 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
process_die_scope scope (die, cu);
|
||||
|
||||
switch (die->tag)
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -601,6 +601,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \
|
||||
target_pid_to_str (process_ptid).c_str ());
|
||||
}
|
||||
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
|
||||
+ In this point of code it cannot be 1 as we would not get FORK
|
||||
+ executed without CONTINUE first which resets PID_WAS_STOPPED.
|
||||
+ We would have to first TARGET_STOP and WAITPID it as with running
|
||||
+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
|
||||
+#endif
|
||||
target_detach (parent_inf, 0);
|
||||
}
|
||||
|
||||
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
--- a/gdb/linux-nat.c
|
||||
+++ b/gdb/linux-nat.c
|
||||
@@ -189,6 +189,12 @@ struct linux_nat_target *linux_target;
|
||||
@@ -190,6 +190,12 @@ struct linux_nat_target *linux_target;
|
||||
/* Does the current host support PTRACE_GETREGSET? */
|
||||
enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN;
|
||||
|
||||
@ -89,17 +72,17 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
static unsigned int debug_linux_nat;
|
||||
static void
|
||||
show_debug_linux_nat (struct ui_file *file, int from_tty,
|
||||
@@ -1030,6 +1036,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");
|
||||
@@ -1044,6 +1050,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled)
|
||||
if (linux_proc_pid_is_stopped (pid))
|
||||
{
|
||||
linux_nat_debug_printf ("Attaching to a stopped process");
|
||||
+#ifdef NEED_DETACH_SIGSTOP
|
||||
+ pid_was_stopped = ptid.pid ();
|
||||
+#endif
|
||||
|
||||
/* The process is definitely stopped. It is in a job control
|
||||
stop, unless the kernel predates the TASK_STOPPED /
|
||||
@@ -1361,6 +1370,25 @@ get_detach_signal (struct lwp_info *lp)
|
||||
@@ -1359,6 +1368,25 @@ get_detach_signal (struct lwp_info *lp)
|
||||
return gdb_signal_to_host (signo);
|
||||
}
|
||||
|
||||
@ -125,7 +108,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1509,6 +1537,10 @@ linux_nat_target::detach (inferior *inf, int from_tty)
|
||||
@@ -1502,6 +1530,10 @@ linux_nat_target::detach (inferior *inf, int from_tty)
|
||||
detach_one_lwp (main_lwp, &signo);
|
||||
|
||||
detach_success (inf);
|
||||
@ -136,7 +119,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1766,6 +1798,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
|
||||
@@ -1744,6 +1776,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -153,7 +136,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
||||
if (resume_many)
|
||||
iterate_over_lwps (ptid, [=] (struct lwp_info *info)
|
||||
{
|
||||
@@ -3770,6 +3812,10 @@ linux_nat_target::mourn_inferior ()
|
||||
@@ -3617,6 +3659,10 @@ linux_nat_target::mourn_inferior ()
|
||||
|
||||
/* Let the arch-specific native code know this process is gone. */
|
||||
linux_target->low_forget_process (pid);
|
||||
|
43
gdb-handle-no-upper-bound-in-value-subscript.patch
Normal file
43
gdb-handle-no-upper-bound-in-value-subscript.patch
Normal file
@ -0,0 +1,43 @@
|
||||
Handle no upper bound in value_subscript
|
||||
|
||||
Fixes PR26875 - "Incorrect value printed for address of first element of
|
||||
zero-length array".
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=26875
|
||||
|
||||
---
|
||||
gdb/valarith.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gdb/valarith.c b/gdb/valarith.c
|
||||
index 0221bc6e939..32b908d6e5b 100644
|
||||
--- a/gdb/valarith.c
|
||||
+++ b/gdb/valarith.c
|
||||
@@ -151,18 +151,24 @@ value_subscript (struct value *array, LONGEST index)
|
||||
{
|
||||
struct type *range_type = tarray->index_type ();
|
||||
LONGEST lowerbound, upperbound;
|
||||
+ bool upperbound_p = true;
|
||||
+
|
||||
+ if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
|
||||
+ {
|
||||
+ lowerbound = range_type->bounds ()->low.const_val ();
|
||||
+ upperbound_p = false;
|
||||
+ }
|
||||
|
||||
- get_discrete_bounds (range_type, &lowerbound, &upperbound);
|
||||
if (VALUE_LVAL (array) != lval_memory)
|
||||
return value_subscripted_rvalue (array, index, lowerbound);
|
||||
|
||||
if (c_style == 0)
|
||||
{
|
||||
- if (index >= lowerbound && index <= upperbound)
|
||||
+ if (index >= lowerbound && upperbound_p && index <= upperbound)
|
||||
return value_subscripted_rvalue (array, index, lowerbound);
|
||||
/* Emit warning unless we have an array of unknown size.
|
||||
An array of unknown size has lowerbound 0 and upperbound -1. */
|
||||
- if (upperbound > -1)
|
||||
+ if (upperbound_p && upperbound > -1)
|
||||
warning (_("array or string index out of range"));
|
||||
/* fall doing C stuff */
|
||||
c_style = 1;
|
@ -9,7 +9,7 @@ Subject: gdb-jit-reader-multilib.patch
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -9694,10 +9694,12 @@ _ACEOF
|
||||
@@ -9968,10 +9968,12 @@ _ACEOF
|
||||
|
||||
|
||||
|
||||
@ -28,7 +28,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
|
||||
@@ -808,10 +808,12 @@ AC_CHECK_SIZEOF(unsigned long long)
|
||||
@@ -803,10 +803,12 @@ AC_CHECK_SIZEOF(unsigned long long)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
AC_CHECK_SIZEOF(unsigned __int128)
|
||||
|
||||
|
@ -6,30 +6,6 @@ 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
|
||||
@@ -11905,7 +11905,7 @@ else
|
||||
|
||||
#include <linux/perf_event.h>
|
||||
#ifndef PERF_ATTR_SIZE_VER5
|
||||
-# error
|
||||
+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
|
||||
#endif
|
||||
|
||||
_ACEOF
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -1414,7 +1414,7 @@ else
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <linux/perf_event.h>
|
||||
#ifndef PERF_ATTR_SIZE_VER5
|
||||
-# error
|
||||
+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
|
||||
#endif
|
||||
]])], [perf_event=yes], [perf_event=no])
|
||||
if test "$perf_event" != yes; then
|
||||
diff --git a/gdb/gdb.c b/gdb/gdb.c
|
||||
--- a/gdb/gdb.c
|
||||
+++ b/gdb/gdb.c
|
||||
@ -234,3 +210,15 @@ diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
|
||||
struct target_ops;
|
||||
|
||||
#if HAVE_LINUX_PERF_EVENT_H
|
||||
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
|
||||
--- a/gdbsupport/common.m4
|
||||
+++ b/gdbsupport/common.m4
|
||||
@@ -145,7 +145,7 @@ AC_DEFUN([GDB_AC_COMMON], [
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <linux/perf_event.h>
|
||||
#ifndef PERF_ATTR_SIZE_VER5
|
||||
- # error
|
||||
+ // error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
|
||||
#endif
|
||||
]])], [perf_event=yes], [perf_event=no])
|
||||
if test "$perf_event" != yes; then
|
||||
|
@ -14,10 +14,10 @@ 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
|
||||
@@ -11904,6 +11904,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);
|
||||
@@ -11948,6 +11948,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
|
||||
= 3 * (thread_count (proc_target) + 1);
|
||||
else
|
||||
old_loc->events_till_retirement = 1;
|
||||
+ /* Red Hat Bug 590623. */
|
||||
+ old_loc->events_till_retirement *= 10;
|
||||
old_loc->owner = NULL;
|
||||
|
@ -1,49 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 6 May 2020 10:02:22 -0700
|
||||
Subject: gdb-rhbz1818011-bfd-gcc10-error.patch
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
;; Fix int conversion error from bfd/elf.c when compiling with gcc 10
|
||||
|
||||
Original commit message from H.J. Lu <hjl.tools@gmail.com> is below:
|
||||
|
||||
bfd: Change num_group to unsigned int
|
||||
|
||||
elf.c failed with to with GCC 10 as of
|
||||
|
||||
commit 906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536
|
||||
Author: Martin Liska <mliska@suse.cz>
|
||||
Date: Tue Mar 24 11:40:10 2020 +0100
|
||||
|
||||
Improve endianess detection.
|
||||
|
||||
PR lto/94249
|
||||
* plugin-api.h: Add more robust endianess detection.
|
||||
|
||||
binutils-gdb/bfd/elf.c: In function ‘setup_group’:
|
||||
binutils-gdb/bfd/elf.c:740:35: error: overflow in conversion from ‘unsigned int’ to ‘int’ changes value from ‘num_group = 4294967295’ to ‘-1’ [-Werror=overflow]
|
||||
740 | elf_tdata (abfd)->num_group = num_group = -1;
|
||||
| ^~~~~~~~~
|
||||
cc1: all warnings being treated as errors
|
||||
make[2]: *** [Makefile:1608: elf.lo] Error 1
|
||||
|
||||
Change num_group in elf_obj_tdata to unsigned int to compile with GCC 10.
|
||||
|
||||
PR binutils/25717
|
||||
* elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
|
||||
|
||||
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
|
||||
--- a/bfd/elf-bfd.h
|
||||
+++ b/bfd/elf-bfd.h
|
||||
@@ -1937,7 +1937,7 @@ struct elf_obj_tdata
|
||||
struct sdt_note *sdt_note_head;
|
||||
|
||||
Elf_Internal_Shdr **group_sect_ptr;
|
||||
- int num_group;
|
||||
+ unsigned int num_group;
|
||||
|
||||
/* Index into group_sect_ptr, updated by setup_group when finding a
|
||||
section's group. Used to optimize subsequent group searches. */
|
@ -25,7 +25,7 @@ a problem with make -j parallelization of the testsuite.
|
||||
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
|
||||
--- a/gdb/testsuite/lib/future.exp
|
||||
+++ b/gdb/testsuite/lib/future.exp
|
||||
@@ -195,6 +195,10 @@ proc gdb_default_target_compile {source destfile type options} {
|
||||
@@ -197,6 +197,10 @@ proc gdb_default_target_compile_1 {source destfile type options} {
|
||||
set ldflags ""
|
||||
set dest [target_info name]
|
||||
|
||||
@ -36,7 +36,7 @@ diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
|
||||
if {[info exists CFLAGS_FOR_TARGET]} {
|
||||
append add_flags " $CFLAGS_FOR_TARGET"
|
||||
}
|
||||
@@ -529,10 +533,6 @@ proc gdb_default_target_compile {source destfile type options} {
|
||||
@@ -531,10 +535,6 @@ proc gdb_default_target_compile_1 {source destfile type options} {
|
||||
}
|
||||
}
|
||||
|
||||
|
248
gdb-symtab-fix-language-of-frame-without-debug-info.patch
Normal file
248
gdb-symtab-fix-language-of-frame-without-debug-info.patch
Normal file
@ -0,0 +1,248 @@
|
||||
[gdb/symtab] Fix language of frame without debug info
|
||||
|
||||
On openSUSE Leap 15.2, I run into this FAIL with target board readnow and
|
||||
test-case gdb.dwarf2/dw2-align.exp:
|
||||
...
|
||||
(gdb) set lang c++^M
|
||||
Warning: the current language does not match this frame.^M
|
||||
(gdb) FAIL: gdb.dwarf2/dw2-align.exp: set lang c++
|
||||
...
|
||||
|
||||
Adding some extra debugging shows that the current language differs without
|
||||
and with readnow:
|
||||
...
|
||||
Breakpoint 1, 0x00000000004004ab in main ()^M
|
||||
(gdb) show lang^M
|
||||
-The current source language is "auto; currently c".^M
|
||||
+The current source language is "auto; currently asm".^M
|
||||
...
|
||||
|
||||
This is explained by find_pc_compunit_symtab (0x4004ab) called from
|
||||
select_frame, which:
|
||||
- without readnow: returns NULL, and
|
||||
- with readnow: returns the symtab for the CU crtn.S, wich has language
|
||||
"MIPS assembler".
|
||||
|
||||
In the former case, the symtab for crtn.S is not expanded, and
|
||||
find_pc_compunit_symtab hits the default NULL return. In the latter case, the
|
||||
symtab for crtn.S is expanded, and the "best match" loop in
|
||||
find_pc_compunit_symtab returns that symtab as its best match.
|
||||
|
||||
The GLOBAL_BLOCK for crtn.S has these outer limits of the address range:
|
||||
...
|
||||
(gdb) p /x b.startaddr
|
||||
$6 = 0x4003c2
|
||||
(gdb) p /x b.endaddr
|
||||
$7 = 0x40053d
|
||||
...
|
||||
and 0x4004ab indeed fits in that range, which explains why the CU is
|
||||
considered a match.
|
||||
|
||||
However, the actual address ranges for the CU are:
|
||||
...
|
||||
00000040 ffffffffffffffff 0000000000000000 (base address)
|
||||
00000040 00000000004003c2 00000000004003c7
|
||||
00000040 0000000000400538 000000000040053d
|
||||
00000040 <End of list>
|
||||
...
|
||||
which confirms that the CU should not be considered a match.
|
||||
|
||||
The problem is that the "best match" loop is based on the assumption that a
|
||||
symtab with a better match will be found, but in this case we don't find a
|
||||
better match because there's no debug info describing main.
|
||||
|
||||
Fix this by preferring to use the addres map in the "best match" loop, which
|
||||
will accurately tell us that addrmap_find (bv.map, 0x4004ab) == NULL.
|
||||
|
||||
Tested on x86_64-linux (that is, openSUSE Leap 15.2), with and without
|
||||
readnow. In the case of a readnow run, brings down the number of unexpected
|
||||
failures from 66 to 38.
|
||||
|
||||
The FAIL does not reproduce on f.i. Ubuntu 18.04.5, because there the exec
|
||||
does not contain debug info for crtn.S. The dwarf assembly test-case mimics
|
||||
the scenario described above, and reproduces the FAIL with and without
|
||||
-readnow, for both mentioned OS configurations.
|
||||
|
||||
Also fixes PR25980 - "Overlapping Dwarf Compile Units with non-overlapping
|
||||
subranges gives incorrect line information".
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-10-28 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
PR symtab/26772
|
||||
* symtab.c (find_pc_sect_compunit_symtab): In case there's an address
|
||||
map, check it in the "best match" loop.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-10-28 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
PR symtab/26772
|
||||
* gdb.dwarf2/dw2-ranges-overlap.c: New test.
|
||||
* gdb.dwarf2/dw2-ranges-overlap.exp: New file.
|
||||
---
|
||||
gdb/symtab.c | 8 ++
|
||||
gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.c | 36 ++++++++
|
||||
.../gdb.dwarf2/dw2-ranges-overlap.exp | 87 +++++++++++++++++++
|
||||
5 files changed, 143 insertions(+)
|
||||
create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.c
|
||||
create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
|
||||
|
||||
diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
index f6e24758009..b7aae1bed14 100644
|
||||
--- a/gdb/symtab.c
|
||||
+++ b/gdb/symtab.c
|
||||
@@ -2923,6 +2923,14 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
||||
if (!in_range_p)
|
||||
continue;
|
||||
|
||||
+ if (BLOCKVECTOR_MAP (bv))
|
||||
+ {
|
||||
+ if (addrmap_find (BLOCKVECTOR_MAP (bv), pc) == nullptr)
|
||||
+ continue;
|
||||
+
|
||||
+ return cust;
|
||||
+ }
|
||||
+
|
||||
CORE_ADDR range = end - start;
|
||||
if (best_cust != nullptr
|
||||
&& range >= best_cust_range)
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.c
|
||||
new file mode 100644
|
||||
index 00000000000..cbc4551e437
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.c
|
||||
@@ -0,0 +1,36 @@
|
||||
+/*
|
||||
+ Copyright 2020 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/>. */
|
||||
+
|
||||
+int
|
||||
+bar (int a)
|
||||
+{
|
||||
+ asm ("bar_label: .globl bar_label");
|
||||
+ return a + 1;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+foo (int a)
|
||||
+{
|
||||
+ asm ("foo_label: .globl foo_label");
|
||||
+ return bar (a * 2) + 3;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ asm ("main_label: .globl main_label");
|
||||
+ return foo (5) + 1;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
|
||||
new file mode 100644
|
||||
index 00000000000..59c10c8ae24
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
|
||||
@@ -0,0 +1,87 @@
|
||||
+# Copyright 2020 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/>.
|
||||
+load_lib dwarf.exp
|
||||
+
|
||||
+# The function foo is encapsulated by two functions from CU
|
||||
+# $srcfile (main and bar), but the debug info does not describe foo, so
|
||||
+# foo should not be seen as part of CU $srcfile.
|
||||
+# Run to foo, and check that the current language is the default auto/C.
|
||||
+# If foo is considered part of CU $srcfile, the language will be auto/C++
|
||||
+# instead.
|
||||
+
|
||||
+# This test can only be run on targets which support DWARF-2 and use gas.
|
||||
+if {![dwarf2_support]} {
|
||||
+ verbose "Skipping $gdb_test_file_name."
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# The .c files use __attribute__.
|
||||
+if [get_compiler_info] {
|
||||
+ return -1
|
||||
+}
|
||||
+if !$gcc_compiled {
|
||||
+ verbose "Skipping $gdb_test_file_name."
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+standard_testfile .c -dw.S
|
||||
+
|
||||
+set asm_file [standard_output_file $srcfile2]
|
||||
+Dwarf::assemble $asm_file {
|
||||
+ global srcdir subdir srcfile srcfile2
|
||||
+ declare_labels ranges_label
|
||||
+
|
||||
+ # Find start address and length for our functions.
|
||||
+ set main_func \
|
||||
+ [function_range main [list ${srcdir}/${subdir}/$srcfile]]
|
||||
+ set foo_func \
|
||||
+ [function_range foo [list ${srcdir}/${subdir}/$srcfile]]
|
||||
+ set bar_func \
|
||||
+ [function_range bar [list ${srcdir}/${subdir}/$srcfile]]
|
||||
+
|
||||
+ cu {} {
|
||||
+ compile_unit {
|
||||
+ {language @DW_LANG_C_plus_plus}
|
||||
+ {name $srcfile}
|
||||
+ {ranges ${ranges_label} DW_FORM_sec_offset}
|
||||
+ } {
|
||||
+ subprogram {
|
||||
+ {external 1 flag}
|
||||
+ {name main}
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ranges {is_64 [is_64_target]} {
|
||||
+ ranges_label: sequence {
|
||||
+ {base [lindex $main_func 0]}
|
||||
+ {range 0 [lindex $main_func 1]}
|
||||
+ {base [lindex $bar_func 0]}
|
||||
+ {range 0 [lindex $bar_func 1]}
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" ${testfile} \
|
||||
+ [list $srcfile $asm_file] {nodebug}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if ![runto foo] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_test "show language" \
|
||||
+ "The current source language is \"auto; currently c\"\."
|
||||
--
|
||||
2.26.2
|
||||
|
178
gdb-symtab-read-cu-base-address-for-enqueued-cu.patch
Normal file
178
gdb-symtab-read-cu-base-address-for-enqueued-cu.patch
Normal file
@ -0,0 +1,178 @@
|
||||
[gdb/symtab] Read CU base address for enqueued CU
|
||||
|
||||
Consider the test-case contained in this patch. It consists of
|
||||
two CUs:
|
||||
- cu1, containing a DW_TAG_variable DIE foo
|
||||
- cu2, containing a DW_TAG_base_type DIE int
|
||||
where the variable foo has type int, in other words, there's an inter-CU
|
||||
reference.
|
||||
|
||||
When expanding the symtab for cu1, expansion of the symtab for cu2 is
|
||||
enqueued, and later processed by process_full_comp_unit. However, processing
|
||||
of .debug_ranges fails because the range is specified relative to a base
|
||||
address which is considered not to be present because
|
||||
!cu->base_address.has_value (), and we run into this case in
|
||||
dwarf2_ranges_process:
|
||||
...
|
||||
if (!base.has_value ())
|
||||
{
|
||||
/* We have no valid base address for the ranges
|
||||
data. */
|
||||
complaint (_("Invalid .debug_ranges data (no base address)"));
|
||||
return 0;
|
||||
}
|
||||
...
|
||||
|
||||
Fix this in process_full_comp_unit by setting cu->base_address.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-10-26 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* dwarf2/read.c (process_full_comp_unit): Call
|
||||
dwarf2_find_base_address.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-10-26 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.dwarf2/enqueued-cu-base-addr.exp: New file.
|
||||
---
|
||||
gdb/dwarf2/read.c | 2 +
|
||||
.../gdb.dwarf2/enqueued-cu-base-addr.exp | 112 ++++++++++++++++++
|
||||
4 files changed, 123 insertions(+)
|
||||
create mode 100644 gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
|
||||
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
index 436a116dc80..e1c528f44d2 100644
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -9929,6 +9929,8 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
|
||||
cu->language = pretend_language;
|
||||
cu->language_defn = language_def (cu->language);
|
||||
|
||||
+ dwarf2_find_base_address (cu->dies, cu);
|
||||
+
|
||||
/* Do line number decoding in read_file_scope () */
|
||||
process_die (cu->dies, cu);
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
|
||||
new file mode 100644
|
||||
index 00000000000..77fe6ff5e94
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
|
||||
@@ -0,0 +1,112 @@
|
||||
+# Copyright 2020 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/>.
|
||||
+
|
||||
+# Check whether .debug_ranges is correctly read in during symtab expansion.
|
||||
+
|
||||
+load_lib dwarf.exp
|
||||
+
|
||||
+# This test can only be run on targets which support DWARF-2 and use gas.
|
||||
+if {![dwarf2_support]} {
|
||||
+ return 0
|
||||
+};
|
||||
+
|
||||
+standard_testfile main.c .S
|
||||
+
|
||||
+set executable ${testfile}
|
||||
+set asm_file [standard_output_file ${srcfile2}]
|
||||
+
|
||||
+# We need to know the size of integer types in order to write some of the
|
||||
+# debugging info we'd like to generate.
|
||||
+if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Create the DWARF.
|
||||
+Dwarf::assemble $asm_file {
|
||||
+ global srcdir subdir srcfile
|
||||
+
|
||||
+ declare_labels int_label
|
||||
+ declare_labels ranges_label
|
||||
+
|
||||
+ set main_func \
|
||||
+ [function_range main [list ${srcdir}/${subdir}/$srcfile]]
|
||||
+
|
||||
+ cu {} {
|
||||
+ compile_unit {
|
||||
+ {language @DW_LANG_C_plus_plus}
|
||||
+ {name "cu1"}
|
||||
+ } {
|
||||
+ DW_TAG_variable {
|
||||
+ {name foo}
|
||||
+ {type :$int_label}
|
||||
+ {const_value 1 DW_FORM_sdata}
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ cu {} {
|
||||
+ compile_unit {
|
||||
+ {language @DW_LANG_C_plus_plus}
|
||||
+ {name "cu2"}
|
||||
+ {ranges ${ranges_label} sec_offset}
|
||||
+ {low_pc {[lindex $main_func 0]} DW_FORM_addr}
|
||||
+ } {
|
||||
+ int_label: base_type {
|
||||
+ {byte_size 4 udata}
|
||||
+ {encoding @DW_ATE_signed}
|
||||
+ {name int}
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ranges {is_64 [is_64_target]} {
|
||||
+ ranges_label: sequence {
|
||||
+ {range 0 [lindex $main_func 1]}
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" ${testfile} \
|
||||
+ [list $srcfile $asm_file] {nodebug}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart ${binfile}
|
||||
+
|
||||
+# Expand cu1. This will enqueue cu2.
|
||||
+gdb_test "ptype foo" "type = int"
|
||||
+
|
||||
+# Now check that cu2 has an address range starting at main.
|
||||
+set cu2_blockvector_re \
|
||||
+ [multi_line \
|
||||
+ "Symtab for file cu2 at $hex" \
|
||||
+ "Read from object file \[^\r\n\]*" \
|
||||
+ "Language: c\\+\\+" \
|
||||
+ "" \
|
||||
+ "Blockvector:" \
|
||||
+ "" \
|
||||
+ "block #000, \[^\r\n\]* in ($hex)..$hex" \
|
||||
+ ".*"]
|
||||
+gdb_test_multiple "maint print symbols -objfile $binfile" "CU addr found" {
|
||||
+ -re -wrap $cu2_blockvector_re {
|
||||
+ set addr $expect_out(1,string)
|
||||
+ if { $addr eq "0x0" } {
|
||||
+ fail "$gdb_test_name (Found 0x0)"
|
||||
+ } else {
|
||||
+ gdb_test "info symbol $addr" "main in section .*" \
|
||||
+ $gdb_test_name
|
||||
+ }
|
||||
+ }
|
||||
+}
|
13
gdb-symtab-set-default-dwarf-max-cache-age-1000.patch
Normal file
13
gdb-symtab-set-default-dwarf-max-cache-age-1000.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
index f8797537108..cb8f86fa352 100644
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -1250,7 +1250,7 @@ struct field_info
|
||||
compilation units. Set this to zero to disable caching. Cache
|
||||
sizes of up to at least twenty will improve startup time for
|
||||
typical inter-CU-reference binaries, at an obvious memory cost. */
|
||||
-static int dwarf_max_cache_age = 5;
|
||||
+static int dwarf_max_cache_age = 1000;
|
||||
static void
|
||||
show_dwarf_max_cache_age (struct ui_file *file, int from_tty,
|
||||
struct cmd_list_element *c, const char *value)
|
149
gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch
Normal file
149
gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch
Normal file
@ -0,0 +1,149 @@
|
||||
[gdb/symtab] Use early continue in find_pc_sect_compunit_symtab
|
||||
|
||||
Function find_pc_sect_compunit_symtab contains a loop:
|
||||
...
|
||||
for (compunit_symtab *cust : obj_file->compunits ())
|
||||
{
|
||||
...
|
||||
if (...)
|
||||
{
|
||||
/* Lots of code. */
|
||||
}
|
||||
}
|
||||
...
|
||||
|
||||
Reduce indentation level and improve readability by using early continue.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2020-10-27 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* symtab.c (find_pc_sect_compunit_symtab): Use early continue.
|
||||
---
|
||||
gdb/symtab.c | 94 +++++++++++++++++++++++++++------------------------
|
||||
2 files changed, 54 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/gdb/symtab.c b/gdb/symtab.c
|
||||
index a4f8239a8a1..eda33a7eb4f 100644
|
||||
--- a/gdb/symtab.c
|
||||
+++ b/gdb/symtab.c
|
||||
@@ -2883,7 +2883,7 @@ struct compunit_symtab *
|
||||
find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
||||
{
|
||||
struct compunit_symtab *best_cust = NULL;
|
||||
- CORE_ADDR distance = 0;
|
||||
+ CORE_ADDR best_cust_range = 0;
|
||||
struct bound_minimal_symbol msymbol;
|
||||
|
||||
/* If we know that this is not a text address, return failure. This is
|
||||
@@ -2914,56 +2914,62 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
||||
{
|
||||
for (compunit_symtab *cust : obj_file->compunits ())
|
||||
{
|
||||
- const struct block *b;
|
||||
- const struct blockvector *bv;
|
||||
+ const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
|
||||
+ const struct block *global_block
|
||||
+ = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||
+ CORE_ADDR start = BLOCK_START (global_block);
|
||||
+ CORE_ADDR end = BLOCK_END (global_block);
|
||||
+ bool in_range_p = start <= pc && pc < end;
|
||||
+ if (!in_range_p)
|
||||
+ continue;
|
||||
|
||||
- bv = COMPUNIT_BLOCKVECTOR (cust);
|
||||
- b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||
+ CORE_ADDR range = end - start;
|
||||
+ if (best_cust != nullptr
|
||||
+ && range >= best_cust_range)
|
||||
+ /* Cust doesn't have a smaller range than best_cust, skip it. */
|
||||
+ continue;
|
||||
+
|
||||
+ /* For an objfile that has its functions reordered,
|
||||
+ find_pc_psymtab will find the proper partial symbol table
|
||||
+ and we simply return its corresponding symtab. */
|
||||
+ /* In order to better support objfiles that contain both
|
||||
+ stabs and coff debugging info, we continue on if a psymtab
|
||||
+ can't be found. */
|
||||
+ if ((obj_file->flags & OBJF_REORDERED) && obj_file->sf)
|
||||
+ {
|
||||
+ struct compunit_symtab *result;
|
||||
+
|
||||
+ result
|
||||
+ = obj_file->sf->qf->find_pc_sect_compunit_symtab (obj_file,
|
||||
+ msymbol,
|
||||
+ pc,
|
||||
+ section,
|
||||
+ 0);
|
||||
+ if (result != NULL)
|
||||
+ return result;
|
||||
+ }
|
||||
|
||||
- if (BLOCK_START (b) <= pc
|
||||
- && BLOCK_END (b) > pc
|
||||
- && (distance == 0
|
||||
- || BLOCK_END (b) - BLOCK_START (b) < distance))
|
||||
+ if (section != 0)
|
||||
{
|
||||
- /* For an objfile that has its functions reordered,
|
||||
- find_pc_psymtab will find the proper partial symbol table
|
||||
- and we simply return its corresponding symtab. */
|
||||
- /* In order to better support objfiles that contain both
|
||||
- stabs and coff debugging info, we continue on if a psymtab
|
||||
- can't be found. */
|
||||
- if ((obj_file->flags & OBJF_REORDERED) && obj_file->sf)
|
||||
+ struct symbol *sym = NULL;
|
||||
+ struct block_iterator iter;
|
||||
+
|
||||
+ ALL_BLOCK_SYMBOLS (global_block, iter, sym)
|
||||
{
|
||||
- struct compunit_symtab *result;
|
||||
-
|
||||
- result
|
||||
- = obj_file->sf->qf->find_pc_sect_compunit_symtab (obj_file,
|
||||
- msymbol,
|
||||
- pc,
|
||||
- section,
|
||||
- 0);
|
||||
- if (result != NULL)
|
||||
- return result;
|
||||
+ fixup_symbol_section (sym, obj_file);
|
||||
+ if (matching_obj_sections (SYMBOL_OBJ_SECTION (obj_file,
|
||||
+ sym),
|
||||
+ section))
|
||||
+ break;
|
||||
}
|
||||
- if (section != 0)
|
||||
- {
|
||||
- struct block_iterator iter;
|
||||
- struct symbol *sym = NULL;
|
||||
-
|
||||
- ALL_BLOCK_SYMBOLS (b, iter, sym)
|
||||
- {
|
||||
- fixup_symbol_section (sym, obj_file);
|
||||
- if (matching_obj_sections (SYMBOL_OBJ_SECTION (obj_file,
|
||||
- sym),
|
||||
- section))
|
||||
- break;
|
||||
- }
|
||||
- if (sym == NULL)
|
||||
- continue; /* No symbol in this symtab matches
|
||||
+ if (sym == NULL)
|
||||
+ continue; /* No symbol in this symtab matches
|
||||
section. */
|
||||
- }
|
||||
- distance = BLOCK_END (b) - BLOCK_START (b);
|
||||
- best_cust = cust;
|
||||
}
|
||||
+
|
||||
+ /* Cust is best found sofar, save it. */
|
||||
+ best_cust = cust;
|
||||
+ best_cust_range = range;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
@ -26,46 +26,33 @@ not have this problem result in ~200 FAILs.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2019-08-06 Tom de Vries <tdevries@suse.de>
|
||||
2020-11-06 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* lib/ada.exp (gdb_compile_ada_bare): Factor out of ...
|
||||
(gdb_compile_ada): ... here.
|
||||
* lib/ada.exp (gdb_compile_ada): Call gdb_can_compile_ada.
|
||||
(gdb_can_compile_ada): New gdb_caching_proc.
|
||||
* lib/gdb.exp: Add load_lib ada.exp.
|
||||
(skip_ada_tests): Return 1 if !gdb_can_compile_ada.
|
||||
|
||||
---
|
||||
gdb/testsuite/lib/ada.exp | 38 +++++++++++++++++++++++++++++++++++++-
|
||||
gdb/testsuite/lib/ada.exp | 31 +++++++++++++++++++++++++++++++
|
||||
gdb/testsuite/lib/gdb.exp | 6 ++++++
|
||||
2 files changed, 43 insertions(+), 1 deletion(-)
|
||||
2 files changed, 37 insertions(+)
|
||||
|
||||
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
|
||||
index 1345c747c5..e3a600327e 100644
|
||||
index 0ffc5957c8..8370ce5b9b 100644
|
||||
--- a/gdb/testsuite/lib/ada.exp
|
||||
+++ b/gdb/testsuite/lib/ada.exp
|
||||
@@ -29,7 +29,7 @@ proc target_compile_ada_from_dir {builddir source dest type options} {
|
||||
@@ -87,12 +87,43 @@ proc gdb_compile_ada_1 {source dest type options} {
|
||||
# compile was successful.
|
||||
|
||||
# Compile some Ada code.
|
||||
|
||||
-proc gdb_compile_ada {source dest type options} {
|
||||
+proc gdb_compile_ada_bare {source dest type options} {
|
||||
|
||||
set srcdir [file dirname $source]
|
||||
set gprdir [file dirname $srcdir]
|
||||
@@ -53,10 +53,46 @@ proc gdb_compile_ada {source dest type options} {
|
||||
# We therefore simply check whether the dest file has been created
|
||||
# or not. Unless not present, the build has succeeded.
|
||||
if [file exists $dest] { set result "" }
|
||||
+ return $result
|
||||
+}
|
||||
+
|
||||
+proc gdb_compile_ada {source dest type options} {
|
||||
proc gdb_compile_ada {source dest type options} {
|
||||
+ if { [gdb_can_compile_ada] == 0 } {
|
||||
+ global gdb_test_file_name
|
||||
+ unsupported "$gdb_test_file_name"
|
||||
+ return "Cannot compile ada"
|
||||
+ }
|
||||
+ set result [gdb_compile_ada_bare $source $dest $type $options]
|
||||
set result [gdb_compile_ada_1 $source $dest $type $options]
|
||||
|
||||
gdb_compile_test $source $result
|
||||
return $result
|
||||
}
|
||||
@ -87,7 +74,7 @@ index 1345c747c5..e3a600327e 100644
|
||||
+
|
||||
+ file mkdir $dir
|
||||
+ gdb_produce_source $src $code
|
||||
+ set res [gdb_compile_ada_bare $src $dest executable {debug}]
|
||||
+ set res [gdb_compile_ada_1 $src $dest executable {debug}]
|
||||
+ file delete -force $dir
|
||||
+
|
||||
+ if { $res != "" } {
|
||||
@ -100,18 +87,18 @@ index 1345c747c5..e3a600327e 100644
|
||||
# used a different naming convention from many of the other gdb tests,
|
||||
# and this difference was preserved during the conversion to
|
||||
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
||||
index edc8dfcdfd..8585320bd2 100644
|
||||
index 653f145c1c..a0f2961a75 100644
|
||||
--- a/gdb/testsuite/lib/gdb.exp
|
||||
+++ b/gdb/testsuite/lib/gdb.exp
|
||||
@@ -29,6 +29,7 @@ load_lib libgloss.exp
|
||||
load_lib cache.exp
|
||||
@@ -84,6 +84,7 @@ load_lib cache.exp
|
||||
load_lib gdb-utils.exp
|
||||
load_lib memory.exp
|
||||
load_lib check-test-names.exp
|
||||
+load_lib ada.exp
|
||||
|
||||
global GDB
|
||||
|
||||
@@ -1881,6 +1882,11 @@ proc skip_fortran_tests {} {
|
||||
@@ -2093,6 +2094,11 @@ proc skip_fortran_tests {} {
|
||||
# Return a 1 if I don't even want to try to test ada.
|
||||
|
||||
proc skip_ada_tests {} {
|
||||
|
@ -1,97 +0,0 @@
|
||||
Avoid pagination in attach-32.exp
|
||||
|
||||
When running test-case attach-32.exp from
|
||||
gdb-6.3-inferior-notification-20050721.patch, we run into:
|
||||
...
|
||||
spawn build/gdb/testsuite/../../gdb/gdb -nw -nx \
|
||||
-data-directory build/gdb/testsuite/../data-directory --pid=27520
|
||||
GNU gdb (GDB) 8.3.50.20190726-git
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Type "show copying" and "show warranty" for details.
|
||||
This GDB was configured as "x86_64-pc-linux-gnu".
|
||||
Type "show configuration" for configuration details.
|
||||
For bug reporting instructions, please see:
|
||||
<http://www.gnu.org/software/gdb/bugs/>.
|
||||
Find the GDB manual and other documentation resources online at:
|
||||
<http://www.gnu.org/software/gdb/documentation/>.
|
||||
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word".
|
||||
Attaching to process 27520
|
||||
Reading symbols from build/gdb/testsuite/outputs/gdb.base/attach-32/attach-32...
|
||||
Reading symbols from /lib/libm.so.6...
|
||||
(No debugging symbols found in /lib/libm.so.6)
|
||||
Reading symbols from /lib/libc.so.6...
|
||||
(No debugging symbols found in /lib/libc.so.6)
|
||||
(No debugging symbols found in /lib/libc.so.6)
|
||||
Reading symbols from /lib/ld-linux.so.2...
|
||||
(No debugging symbols found in /lib/ld-linux.so.2)
|
||||
main () at /data/gdb_versions/devel/src/gdb/testsuite/gdb.base/attach-32.c:15
|
||||
--Type <RET> for more, q to quit, c to continue without paging--ERROR: \
|
||||
(timeout) GDB never initialized after 10 seconds.
|
||||
...
|
||||
The test-case hangs because pagination is activated, with height == 25
|
||||
due to gdb_init.
|
||||
|
||||
Fix this by starting gdb using -iex "set width 0" -iex "set height 0" -quiet,
|
||||
similar to how it is done in attach.exp (see commit fef1b2933d "Avoid
|
||||
pagination in attach.exp").
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2019-07-26 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.base/attach-32.exp: Start gdb using -iex "set width 0" -iex
|
||||
"set height 0" -quiet.
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.base/attach-32.exp | 24 ++++++++++++++++--------
|
||||
1 file changed, 16 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attach-32.exp
|
||||
index 67ded02ccf..7627a0a5db 100644
|
||||
--- a/gdb/testsuite/gdb.base/attach-32.exp
|
||||
+++ b/gdb/testsuite/gdb.base/attach-32.exp
|
||||
@@ -212,10 +212,14 @@ if { [istarget "*-*-cygwin*"] } {
|
||||
set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
}
|
||||
|
||||
-set GDBFLAGS_orig $GDBFLAGS
|
||||
-set GDBFLAGS "--pid=$testpid"
|
||||
-gdb_start
|
||||
-set GDBFLAGS $GDBFLAGS_orig
|
||||
+set res [gdb_spawn_with_cmdline_opts \
|
||||
+ "-quiet -iex \"set height 0\" -iex \"set width 0\" --pid=$testpid"]
|
||||
+set test "starting with --pid"
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "Reading symbols from.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
@@ -234,10 +238,14 @@ if { [istarget "*-*-cygwin*"] } {
|
||||
set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
|
||||
}
|
||||
|
||||
-set GDBFLAGS_orig $GDBFLAGS
|
||||
-set GDBFLAGS "--pid=$testpid"
|
||||
-gdb_start
|
||||
-set GDBFLAGS $GDBFLAGS_orig
|
||||
+set res [gdb_spawn_with_cmdline_opts \
|
||||
+ "-quiet -iex \"set height 0\" -iex \"set width 0\" --pid=$testpid"]
|
||||
+set test "starting with --pid"
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "Reading symbols from.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
do_call_attach_tests
|
@ -0,0 +1,68 @@
|
||||
[gdb/testsuite] Catch condition evaluation errors in gdb_assert
|
||||
|
||||
When running test-case gdb.base/watchpoint-stops-at-right-insn.exp, we may run
|
||||
into a tcl error, which can be reproduced reliably using this trigger patch:
|
||||
...
|
||||
+ set hw_watch_pc ""
|
||||
gdb_assert {$sw_watch_pc == $hw_watch_pc} \
|
||||
"hw watchpoint stops at right instruction"
|
||||
...
|
||||
such that we have:
|
||||
...
|
||||
ERROR: tcl error sourcing watchpoint-stops-at-right-insn.exp.
|
||||
ERROR: missing operand at _@_
|
||||
in expression "0x4004b7 == _@_"
|
||||
(parsing expression "0x4004b7 == ")
|
||||
invoked from within
|
||||
"expr $sw_watch_pc == $hw_watch_pc"
|
||||
("uplevel" body line 1)
|
||||
invoked from within
|
||||
"uplevel 1 expr $condition"
|
||||
(procedure "gdb_assert" line 6)
|
||||
invoked from within
|
||||
"gdb_assert {$sw_watch_pc == $hw_watch_pc} \
|
||||
"hw watchpoint stops at right instruction""
|
||||
...
|
||||
|
||||
A similar problem was fixed in commit 5f0e2eb79e "GDB/testsuite: Fix a
|
||||
catastrophic step-over-no-symbols.exp failure", by making the assert condition
|
||||
more robust:
|
||||
...
|
||||
- gdb_assert {$before_addr != $after_addr} "advanced"
|
||||
+ gdb_assert {{[string is integer -strict $before_addr] \
|
||||
+ && [string is integer -strict $after_addr] \
|
||||
+ && $before_addr != $after_addr}} "advanced"
|
||||
...
|
||||
|
||||
Fix this instead in gdb_assert, by catching errors while evaluating the assert
|
||||
condition.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-09-16 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
PR testsuite/26624
|
||||
* lib/gdb.exp (gdb_assert): Catch errors in condition evaluation.
|
||||
|
||||
---
|
||||
gdb/testsuite/ChangeLog | 5 +++++
|
||||
gdb/testsuite/lib/gdb.exp | 4 ++--
|
||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
||||
index 653f145c1ce..59439f8e379 100644
|
||||
--- a/gdb/testsuite/lib/gdb.exp
|
||||
+++ b/gdb/testsuite/lib/gdb.exp
|
||||
@@ -1689,8 +1689,8 @@ proc gdb_assert { condition {message ""} } {
|
||||
set message $condition
|
||||
}
|
||||
|
||||
- set res [uplevel 1 expr $condition]
|
||||
- if {!$res} {
|
||||
+ set code [catch {uplevel 1 expr $condition} res]
|
||||
+ if {$code != 0 || !$res} {
|
||||
fail $message
|
||||
} else {
|
||||
pass $message
|
71
gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch
Normal file
71
gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch
Normal file
@ -0,0 +1,71 @@
|
||||
[gdb/testsuite] Detect gdb prompt after monitor exit
|
||||
|
||||
With this gdbserver-support.exp patch:
|
||||
...
|
||||
<SNIP to fix patch application problems>
|
||||
...
|
||||
and with this in parallel:
|
||||
...
|
||||
$ stress -c 5
|
||||
...
|
||||
we run into this and similar FAILs:
|
||||
...
|
||||
FAIL: gdb.multi/multi-target.exp: continue: non-stop=on: $have_prompt
|
||||
...
|
||||
|
||||
In more detail:
|
||||
...
|
||||
(gdb) PASS: gdb.multi/multi-target.exp: continue: non-stop=on: inferior 5
|
||||
Remote debugging from host ::1, port 40712^M
|
||||
Process build/gdb/testsuite/outputs/gdb.multi/multi-target/multi-target \
|
||||
created; pid = 11098^M
|
||||
monitor exit^M
|
||||
Killing process(es): 11098^M
|
||||
FAIL: gdb.multi/multi-target.exp: continue: non-stop=on: $have_prompt
|
||||
spawn build/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory \
|
||||
build/gdb/testsuite/../data-directory^M
|
||||
...
|
||||
|
||||
After issuing a "monitor exit" command, we should always get a prompt back, so
|
||||
check for that.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-09-16 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* lib/gdbserver-support.exp (gdbserver_exit): Make sure we
|
||||
get the gdb prompt after issuing "monitor exit".
|
||||
|
||||
---
|
||||
gdb/testsuite/ChangeLog | 5 +++++
|
||||
gdb/testsuite/lib/gdbserver-support.exp | 9 ++++++++-
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
|
||||
index a2cc80f28d7..2734ca6c878 100644
|
||||
--- a/gdb/testsuite/lib/gdbserver-support.exp
|
||||
+++ b/gdb/testsuite/lib/gdbserver-support.exp
|
||||
@@ -451,13 +451,20 @@ proc gdbserver_exit { is_mi } {
|
||||
# We use expect rather than gdb_expect because
|
||||
# we want to suppress printing exception messages, otherwise,
|
||||
# remote_expect, invoked by gdb_expect, prints the exceptions.
|
||||
+ set have_prompt 0
|
||||
expect {
|
||||
-i "$gdb_spawn_id" -re "$gdb_prompt $" {
|
||||
- exp_continue
|
||||
+ set have_prompt 1
|
||||
+ if { [info exists server_spawn_id] } {
|
||||
+ exp_continue
|
||||
+ }
|
||||
}
|
||||
-i "$server_spawn_id" eof {
|
||||
wait -i $expect_out(spawn_id)
|
||||
unset server_spawn_id
|
||||
+ if { ! $have_prompt } {
|
||||
+ exp_continue
|
||||
+ }
|
||||
}
|
||||
timeout {
|
||||
warning "Timed out waiting for EOF in server after $monitor_exit"
|
65
gdb-testsuite-disable-selftests-for-factory.patch
Normal file
65
gdb-testsuite-disable-selftests-for-factory.patch
Normal file
@ -0,0 +1,65 @@
|
||||
[gdb/testsuite] Disable selftests for factory
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.gdb/complaints.exp | 3 +++
|
||||
gdb/testsuite/gdb.gdb/python-interrupts.exp | 3 +++
|
||||
gdb/testsuite/gdb.gdb/python-selftest.exp | 3 +++
|
||||
gdb/testsuite/gdb.gdb/selftest.exp | 3 +++
|
||||
4 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.gdb/complaints.exp b/gdb/testsuite/gdb.gdb/complaints.exp
|
||||
index 922530caa50..f3cb8fc902c 100644
|
||||
--- a/gdb/testsuite/gdb.gdb/complaints.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/complaints.exp
|
||||
@@ -17,6 +17,9 @@
|
||||
# derived from xfullpath.exp (written by Joel Brobecker), derived from
|
||||
# selftest.exp (written by Rob Savoye).
|
||||
|
||||
+verbose "Skipping selftests for gdb build with -flto."
|
||||
+return -1
|
||||
+
|
||||
load_lib selftest-support.exp
|
||||
|
||||
if [target_info exists gdb,noinferiorio] {
|
||||
diff --git a/gdb/testsuite/gdb.gdb/python-interrupts.exp b/gdb/testsuite/gdb.gdb/python-interrupts.exp
|
||||
index 6e5ce6ee48d..3087a48eeac 100644
|
||||
--- a/gdb/testsuite/gdb.gdb/python-interrupts.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/python-interrupts.exp
|
||||
@@ -16,6 +16,9 @@
|
||||
# Test Python SIGINT handling.
|
||||
# This is easiest if we can send SIGINT when gdb is at particular points.
|
||||
|
||||
+verbose "Skipping selftests for gdb build with -flto."
|
||||
+return -1
|
||||
+
|
||||
load_lib selftest-support.exp
|
||||
load_lib gdb-python.exp
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.gdb/python-selftest.exp b/gdb/testsuite/gdb.gdb/python-selftest.exp
|
||||
index ee40245bc53..0396ad2405a 100644
|
||||
--- a/gdb/testsuite/gdb.gdb/python-selftest.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/python-selftest.exp
|
||||
@@ -13,6 +13,9 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+verbose "Skipping selftests for gdb build with -flto."
|
||||
+return -1
|
||||
+
|
||||
load_lib selftest-support.exp
|
||||
load_lib gdb-python.exp
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
index 43043e58ead..a84efa2bbb6 100644
|
||||
--- a/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
# This file was written by Rob Savoye. (rob@cygnus.com)
|
||||
|
||||
+verbose "Skipping selftests for gdb build with -flto."
|
||||
+return -1
|
||||
+
|
||||
load_lib selftest-support.exp
|
||||
|
||||
proc test_with_self { } {
|
@ -0,0 +1,76 @@
|
||||
[gdb/testsuite] Fix control-flow in gdb.reverse/insn-reverse.exp
|
||||
|
||||
In gdb.reverse/insn-reverse.exp, we have loop containing a call to
|
||||
gdb_test_multiple, which itself contains a break:
|
||||
...
|
||||
for {} {$count < 500} {incr count} {
|
||||
...
|
||||
gdb_test_multiple "x/i \$pc" "" {
|
||||
...
|
||||
break
|
||||
}
|
||||
...
|
||||
|
||||
On SLE-11 with:
|
||||
...
|
||||
$ runtest --version
|
||||
Expect version is 5.44.1.11
|
||||
Tcl version is 8.5
|
||||
Framework version is 1.4.4
|
||||
...
|
||||
the break doesn't seem to have the effect of breaking out of the loop.
|
||||
|
||||
The break does have the effect of terminating evaluation of the expect clause,
|
||||
which means we don't set insn_array, after which we run into:
|
||||
...
|
||||
ERROR: tcl error sourcing /tmp/tdevries/src/gdb/testsuite/gdb.reverse/insn-reverse.exp.
|
||||
ERROR: can't read "insn_array(5)": no such element in array
|
||||
...
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.reverse/insn-reverse.exp | 26 +++++++++++++++-----------
|
||||
1 file changed, 15 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
|
||||
index 39e276964f9..d1fdebf75fe 100644
|
||||
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
|
||||
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
|
||||
@@ -79,23 +79,27 @@ proc test { func testcase_nr } {
|
||||
set count 0
|
||||
set insn_addr ""
|
||||
for {} {$count < 500} {incr count} {
|
||||
+ set prev_insn_addr $insn_addr
|
||||
+ set insn_addr ""
|
||||
gdb_test_multiple "x/i \$pc" "" {
|
||||
-re ".* ($hex) <.*>:\[ \t\]*(.*)\r\n$gdb_prompt $" {
|
||||
- set prev_insn_addr $insn_addr
|
||||
set insn_addr $expect_out(1,string)
|
||||
+ set insn_array($count) $expect_out(2,string)
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- if [expr {$last_insn == $insn_addr}] {
|
||||
- break
|
||||
- }
|
||||
+ if [expr {$insn_addr == ""}] {
|
||||
+ break
|
||||
+ }
|
||||
|
||||
- if [expr {$prev_insn_addr == $insn_addr}] {
|
||||
- # Failed to make progress, might have run into SIGILL.
|
||||
- unsupported "no progress at: $expect_out(2,string)"
|
||||
- break
|
||||
- }
|
||||
+ if [expr {$last_insn == $insn_addr}] {
|
||||
+ break
|
||||
+ }
|
||||
|
||||
- set insn_array($count) $expect_out(2,string)
|
||||
- }
|
||||
+ if [expr {$prev_insn_addr == $insn_addr}] {
|
||||
+ # Failed to make progress, might have run into SIGILL.
|
||||
+ unsupported "no progress at: $expect_out(2,string)"
|
||||
+ break
|
||||
}
|
||||
|
||||
set pre_regs($count) [capture_command_output "info all-registers" ""]
|
@ -0,0 +1,52 @@
|
||||
gdb/testsuite: fix failure in gdb.base/step-over-no-symbols.exp
|
||||
|
||||
This test fails on my machine:
|
||||
|
||||
p /x $pc^M
|
||||
$2 = 0x55555555514e^M
|
||||
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=off: get after PC
|
||||
FAIL: gdb.base/step-over-no-symbols.exp: displaced=off: advanced
|
||||
|
||||
This is due to the check added in 5f0e2eb79e6b ("GDB/testsuite: Fix a
|
||||
catastrophic step-over-no-symbols.exp failure"), that makes sure the PC
|
||||
values are integer. As documented in the TCL doc [1], "string is
|
||||
integer" returns 1 if the string is a valid 32-bit integer format. The
|
||||
PC values are greater than 32 bits, so are not recognized as integers by
|
||||
that test.
|
||||
|
||||
% string is integer -strict 0x55555555
|
||||
1
|
||||
% string is integer -strict 0x555555555
|
||||
0
|
||||
|
||||
Replace the "string is integer" test with a regexp one, that verifies
|
||||
the PC is a hex value.
|
||||
|
||||
[1] https://www.tcl.tk/man/tcl/TclCmd/string.htm#M21
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
* gdb.base/step-over-no-symbols.exp (test_step_over): Replace
|
||||
integer format test with regexp.
|
||||
|
||||
Change-Id: I71f8197e7b52e97b4901980544a8d1072aabd362
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.base/step-over-no-symbols.exp | 4 ++--
|
||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/step-over-no-symbols.exp b/gdb/testsuite/gdb.base/step-over-no-symbols.exp
|
||||
index bc715d7afed..a2201dcaebe 100644
|
||||
--- a/gdb/testsuite/gdb.base/step-over-no-symbols.exp
|
||||
+++ b/gdb/testsuite/gdb.base/step-over-no-symbols.exp
|
||||
@@ -78,8 +78,8 @@ proc test_step_over { displaced } {
|
||||
|
||||
set after_addr [get_pc "get after PC"]
|
||||
|
||||
- gdb_assert {{[string is integer -strict $before_addr] \
|
||||
- && [string is integer -strict $after_addr] \
|
||||
+ gdb_assert {{[regexp "^${hex}$" $before_addr] \
|
||||
+ && [regexp "^${hex}$" $after_addr] \
|
||||
&& $before_addr != $after_addr}} "advanced"
|
||||
}
|
||||
|
123
gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch
Normal file
123
gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch
Normal file
@ -0,0 +1,123 @@
|
||||
[gdb/testsuite] Fix gdb.dlang/watch-loc.exp on ppc64
|
||||
|
||||
On ppc64, we run into:
|
||||
...
|
||||
/tmp/ccKXURmw.s: Assembler messages:^M
|
||||
/tmp/ccKXURmw.s:99: Error: can't resolve \
|
||||
`_Dmain_end' {.text section} - `_Dmain' {.opd section}^M
|
||||
compiler exited with status 1
|
||||
...
|
||||
|
||||
The unresolvable entity comes from the .debug_aranges section hardcoded in
|
||||
watch-loc.c:
|
||||
...
|
||||
" .4byte _Dmain \n" // Address
|
||||
" .4byte _Dmain_end - _Dmain \n" // Length
|
||||
...
|
||||
where _Dmain is the function label for function _Dmain, and _Dmain_end is a
|
||||
label after function _Dmain:
|
||||
...
|
||||
int _Dmain (void)
|
||||
{
|
||||
asm ("_Dmain_label: .globl _Dmain_label");
|
||||
return 0;
|
||||
}
|
||||
|
||||
asm ("_Dmain_end: .globl _Dmain_end");
|
||||
...
|
||||
|
||||
The problem is that the two labels are not in the same section, because _Dmain
|
||||
ends up in the .opd section, which "contains the official procedure
|
||||
descriptors. A pointer to a function shall reference a procedure descriptor in
|
||||
this section."
|
||||
|
||||
Fix this by using function_range instead to get the length.
|
||||
|
||||
Also, fix the address part to not use _Dmain, but instead use the function
|
||||
start as returned by function_range.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-09-16 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
PR testsuite/26617
|
||||
* gdb.dlang/watch-loc.c: Only add .debug_aranges if
|
||||
WITH_DEBUG_SECTIONS is defined.
|
||||
(xstr, str): New macro.
|
||||
(.debug_aranges): Use DMAIN_START_0/1/2 and DMAIN_LENGTH
|
||||
to get start and size of _Dmain.
|
||||
* gdb.dlang/watch-loc.exp: Pass DMAIN_START_0/1/2 and DMAIN_LENGTH
|
||||
using additional_flags.
|
||||
|
||||
---
|
||||
gdb/testsuite/ChangeLog | 11 +++++++++++
|
||||
gdb/testsuite/gdb.dlang/watch-loc.c | 8 ++++++--
|
||||
gdb/testsuite/gdb.dlang/watch-loc.exp | 17 ++++++++++++++++-
|
||||
3 files changed, 33 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dlang/watch-loc.c b/gdb/testsuite/gdb.dlang/watch-loc.c
|
||||
index de594f35ae6..0a58f27d9fa 100644
|
||||
--- a/gdb/testsuite/gdb.dlang/watch-loc.c
|
||||
+++ b/gdb/testsuite/gdb.dlang/watch-loc.c
|
||||
@@ -36,6 +36,9 @@ main (void)
|
||||
return _Dmain ();
|
||||
}
|
||||
|
||||
+#ifdef WITH_DEBUG_SECTIONS
|
||||
+#define xstr(s) str(s)
|
||||
+#define str(s) #s
|
||||
/* The .debug_names-based index support depends on .debug_aranges
|
||||
generated by GCC. (.gdb_index includes a gdb-generated map
|
||||
instead.) */
|
||||
@@ -52,10 +55,11 @@ asm (
|
||||
" .byte 0 \n" // Size of Segment Descriptor
|
||||
" .2byte 0 \n" // Pad to 16 byte boundary
|
||||
" .2byte 0 \n"
|
||||
-" .4byte _Dmain \n" // Address
|
||||
-" .4byte _Dmain_end - _Dmain \n" // Length
|
||||
+" .4byte " xstr(DMAIN_START_0) xstr(DMAIN_START_1) xstr(DMAIN_START_2) "\n" // Address
|
||||
+" .4byte " xstr(DMAIN_LENGTH) "\n" // Length
|
||||
" .4byte 0 \n"
|
||||
" .4byte 0 \n"
|
||||
".Laranges_end: \n"
|
||||
" .popsection \n"
|
||||
);
|
||||
+#endif
|
||||
diff --git a/gdb/testsuite/gdb.dlang/watch-loc.exp b/gdb/testsuite/gdb.dlang/watch-loc.exp
|
||||
index d65f3c674fd..dcd93789ce4 100644
|
||||
--- a/gdb/testsuite/gdb.dlang/watch-loc.exp
|
||||
+++ b/gdb/testsuite/gdb.dlang/watch-loc.exp
|
||||
@@ -27,6 +27,10 @@ if {![dwarf2_support]} {
|
||||
|
||||
standard_testfile watch-loc.c watch-loc-dw.S
|
||||
|
||||
+lassign [function_range _Dmain ${srcdir}/${subdir}/${srcfile}] \
|
||||
+ dmain_start dmain_length
|
||||
+
|
||||
+
|
||||
# Make some DWARF for the test.
|
||||
set asm_file [standard_output_file $srcfile2]
|
||||
Dwarf::assemble $asm_file {
|
||||
@@ -62,8 +66,19 @@ Dwarf::assemble $asm_file {
|
||||
}
|
||||
}
|
||||
|
||||
+set dmain_start_list [split $dmain_start]
|
||||
+set dmain_start_0 [lindex $dmain_start_list 0]
|
||||
+set dmain_start_1 [lindex $dmain_start_list 1]
|
||||
+set dmain_start_2 [lindex $dmain_start_list 2]
|
||||
+
|
||||
if { [prepare_for_testing "failed to prepare" ${testfile} \
|
||||
- [list $srcfile $asm_file] {nodebug}] } {
|
||||
+ [list $srcfile $asm_file] \
|
||||
+ "nodebug \
|
||||
+ additional_flags=-DWITH_DEBUG_SECTIONS \
|
||||
+ additional_flags=-DDMAIN_START_0=$dmain_start_0 \
|
||||
+ additional_flags=-DDMAIN_START_1=$dmain_start_1 \
|
||||
+ additional_flags=-DDMAIN_START_2=$dmain_start_2 \
|
||||
+ additional_flags=-DDMAIN_LENGTH=$dmain_length"] } {
|
||||
return -1
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
[gdb/testsuite] Fix gdb.reverse/insn-reverse-x86.c for -m32
|
||||
|
||||
When running test-case gdb.reverse/insn-reverse.exp with target board
|
||||
unix/-m32, we get:
|
||||
...
|
||||
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never \
|
||||
-c -g -m32 -o insn-reverse0.o insn-reverse.c^M
|
||||
insn-reverse-x86.c: Assembler messages:^M
|
||||
insn-reverse-x86.c:88: Error: bad register name `%r8w'^M
|
||||
....
|
||||
|
||||
Fix this by guarding x86_64 assembly in insn-reverse-x86.c with #ifdef
|
||||
__x86_64__.
|
||||
|
||||
Tested on x86_64-linux, with native and unix/-m32.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-11-25 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.reverse/insn-reverse-x86.c: Guard x86_64 assembly with #ifdef
|
||||
__x86_64__.
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.reverse/insn-reverse-x86.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse-x86.c b/gdb/testsuite/gdb.reverse/insn-reverse-x86.c
|
||||
index 22ba97a50d7..4392cb66def 100644
|
||||
--- a/gdb/testsuite/gdb.reverse/insn-reverse-x86.c
|
||||
+++ b/gdb/testsuite/gdb.reverse/insn-reverse-x86.c
|
||||
@@ -85,6 +85,7 @@ rdrand (void)
|
||||
__asm__ volatile ("rdrand %%sp;" : "=r" (number));
|
||||
__asm__ volatile ("mov %%ax, %%sp;" : "=r" (number));
|
||||
|
||||
+#ifdef __x86_64__
|
||||
__asm__ volatile ("rdrand %%r8w;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%r9w;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%r10w;" : "=r" (number));
|
||||
@@ -93,6 +94,7 @@ rdrand (void)
|
||||
__asm__ volatile ("rdrand %%r13w;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%r14w;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%r15w;" : "=r" (number));
|
||||
+#endif
|
||||
|
||||
/* 32-bit random numbers. */
|
||||
__asm__ volatile ("rdrand %%eax;" : "=r" (number));
|
||||
@@ -100,6 +102,7 @@ rdrand (void)
|
||||
__asm__ volatile ("rdrand %%ecx;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%edx;" : "=r" (number));
|
||||
|
||||
+#ifdef __x86_64__
|
||||
__asm__ volatile ("mov %%rdi, %%rax;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%edi;" : "=r" (number));
|
||||
__asm__ volatile ("mov %%rax, %%rdi;" : "=r" (number));
|
||||
@@ -155,6 +158,7 @@ rdrand (void)
|
||||
__asm__ volatile ("rdrand %%r13;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%r14;" : "=r" (number));
|
||||
__asm__ volatile ("rdrand %%r15;" : "=r" (number));
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Test rdseed support for various output registers. */
|
||||
@@ -190,6 +194,7 @@ rdseed (void)
|
||||
__asm__ volatile ("rdseed %%sp;" : "=r" (seed));
|
||||
__asm__ volatile ("mov %%ax, %%sp;" : "=r" (seed));
|
||||
|
||||
+#ifdef __x86_64__
|
||||
__asm__ volatile ("rdseed %%r8w;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%r9w;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%r10w;" : "=r" (seed));
|
||||
@@ -198,6 +203,7 @@ rdseed (void)
|
||||
__asm__ volatile ("rdseed %%r13w;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%r14w;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%r15w;" : "=r" (seed));
|
||||
+#endif
|
||||
|
||||
/* 32-bit random seeds. */
|
||||
__asm__ volatile ("rdseed %%eax;" : "=r" (seed));
|
||||
@@ -205,6 +211,7 @@ rdseed (void)
|
||||
__asm__ volatile ("rdseed %%ecx;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%edx;" : "=r" (seed));
|
||||
|
||||
+#ifdef __x86_64__
|
||||
__asm__ volatile ("mov %%rdi, %%rax;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%edi;" : "=r" (seed));
|
||||
__asm__ volatile ("mov %%rax, %%rdi;" : "=r" (seed));
|
||||
@@ -260,6 +267,7 @@ rdseed (void)
|
||||
__asm__ volatile ("rdseed %%r13;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%r14;" : "=r" (seed));
|
||||
__asm__ volatile ("rdseed %%r15;" : "=r" (seed));
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Initialize arch-specific bits. */
|
19
gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch
Normal file
19
gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch
Normal file
@ -0,0 +1,19 @@
|
||||
Fix gdb.server/ext-run.exp for obs
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.server/ext-run.exp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp
|
||||
index ecedf6b887a..0ab56253eb9 100644
|
||||
--- a/gdb/testsuite/gdb.server/ext-run.exp
|
||||
+++ b/gdb/testsuite/gdb.server/ext-run.exp
|
||||
@@ -57,7 +57,7 @@ if { [istarget *-*-linux*] } {
|
||||
# This is done in a way to avoid the timeout that can occur from
|
||||
# applying .* regexp to large output.
|
||||
gdb_test_sequence "info os processes" "get process list" \
|
||||
- { "pid +user +command" "1 +root +\[/a-z\]*(init|systemd)" }
|
||||
+ { "pid +user +command" "1 +root +\[/a-z\]*(init|systemd|bash)" }
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
Fix perror in gdb.opt/fortran-string.exp
|
||||
|
||||
When running the test-case gdb.opt/fortran-string.exp from
|
||||
gdb-archer-vla-tests.patch, we run into:
|
||||
...
|
||||
ERROR: couldn't run to breakpoint MAIN__
|
||||
...
|
||||
The test case attempts to set a breakpoint on a line containing an "s = s"
|
||||
assignment and when that doesn't work, it error out with above error message.
|
||||
|
||||
The test-case executable is optimized, and the "s = s" assignment is optimized
|
||||
away, so there's not really an error, it's just that the test-case is
|
||||
unsupported due to the optimizations done by the compiler.
|
||||
|
||||
Fix this by replacing the ERROR with UNSUPPORTED.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2019-07-26 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.opt/fortran-string.exp: Replace error with unsupported.
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.opt/fortran-string.exp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp
|
||||
index 90a2bdf212..6e5f37d439 100644
|
||||
--- a/gdb/testsuite/gdb.opt/fortran-string.exp
|
||||
+++ b/gdb/testsuite/gdb.opt/fortran-string.exp
|
||||
@@ -30,7 +30,7 @@ if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f90 additional_f
|
||||
}
|
||||
|
||||
if ![runto $srcfile:[gdb_get_line_number "s = s"]] then {
|
||||
- perror "couldn't run to breakpoint MAIN__"
|
||||
+ unsupported "couldn't run to breakpoint s = s in optimized executable"
|
||||
continue
|
||||
}
|
||||
|
43
gdb-testsuite-gdb-base-morestack-exp-no-clang.patch
Normal file
43
gdb-testsuite-gdb-base-morestack-exp-no-clang.patch
Normal file
@ -0,0 +1,43 @@
|
||||
diff --git a/gdb/testsuite/gdb.base/morestack.c b/gdb/testsuite/gdb.base/morestack.c
|
||||
index 1cc33df29c9..63c3e23c903 100644
|
||||
--- a/gdb/testsuite/gdb.base/morestack.c
|
||||
+++ b/gdb/testsuite/gdb.base/morestack.c
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/resource.h>
|
||||
-#include <stdio.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
/* Use a noinline function to ensure that the buffer is not removed
|
||||
@@ -63,7 +62,6 @@ down (int i)
|
||||
|
||||
if (last && last < (void *) buf)
|
||||
{
|
||||
- printf ("%d: %p < %p\n", i, last, buf);
|
||||
marker_hit ();
|
||||
}
|
||||
last = buf;
|
||||
diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp
|
||||
index 95ec9adc62b..bdbb9870c57 100644
|
||||
--- a/gdb/testsuite/gdb.base/morestack.exp
|
||||
+++ b/gdb/testsuite/gdb.base/morestack.exp
|
||||
@@ -21,17 +21,13 @@ if {$gcc_compiled == 0} {
|
||||
return -1
|
||||
}
|
||||
|
||||
-if { [have_fuse_ld_gold] == 0} {
|
||||
- return -1
|
||||
-}
|
||||
-
|
||||
standard_testfile
|
||||
|
||||
# -fuse-ld=gold is used for calling printf code built without -fsplit-stack
|
||||
# which could crash otherwise. See GCC documentation of -fsplit-stack.
|
||||
set opts "additional_flags=-fsplit-stack"
|
||||
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile \
|
||||
- [list $opts additional_flags=-fuse-ld=gold]] } {
|
||||
+ [list $opts]] } {
|
||||
return -1
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
Index: gdb-10.1/gdb/testsuite/gdb.tui/new-layout.exp
|
||||
===================================================================
|
||||
--- gdb-10.1.orig/gdb/testsuite/gdb.tui/new-layout.exp
|
||||
+++ gdb-10.1/gdb/testsuite/gdb.tui/new-layout.exp
|
||||
@@ -42,12 +42,14 @@ gdb_test "tui new-layout example src 1 s
|
||||
"Window \"src\" seen twice in layout"
|
||||
gdb_test "tui new-layout example src 1" \
|
||||
"New layout does not contain the \"cmd\" window"
|
||||
-gdb_test "tui new-layout example src 1}" \
|
||||
- "Extra '}' in layout specification"
|
||||
-gdb_test "tui new-layout example {src 1} 1}" \
|
||||
- "Extra '}' in layout specification"
|
||||
-gdb_test "tui new-layout example {src 1" \
|
||||
- "Missing '}' in layout specification"
|
||||
+if { [tcl_version_at_least 8 6] } {
|
||||
+ gdb_test "tui new-layout example src 1\}" \
|
||||
+ "Extra '\}' in layout specification"
|
||||
+ gdb_test "tui new-layout example {src 1} 1\}" \
|
||||
+ "Extra '\}' in layout specification"
|
||||
+ gdb_test "tui new-layout example \{src 1" \
|
||||
+ "Missing '\}' in layout specification"
|
||||
+}
|
||||
|
||||
gdb_test_no_output "tui new-layout example asm 1 status 0 cmd 1"
|
||||
|
@ -0,0 +1,170 @@
|
||||
[gdb/testsuite] Handle SIGILL in gdb.reverse/insn-reverse.exp
|
||||
|
||||
Consider test-case gdb.reverse/insn-reverse.exp.
|
||||
|
||||
It runs a number of subtests, dependent on the architecture, f.i. for
|
||||
x86_64 it runs subtests rdrand and rdseed.
|
||||
|
||||
For each subtest, it checks whether the subtest is supported and otherwise
|
||||
bails out of that subtest.
|
||||
|
||||
However, there may be a problem with the support test or the information it
|
||||
relies on, and if it states that a subtest is supported while it is actually
|
||||
not, we may run into a SIGILL, as f.i. described in PR21166, which results in
|
||||
tcl errors like this:
|
||||
...
|
||||
ERROR: tcl error sourcing src/gdb/testsuite/gdb.reverse/insn-reverse.exp.
|
||||
ERROR: can't read "insn_array(5)": no such element in array
|
||||
...
|
||||
|
||||
We can emulate this by inserting a sigfpe in function rdrand in
|
||||
insn-reverse-x86.c, like this:
|
||||
...
|
||||
volatile int a = 0; volatile int b = 1; volatile int c = b / a;
|
||||
...
|
||||
|
||||
The problem is that the loop in the test-case attempts to stepi over of all
|
||||
insn in rdrand, but because of the signal it will never get to the last insn.
|
||||
|
||||
Handle this by detecting that the stepi made no progress, and bailing out of
|
||||
the loop.
|
||||
|
||||
Furthermore, make running of the subtests independent, such that a SIGILL in
|
||||
subtest rdrand does not affect running of subtest rdseed.
|
||||
|
||||
Tested on x86_64-linux.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-11-25 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.reverse/insn-reverse.c (test_nr): New var.
|
||||
(usage, parse_args): New function.
|
||||
(main): Call parse_args. Only run test for test_nr.
|
||||
* gdb.reverse/insn-reverse.exp: Detect lack of progress in stepi loop
|
||||
and bail out. Run subtests individually, using an inferior arg
|
||||
specifying the subtest.
|
||||
|
||||
---
|
||||
gdb/testsuite/gdb.reverse/insn-reverse.c | 43 +++++++++++++++++++++++++++---
|
||||
gdb/testsuite/gdb.reverse/insn-reverse.exp | 15 +++++++++--
|
||||
2 files changed, 52 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.c b/gdb/testsuite/gdb.reverse/insn-reverse.c
|
||||
index 08d382d080b..b3881d44251 100644
|
||||
--- a/gdb/testsuite/gdb.reverse/insn-reverse.c
|
||||
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.c
|
||||
@@ -15,6 +15,9 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
+#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+
|
||||
typedef void (*testcase_ftype) (void);
|
||||
|
||||
/* The arch-specific files need to implement both the initialize function
|
||||
@@ -45,16 +48,48 @@ initialize (void)
|
||||
array is defined together with them. */
|
||||
static int n_testcases = (sizeof (testcases) / sizeof (testcase_ftype));
|
||||
|
||||
+static void
|
||||
+usage (void)
|
||||
+{
|
||||
+ printf ("usage: insn-reverse <0-%d>\n", n_testcases - 1);
|
||||
+}
|
||||
+
|
||||
+static int test_nr;
|
||||
+
|
||||
+static void
|
||||
+parse_args (int argc, char **argv)
|
||||
+{
|
||||
+ if (argc != 2)
|
||||
+ {
|
||||
+ usage ();
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ char *tail;
|
||||
+ test_nr = strtol (argv[1], &tail, 10);
|
||||
+ if (*tail != '\0')
|
||||
+ {
|
||||
+ usage ();
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ int in_range_p = 0 <= test_nr && test_nr < n_testcases;
|
||||
+ if (!in_range_p)
|
||||
+ {
|
||||
+ usage ();
|
||||
+ exit (1);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
int
|
||||
-main ()
|
||||
+main (int argc, char **argv)
|
||||
{
|
||||
- int i = 0;
|
||||
+ parse_args (argc, argv);
|
||||
|
||||
/* Initialize any required arch-specific bits. */
|
||||
initialize ();
|
||||
|
||||
- for (i = 0; i < n_testcases; i++)
|
||||
- testcases[i] ();
|
||||
+ testcases[test_nr] ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
|
||||
index 174b7957517..5627f9d2605 100644
|
||||
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
|
||||
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
|
||||
@@ -50,11 +50,14 @@ proc read_testcase { n } {
|
||||
# the contents of registers are saved, and test compares them. If
|
||||
# there is any differences, a FAIL is emitted.
|
||||
|
||||
-proc test { func } {
|
||||
+proc test { func testcase_nr } {
|
||||
global hex decimal
|
||||
global gdb_prompt
|
||||
|
||||
with_test_prefix "$func" {
|
||||
+ gdb_start_cmd $testcase_nr
|
||||
+ gdb_test "" "" "wait for prompt"
|
||||
+
|
||||
gdb_breakpoint $func
|
||||
gdb_test "continue"
|
||||
|
||||
@@ -74,15 +77,23 @@ proc test { func } {
|
||||
|
||||
# Registers contents before each forward single step.
|
||||
set count 0
|
||||
+ set insn_addr ""
|
||||
for {} {$count < 500} {incr count} {
|
||||
gdb_test_multiple "x/i \$pc" "" {
|
||||
-re ".* ($hex) <.*>:\[ \t\]*(.*)\r\n$gdb_prompt $" {
|
||||
+ set prev_insn_addr $insn_addr
|
||||
set insn_addr $expect_out(1,string)
|
||||
|
||||
if [expr {$last_insn == $insn_addr}] {
|
||||
break
|
||||
}
|
||||
|
||||
+ if [expr {$prev_insn_addr == $insn_addr}] {
|
||||
+ # Failed to make progress, might have run into SIGILL.
|
||||
+ unsupported "no progress at: $expect_out(2,string)"
|
||||
+ break
|
||||
+ }
|
||||
+
|
||||
set insn_array($count) $expect_out(2,string)
|
||||
}
|
||||
}
|
||||
@@ -125,5 +136,5 @@ if { ${n_testcases} == 0 } {
|
||||
for { set i 0 } { ${i} < ${n_testcases} } { incr i } {
|
||||
set testcase [read_testcase $i]
|
||||
|
||||
- test $testcase
|
||||
+ test $testcase $i
|
||||
}
|
66
gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch
Normal file
66
gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch
Normal file
@ -0,0 +1,66 @@
|
||||
[gdb/testsuite] Prevent pagination in GDB_INTERNALFLAGS
|
||||
|
||||
When running test-case gdb.base/corefile.exp with target board readnow, we run
|
||||
into:
|
||||
...
|
||||
Reading symbols from outputs/gdb.base/corefile/corefile...^M
|
||||
Expanding full symbols from outputs/gdb.base/corefile/corefile...^M
|
||||
[New LWP 2293]^M
|
||||
Core was generated by `outputs/gdb.base/corefile/co'.^M
|
||||
Program terminated with signal SIGABRT, Aborted.^M
|
||||
--Type <RET> for more, q to quit, c to continue without paging--\
|
||||
FAIL: gdb.base/corefile.exp: (timeout) starting with -core
|
||||
...
|
||||
|
||||
In commit bd447abb24 "Make gdb.base/corefile.exp work on terminals with few
|
||||
rows", pagination (in the same test-case) is prevented using:
|
||||
...
|
||||
set stty_init "rows 25 cols 80"
|
||||
...
|
||||
but this doesn't work in our case because using -readnow adds an extra line
|
||||
"Expanding full symbols".
|
||||
|
||||
The test passes when increasing rows to 26. However, increasing the rows by
|
||||
some n only fixes the problem for n lines, and things will break again if
|
||||
somehow we end up with n + 1 lines.
|
||||
|
||||
Instead, fix this by setting heigth and width in INTERNAL_GDBFLAGS. This
|
||||
solution was not chosen in commit bd447abb24 because it doesn't handle
|
||||
pagination due to the introduction text. But it does handle the pagination
|
||||
due to the extra "Expanding full symbols", and any other line printed during
|
||||
and after file loading.
|
||||
|
||||
Tested on x86_64-linux, with and without readnow.
|
||||
|
||||
With -readnow, fixes timeout FAILs in gdb.base/corefile.exp and
|
||||
gdb.base/reread-readsym.exp.
|
||||
|
||||
gdb/testsuite/ChangeLog:
|
||||
|
||||
2020-10-26 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* lib/gdb.exp (INTERNAL_GDBFLAGS): Set heigth and width.
|
||||
|
||||
---
|
||||
gdb/testsuite/lib/gdb.exp | 8 +++++++-
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
||||
index f53df59f181..197542eec3b 100644
|
||||
--- a/gdb/testsuite/lib/gdb.exp
|
||||
+++ b/gdb/testsuite/lib/gdb.exp
|
||||
@@ -124,7 +124,13 @@ set BUILD_DATA_DIRECTORY "[pwd]/../data-directory"
|
||||
# INTERNAL_GDBFLAGS contains flags that the testsuite requires.
|
||||
global INTERNAL_GDBFLAGS
|
||||
if ![info exists INTERNAL_GDBFLAGS] {
|
||||
- set INTERNAL_GDBFLAGS "-nw -nx -data-directory $BUILD_DATA_DIRECTORY"
|
||||
+ set INTERNAL_GDBFLAGS \
|
||||
+ [join [list \
|
||||
+ "-nw" \
|
||||
+ "-nx" \
|
||||
+ "-data-directory $BUILD_DATA_DIRECTORY" \
|
||||
+ {-iex "set height 0"} \
|
||||
+ {-iex "set width 0"}]]
|
||||
}
|
||||
|
||||
# The variable gdb_prompt is a regexp which matches the gdb prompt.
|
@ -1,41 +0,0 @@
|
||||
Index: gdb-9.1/gdb/infrun.c
|
||||
===================================================================
|
||||
--- gdb-9.1.orig/gdb/infrun.c
|
||||
+++ gdb-9.1/gdb/infrun.c
|
||||
@@ -4354,7 +4354,12 @@ stop_all_threads (void)
|
||||
|
||||
/* The thread may be not executing, but still be
|
||||
resumed with a pending status to process. */
|
||||
- t->resumed = 0;
|
||||
+ if (t->suspend.waitstatus.kind == TARGET_WAITKIND_SIGNALLED
|
||||
+ && t->suspend.waitstatus.value.sig == GDB_SIGNAL_KILL
|
||||
+ && t->suspend.waitstatus_pending_p)
|
||||
+ ;
|
||||
+ else
|
||||
+ t->resumed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4376,10 +4381,18 @@ stop_all_threads (void)
|
||||
target_pid_to_str (event_ptid).c_str ());
|
||||
}
|
||||
|
||||
- if (ws.kind == TARGET_WAITKIND_NO_RESUMED
|
||||
- || ws.kind == TARGET_WAITKIND_THREAD_EXITED
|
||||
- || ws.kind == TARGET_WAITKIND_EXITED
|
||||
- || ws.kind == TARGET_WAITKIND_SIGNALLED)
|
||||
+ if (ws.kind == TARGET_WAITKIND_SIGNALLED
|
||||
+ && ws.value.sig == GDB_SIGNAL_KILL)
|
||||
+ {
|
||||
+ thread_info *t = find_thread_ptid (event_ptid);
|
||||
+ save_waitstatus (t, &ws);
|
||||
+ t->resumed = 1;
|
||||
+ t->executing = 0;
|
||||
+ }
|
||||
+ else if (ws.kind == TARGET_WAITKIND_NO_RESUMED
|
||||
+ || ws.kind == TARGET_WAITKIND_THREAD_EXITED
|
||||
+ || ws.kind == TARGET_WAITKIND_EXITED
|
||||
+ || ws.kind == TARGET_WAITKIND_SIGNALLED)
|
||||
{
|
||||
/* All resumed threads exited
|
||||
or one thread/process exited/signalled. */
|
47
gdb-tui-enable-work-around-libncurses-segfault.patch
Normal file
47
gdb-tui-enable-work-around-libncurses-segfault.patch
Normal file
@ -0,0 +1,47 @@
|
||||
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
|
||||
index 828e42bccf7..551a72e3992 100644
|
||||
--- a/gdb/tui/tui.c
|
||||
+++ b/gdb/tui/tui.c
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
/* Tells whether the TUI is active or not. */
|
||||
bool tui_active = false;
|
||||
-static bool tui_finish_init = true;
|
||||
+static int tui_init = -1;
|
||||
|
||||
enum tui_key_mode tui_current_key_mode = TUI_COMMAND_MODE;
|
||||
|
||||
@@ -363,7 +363,13 @@ tui_enable (void)
|
||||
/* To avoid to initialize curses when gdb starts, there is a deferred
|
||||
curses initialization. This initialization is made only once
|
||||
and the first time the curses mode is entered. */
|
||||
- if (tui_finish_init)
|
||||
+ if (tui_init == 0)
|
||||
+ {
|
||||
+ /* Initalization failed before, just throw a generic error, don't try
|
||||
+ again. Workaround for segfault in libncurses5 bsc#1179210. */
|
||||
+ error (_("Cannot enable the TUI"));
|
||||
+ }
|
||||
+ else if (tui_init == -1)
|
||||
{
|
||||
WINDOW *w;
|
||||
SCREEN *s;
|
||||
@@ -383,6 +389,8 @@ tui_enable (void)
|
||||
if (!gdb_stderr->isatty ())
|
||||
error (_("Cannot enable the TUI when output is not a terminal"));
|
||||
|
||||
+ tui_init = 0;
|
||||
+
|
||||
s = newterm (NULL, stdout, stdin);
|
||||
#ifdef __MINGW32__
|
||||
/* The MinGW port of ncurses requires $TERM to be unset in order
|
||||
@@ -435,7 +443,8 @@ tui_enable (void)
|
||||
tui_set_win_focus_to (TUI_SRC_WIN);
|
||||
keypad (TUI_CMD_WIN->handle.get (), TRUE);
|
||||
wrefresh (TUI_CMD_WIN->handle.get ());
|
||||
- tui_finish_init = false;
|
||||
+
|
||||
+ tui_init = 1;
|
||||
}
|
||||
else
|
||||
{
|
@ -22,15 +22,13 @@ And adjust its testcase.
|
||||
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
|
||||
--- a/gdb/f-valprint.c
|
||||
+++ b/gdb/f-valprint.c
|
||||
@@ -319,8 +319,22 @@ f_val_print (struct type *type, int embedded_offset,
|
||||
original_value, &opts, 0, stream);
|
||||
@@ -310,7 +310,21 @@ f_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
|
||||
value_print_scalar_formatted (val, &opts, 0, stream);
|
||||
}
|
||||
else
|
||||
- val_print_scalar_formatted (type, embedded_offset,
|
||||
- original_value, options, 0, stream);
|
||||
- value_print_scalar_formatted (val, options, 0, stream);
|
||||
+ {
|
||||
+ val_print_scalar_formatted (type, embedded_offset,
|
||||
+ original_value, options, 0, stream);
|
||||
+ value_print_scalar_formatted (val, options, 0, stream);
|
||||
+ /* C and C++ has no single byte int type, char is used instead.
|
||||
+ Since we don't know whether the value is really intended to
|
||||
+ be used as an integer or a character, print the character
|
||||
@ -40,7 +38,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
|
||||
+ LONGEST c;
|
||||
+
|
||||
+ fputs_filtered (" ", stream);
|
||||
+ c = unpack_long (type, valaddr + embedded_offset);
|
||||
+ c = unpack_long (type, valaddr);
|
||||
+ LA_PRINT_CHAR ((unsigned char) c, type, stream);
|
||||
+ }
|
||||
+ }
|
||||
@ -50,7 +48,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
|
||||
diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/printing-types.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/printing-types.exp
|
||||
@@ -29,7 +29,7 @@ if {![runto MAIN__]} then {
|
||||
@@ -30,7 +30,7 @@ if {![fortran_runto_main]} then {
|
||||
gdb_breakpoint [gdb_get_line_number "write"]
|
||||
gdb_continue_to_breakpoint "write"
|
||||
|
||||
|
@ -37,7 +37,7 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922
|
||||
diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
--- a/gdb/eval.c
|
||||
+++ b/gdb/eval.c
|
||||
@@ -372,29 +372,324 @@ init_array_element (struct value *array, struct value *element,
|
||||
@@ -371,29 +371,323 @@ init_array_element (struct value *array, struct value *element,
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -56,16 +56,16 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
{
|
||||
- int pc = (*pos) + 1;
|
||||
- LONGEST low_bound, high_bound;
|
||||
- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
|
||||
- struct type *range = check_typedef (value_type (array)->index_type ());
|
||||
- enum range_type range_type
|
||||
- = (enum range_type) longest_to_int (exp->elts[pc].longconst);
|
||||
-
|
||||
- *pos += 3;
|
||||
-
|
||||
- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
|
||||
- low_bound = TYPE_LOW_BOUND (range);
|
||||
- low_bound = range->bounds ()->low.const_val ();
|
||||
- else
|
||||
- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
|
||||
- low_bound = value_as_long (evaluate_subexp (nullptr, exp, pos, noside));
|
||||
+ int i, dim_count = 0;
|
||||
+ struct value *new_array = array;
|
||||
+ struct type *array_type = check_typedef (value_type (new_array));
|
||||
@ -139,16 +139,16 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ upper bound. */
|
||||
+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND)
|
||||
+ == SUBARRAY_LOW_BOUND)
|
||||
+ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
|
||||
+ range->low = value_as_long (evaluate_subexp (nullptr, exp,
|
||||
+ pos, noside));
|
||||
+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
|
||||
+ == SUBARRAY_HIGH_BOUND)
|
||||
+ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
|
||||
+ range->high = value_as_long (evaluate_subexp (nullptr, exp,
|
||||
+ pos, noside));
|
||||
+
|
||||
+ /* Assign the user's stride value if provided. */
|
||||
+ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
|
||||
+ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp,
|
||||
+ range->stride = value_as_long (evaluate_subexp (nullptr, exp,
|
||||
+ pos, noside));
|
||||
+
|
||||
+ /* Assign the default stride value '1'. */
|
||||
@ -156,9 +156,9 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ range->stride = 1;
|
||||
|
||||
- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
|
||||
- high_bound = TYPE_HIGH_BOUND (range);
|
||||
- high_bound = range->bounds ()->high.const_val ();
|
||||
- else
|
||||
- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
|
||||
- high_bound = value_as_long (evaluate_subexp (nullptr, exp, pos, noside));
|
||||
+ /* Check the provided stride value is illegal, aka '0'. */
|
||||
+ if (range->stride == 0)
|
||||
+ error (_("Stride must not be 0"));
|
||||
@ -183,7 +183,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ for (i = nargs - 1; i >= 0; i--)
|
||||
+ {
|
||||
+ struct subscript_store *index = &subscript_array[i];
|
||||
+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
|
||||
+ struct type *index_type = array_type->index_type ();
|
||||
+
|
||||
+ switch (index->kind)
|
||||
+ {
|
||||
@ -199,17 +199,17 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ /* If no lower bound was provided by the user, we take the
|
||||
+ default boundary. Same for the high bound. */
|
||||
+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0)
|
||||
+ range->low = TYPE_LOW_BOUND (index_type);
|
||||
+ range->low = index_type->bounds ()->low.const_val ();
|
||||
+
|
||||
+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0)
|
||||
+ range->high = TYPE_HIGH_BOUND (index_type);
|
||||
+ range->high = index_type->bounds ()->high.const_val ();
|
||||
+
|
||||
+ /* Both user provided low and high bound have to be inside the
|
||||
+ array bounds. Throw an error if not. */
|
||||
+ if (range->low < TYPE_LOW_BOUND (index_type)
|
||||
+ || range->low > TYPE_HIGH_BOUND (index_type)
|
||||
+ || range->high < TYPE_LOW_BOUND (index_type)
|
||||
+ || range->high > TYPE_HIGH_BOUND (index_type))
|
||||
+ if (range->low < index_type->bounds ()->low.const_val ()
|
||||
+ || range->low > index_type->bounds ()->high.const_val ()
|
||||
+ || range->high < index_type->bounds ()->low.const_val ()
|
||||
+ || range->high > index_type->bounds ()->high.const_val ())
|
||||
+ error (_("provided bound(s) outside array bound(s)"));
|
||||
+
|
||||
+ /* For a negative stride the lower boundary must be larger than the
|
||||
@ -241,7 +241,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ for (i = nargs - 1; i >= 0; i--)
|
||||
+ {
|
||||
+ struct subscript_store *index = &subscript_array[i];
|
||||
+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
|
||||
+ struct type *index_type = array_type->index_type ();
|
||||
+
|
||||
+ switch (index->kind)
|
||||
+ {
|
||||
@ -289,12 +289,12 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ cannot do the range checks for us. So we have to make sure
|
||||
+ ourselves that the user provided index is inside the
|
||||
+ array bounds. Throw an error if not. */
|
||||
+ if (index->U.number < TYPE_LOW_BOUND (index_type)
|
||||
+ && index->U.number > TYPE_HIGH_BOUND (index_type))
|
||||
+ if (index->U.number < index_type->bounds ()->low.const_val ()
|
||||
+ && index->U.number > index_type->bounds ()->high.const_val ())
|
||||
+ error (_("provided bound(s) outside array bound(s)"));
|
||||
+
|
||||
+ if (index->U.number > TYPE_LOW_BOUND (index_type)
|
||||
+ && index->U.number > TYPE_HIGH_BOUND (index_type))
|
||||
+ if (index->U.number > index_type->bounds ()->low.const_val ()
|
||||
+ && index->U.number > index_type->bounds ()->high.const_val ())
|
||||
+ error (_("provided bound(s) outside array bound(s)"));
|
||||
+
|
||||
+ new_array = value_slice_1 (new_array,
|
||||
@ -364,8 +364,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
+ elt_type,
|
||||
+ range_type);
|
||||
+
|
||||
+ TYPE_CODE (interim_array_type)
|
||||
+ = TYPE_CODE (value_type (new_array));
|
||||
+ interim_array_type->set_code ( value_type (new_array)->code ());
|
||||
+
|
||||
+ v = allocate_value (interim_array_type);
|
||||
+
|
||||
@ -381,7 +380,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
}
|
||||
|
||||
|
||||
@@ -1235,19 +1530,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
||||
@@ -1233,19 +1527,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
|
||||
return eval_call (exp, noside, nargs, argvec, var_func_name, expect_type);
|
||||
}
|
||||
|
||||
@ -395,13 +394,13 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
- enum noside noside)
|
||||
-{
|
||||
- for (int i = 0; i < nargs; ++i)
|
||||
- evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
- evaluate_subexp (nullptr, exp, pos, noside);
|
||||
-}
|
||||
-
|
||||
struct value *
|
||||
evaluate_subexp_standard (struct type *expect_type,
|
||||
struct expression *exp, int *pos,
|
||||
@@ -1942,33 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
/* Return true if type is integral or reference to integral */
|
||||
|
||||
static bool
|
||||
@@ -1953,33 +2234,8 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
switch (code)
|
||||
{
|
||||
case TYPE_CODE_ARRAY:
|
||||
@ -436,7 +435,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_FUNC:
|
||||
@@ -2388,49 +2645,6 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
@@ -2400,49 +2656,6 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
}
|
||||
return (arg1);
|
||||
|
||||
@ -484,22 +483,22 @@ diff --git a/gdb/eval.c b/gdb/eval.c
|
||||
- }
|
||||
-
|
||||
case BINOP_LOGICAL_AND:
|
||||
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
arg1 = evaluate_subexp (nullptr, exp, pos, noside);
|
||||
if (noside == EVAL_SKIP)
|
||||
@@ -3350,6 +3564,9 @@ calc_f77_array_dims (struct type *array_type)
|
||||
@@ -3360,6 +3573,9 @@ calc_f77_array_dims (struct type *array_type)
|
||||
int ndimen = 1;
|
||||
struct type *tmp_type;
|
||||
|
||||
+ if (TYPE_CODE (array_type) == TYPE_CODE_STRING)
|
||||
+ if (array_type->code () == TYPE_CODE_STRING)
|
||||
+ return 1;
|
||||
+
|
||||
if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
|
||||
if ((array_type->code () != TYPE_CODE_ARRAY))
|
||||
error (_("Can't get dimensions for a non-array type"));
|
||||
|
||||
diff --git a/gdb/expprint.c b/gdb/expprint.c
|
||||
--- a/gdb/expprint.c
|
||||
+++ b/gdb/expprint.c
|
||||
@@ -580,17 +580,14 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
@@ -576,17 +576,14 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
longest_to_int (exp->elts[pc + 1].longconst);
|
||||
*pos += 2;
|
||||
|
||||
@ -521,7 +520,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
|
||||
print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
|
||||
fputs_filtered (")", stream);
|
||||
return;
|
||||
@@ -1107,22 +1104,24 @@ dump_subexp_body_standard (struct expression *exp,
|
||||
@@ -1103,22 +1100,24 @@ dump_subexp_body_standard (struct expression *exp,
|
||||
|
||||
switch (range_type)
|
||||
{
|
||||
@ -554,7 +553,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
|
||||
fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream);
|
||||
break;
|
||||
default:
|
||||
@@ -1130,11 +1129,9 @@ dump_subexp_body_standard (struct expression *exp,
|
||||
@@ -1126,11 +1125,9 @@ dump_subexp_body_standard (struct expression *exp,
|
||||
break;
|
||||
}
|
||||
|
||||
@ -710,18 +709,9 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
|
||||
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
|
||||
--- a/gdb/gdbtypes.c
|
||||
+++ b/gdb/gdbtypes.c
|
||||
@@ -936,7 +936,7 @@ create_range_type (struct type *result_type, struct type *index_type,
|
||||
TYPE_RANGE_DATA (result_type)->high = *high_bound;
|
||||
TYPE_RANGE_DATA (result_type)->bias = bias;
|
||||
|
||||
- /* Initialize the stride to be a constant, the value will already be zero
|
||||
+ /* bias the stride to be a constant, the value will already be zero
|
||||
thanks to the use of TYPE_ZALLOC above. */
|
||||
TYPE_RANGE_DATA (result_type)->stride.kind = PROP_CONST;
|
||||
|
||||
@@ -1001,7 +1001,8 @@ create_static_range_type (struct type *result_type, struct type *index_type,
|
||||
high.kind = PROP_CONST;
|
||||
high.data.const_val = high_bound;
|
||||
@@ -1006,7 +1006,8 @@ create_static_range_type (struct type *result_type, struct type *index_type,
|
||||
low.set_const_val (low_bound);
|
||||
high.set_const_val (high_bound);
|
||||
|
||||
- result_type = create_range_type (result_type, index_type, &low, &high, 0);
|
||||
+ result_type = create_range_type (result_type, index_type,
|
||||
@ -729,29 +719,13 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
|
||||
|
||||
return result_type;
|
||||
}
|
||||
@@ -1236,6 +1237,7 @@ create_array_type_with_stride (struct type *result_type,
|
||||
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
|
||||
low_bound = high_bound = 0;
|
||||
element_type = check_typedef (element_type);
|
||||
+
|
||||
/* Be careful when setting the array length. Ada arrays can be
|
||||
empty arrays with the high_bound being smaller than the low_bound.
|
||||
In such cases, the array length should be zero. */
|
||||
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
--- a/gdb/gdbtypes.h
|
||||
+++ b/gdb/gdbtypes.h
|
||||
@@ -803,7 +803,6 @@ struct main_type
|
||||
/* * Union member used for range types. */
|
||||
@@ -1615,6 +1615,15 @@ extern unsigned type_align (struct type *);
|
||||
space in struct type. */
|
||||
extern bool set_type_align (struct type *, ULONGEST);
|
||||
|
||||
struct range_bounds *bounds;
|
||||
-
|
||||
} flds_bnds;
|
||||
|
||||
/* * Slot to point to additional language-specific fields of this
|
||||
@@ -1365,6 +1364,15 @@ extern bool set_type_align (struct type *, ULONGEST);
|
||||
#define TYPE_BIT_STRIDE(range_type) \
|
||||
(TYPE_RANGE_DATA(range_type)->stride.data.const_val \
|
||||
* (TYPE_RANGE_DATA(range_type)->flag_is_byte_stride ? 8 : 1))
|
||||
+#define TYPE_BYTE_STRIDE(range_type) \
|
||||
+ TYPE_RANGE_DATA(range_type)->stride.data.const_val
|
||||
+#define TYPE_BYTE_STRIDE_BLOCK(range_type) \
|
||||
@ -761,19 +735,36 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
||||
+#define TYPE_BYTE_STRIDE_KIND(range_type) \
|
||||
+ TYPE_RANGE_DATA(range_type)->stride.kind
|
||||
+
|
||||
|
||||
/* Property accessors for the type data location. */
|
||||
#define TYPE_DATA_LOCATION(thistype) \
|
||||
@@ -1400,6 +1408,9 @@ extern bool set_type_align (struct type *, ULONGEST);
|
||||
TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
|
||||
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
|
||||
TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
|
||||
+#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \
|
||||
+ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0)
|
||||
+
|
||||
((thistype)->dyn_prop (DYN_PROP_DATA_LOCATION))
|
||||
@@ -1633,6 +1642,26 @@ extern bool set_type_align (struct type *, ULONGEST);
|
||||
#define TYPE_ASSOCIATED_PROP(thistype) \
|
||||
((thistype)->dyn_prop (DYN_PROP_ASSOCIATED))
|
||||
|
||||
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
|
||||
(TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
|
||||
+/* Accessors for struct range_bounds data attached to an array type's
|
||||
+ index type. */
|
||||
+
|
||||
+#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \
|
||||
+ ((arraytype)->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED)
|
||||
+#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
|
||||
+ (arraytype->index_type ()->bounds ().low.kind () == PROP_UNDEFINED)
|
||||
+#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \
|
||||
+ (TYPE_BYTE_STRIDE(arraytype->index_type ()) == 0)
|
||||
+
|
||||
+
|
||||
+#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
|
||||
+ (TYPE_HIGH_BOUND((arraytype)->index_type ()))
|
||||
+
|
||||
+#define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
|
||||
+ (TYPE_LOW_BOUND((arraytype)->index_type ()))
|
||||
+
|
||||
+#define TYPE_ARRAY_BIT_STRIDE(arraytype) \
|
||||
+ (TYPE_BIT_STRIDE((arraytype)->index_type ()))
|
||||
+
|
||||
/* C++ */
|
||||
|
||||
#define TYPE_SELF_TYPE(thistype) internal_type_self_type (thistype)
|
||||
diff --git a/gdb/parse.c b/gdb/parse.c
|
||||
--- a/gdb/parse.c
|
||||
+++ b/gdb/parse.c
|
||||
@ -856,33 +847,33 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
|
||||
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
|
||||
--- a/gdb/rust-lang.c
|
||||
+++ b/gdb/rust-lang.c
|
||||
@@ -1224,13 +1224,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
|
||||
@@ -1082,13 +1082,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
|
||||
kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
|
||||
*pos += 3;
|
||||
|
||||
- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT
|
||||
- || kind == NONE_BOUND_DEFAULT_EXCLUSIVE)
|
||||
+ if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
|
||||
low = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
low = evaluate_subexp (nullptr, exp, pos, noside);
|
||||
- if (kind == LOW_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT_EXCLUSIVE
|
||||
- || kind == NONE_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT_EXCLUSIVE)
|
||||
+ if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
|
||||
high = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
high = evaluate_subexp (nullptr, exp, pos, noside);
|
||||
- bool inclusive = (kind == NONE_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT);
|
||||
+ bool inclusive = (!((kind & SUBARRAY_HIGH_BOUND_EXCLUSIVE) == SUBARRAY_HIGH_BOUND_EXCLUSIVE));
|
||||
|
||||
if (noside == EVAL_SKIP)
|
||||
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
|
||||
@@ -1319,7 +1317,7 @@ rust_compute_range (struct type *type, struct value *range,
|
||||
@@ -1177,7 +1175,7 @@ rust_compute_range (struct type *type, struct value *range,
|
||||
|
||||
*low = 0;
|
||||
*high = 0;
|
||||
- *kind = BOTH_BOUND_DEFAULT;
|
||||
+ *kind = SUBARRAY_NONE_BOUND;
|
||||
|
||||
if (TYPE_NFIELDS (type) == 0)
|
||||
if (type->num_fields () == 0)
|
||||
return;
|
||||
@@ -1327,15 +1325,14 @@ rust_compute_range (struct type *type, struct value *range,
|
||||
@@ -1185,15 +1183,14 @@ rust_compute_range (struct type *type, struct value *range,
|
||||
i = 0;
|
||||
if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
|
||||
{
|
||||
@ -891,7 +882,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
|
||||
*low = value_as_long (value_field (range, 0));
|
||||
++i;
|
||||
}
|
||||
if (TYPE_NFIELDS (type) > i
|
||||
if (type->num_fields () > i
|
||||
&& strcmp (TYPE_FIELD_NAME (type, i), "end") == 0)
|
||||
{
|
||||
- *kind = (*kind == BOTH_BOUND_DEFAULT
|
||||
@ -900,7 +891,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
|
||||
*high = value_as_long (value_field (range, i));
|
||||
|
||||
if (rust_inclusive_range_type_p (type))
|
||||
@@ -1353,7 +1350,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
||||
@@ -1211,7 +1208,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
||||
struct type *rhstype;
|
||||
LONGEST low, high_bound;
|
||||
/* Initialized to appease the compiler. */
|
||||
@ -909,7 +900,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
|
||||
LONGEST high = 0;
|
||||
int want_slice = 0;
|
||||
|
||||
@@ -1451,7 +1448,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
||||
@@ -1309,7 +1306,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
||||
error (_("Cannot subscript non-array type"));
|
||||
|
||||
if (want_slice
|
||||
@ -918,7 +909,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
|
||||
low = low_bound;
|
||||
if (low < 0)
|
||||
error (_("Index less than zero"));
|
||||
@@ -1469,7 +1466,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
||||
@@ -1327,7 +1324,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
||||
CORE_ADDR addr;
|
||||
struct value *addrval, *tem;
|
||||
|
||||
@ -1416,7 +1407,7 @@ new file mode 100644
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
|
||||
@@ -32,7 +32,8 @@ gdb_test "print sizeof(vla1)" " = 0" "print sizeof non-allocated vla1"
|
||||
@@ -35,7 +35,8 @@ gdb_test "print sizeof(vla1)" " = 0" "print sizeof non-allocated vla1"
|
||||
gdb_test "print sizeof(vla1(3,2,1))" \
|
||||
"no such vector element \\(vector not allocated\\)" \
|
||||
"print sizeof non-allocated indexed vla1"
|
||||
@ -1426,7 +1417,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortra
|
||||
"print sizeof non-allocated sliced vla1"
|
||||
|
||||
# Try to access value in allocated VLA
|
||||
@@ -41,7 +42,7 @@ gdb_continue_to_breakpoint "vla1-allocated"
|
||||
@@ -44,7 +45,7 @@ gdb_continue_to_breakpoint "vla1-allocated"
|
||||
gdb_test "print sizeof(vla1)" " = 4000" "print sizeof allocated vla1"
|
||||
gdb_test "print sizeof(vla1(3,2,1))" "4" \
|
||||
"print sizeof element from allocated vla1"
|
||||
@ -1435,7 +1426,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortra
|
||||
"print sizeof sliced vla1"
|
||||
|
||||
# Try to access values in undefined pointer to VLA (dangling)
|
||||
@@ -49,7 +50,8 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla"
|
||||
@@ -52,7 +53,8 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla"
|
||||
gdb_test "print sizeof(pvla(3,2,1))" \
|
||||
"no such vector element \\(vector not associated\\)" \
|
||||
"print sizeof non-associated indexed pvla"
|
||||
@ -1445,7 +1436,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortra
|
||||
"print sizeof non-associated sliced pvla"
|
||||
|
||||
# Try to access values in pointer to VLA and compare them
|
||||
@@ -58,7 +60,8 @@ gdb_continue_to_breakpoint "pvla-associated"
|
||||
@@ -61,7 +63,8 @@ gdb_continue_to_breakpoint "pvla-associated"
|
||||
gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
|
||||
gdb_test "print sizeof(pvla(3,2,1))" "4" \
|
||||
"print sizeof element from associated pvla"
|
||||
@ -1544,7 +1535,7 @@ new file mode 100644
|
||||
diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
--- a/gdb/valops.c
|
||||
+++ b/gdb/valops.c
|
||||
@@ -3797,13 +3797,42 @@ value_of_this_silent (const struct language_defn *lang)
|
||||
@@ -3756,13 +3756,42 @@ value_of_this_silent (const struct language_defn *lang)
|
||||
|
||||
struct value *
|
||||
value_slice (struct value *array, int lowbound, int length)
|
||||
@ -1588,25 +1579,25 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
- array_type = check_typedef (value_type (array));
|
||||
+ /* Check for legacy code if we are actually dealing with an array or
|
||||
+ string. */
|
||||
if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
|
||||
&& TYPE_CODE (array_type) != TYPE_CODE_STRING)
|
||||
if (array_type->code () != TYPE_CODE_ARRAY
|
||||
&& array_type->code () != TYPE_CODE_STRING)
|
||||
error (_("cannot take slice of non-array"));
|
||||
@@ -3813,45 +3842,155 @@ value_slice (struct value *array, int lowbound, int length)
|
||||
@@ -3772,45 +3801,155 @@ value_slice (struct value *array, int lowbound, int length)
|
||||
if (type_not_associated (array_type))
|
||||
error (_("array not associated"));
|
||||
|
||||
- range_type = TYPE_INDEX_TYPE (array_type);
|
||||
- range_type = array_type->index_type ();
|
||||
- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
|
||||
- error (_("slice from bad array or bitstring"));
|
||||
+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type));
|
||||
+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type));
|
||||
+ ary_low_bound = array_type->index_type ()->bounds ()->low.const_val ();
|
||||
+ ary_high_bound = array_type->index_type ()->bounds ()->high.const_val ();
|
||||
+
|
||||
+ /* When we are working on a multi-dimensional array, we need to get the
|
||||
+ attributes of the underlying type. */
|
||||
+ if (call_count > 1)
|
||||
+ {
|
||||
+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type));
|
||||
+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type));
|
||||
+ ary_low_bound = elt_type->index_type ()->bounds ()->low.const_val ();
|
||||
+ ary_high_bound = elt_type->index_type ()->bounds ()->high.const_val ();
|
||||
+ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
|
||||
+ row_count = TYPE_LENGTH (array_type)
|
||||
+ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
|
||||
@ -1623,12 +1614,12 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+
|
||||
+ elt_size = TYPE_LENGTH (elt_type);
|
||||
+ elt_offs = lowbound - ary_low_bound;
|
||||
+
|
||||
+ elt_offs *= elt_size;
|
||||
|
||||
- if (lowbound < lowerbound || length < 0
|
||||
- || lowbound + length - 1 > upperbound)
|
||||
- error (_("slice out of range"));
|
||||
+ elt_offs *= elt_size;
|
||||
+
|
||||
+ /* Check for valid user input. In case of Fortran this was already done
|
||||
+ in the calling function. */
|
||||
+ if (call_count == 1
|
||||
@ -1642,7 +1633,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+ array by setting slice_range_size. */
|
||||
+ if (call_count == 1)
|
||||
+ {
|
||||
+ range_type = TYPE_INDEX_TYPE (array_type);
|
||||
+ range_type = array_type->index_type ();
|
||||
+ slice_range_size = ary_low_bound + elem_count - 1;
|
||||
+
|
||||
+ /* Check if the array bounds are valid. */
|
||||
@ -1654,9 +1645,9 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+ accordingly. */
|
||||
+ else
|
||||
+ {
|
||||
+ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
|
||||
+ range_type = TYPE_TARGET_TYPE (array_type)->index_type ();
|
||||
+ slice_range_size = ary_low_bound + (row_count * elem_count) - 1;
|
||||
+ ary_low_bound = TYPE_LOW_BOUND (range_type);
|
||||
+ ary_low_bound = range_type->bounds ()->low.const_val ();
|
||||
+ }
|
||||
|
||||
/* FIXME-type-allocation: need a way to free this type when we are
|
||||
@ -1674,7 +1665,11 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
- LONGEST offset
|
||||
- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
|
||||
+ struct type *element_type;
|
||||
+
|
||||
|
||||
- slice_type = create_array_type (NULL,
|
||||
- element_type,
|
||||
- slice_range_type);
|
||||
- slice_type->set_code (array_type->code ());
|
||||
+ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy
|
||||
+ code for subarrays. */
|
||||
+ if (call_count == 1 && stride_length == 1)
|
||||
@ -1682,12 +1677,8 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+ element_type = TYPE_TARGET_TYPE (array_type);
|
||||
+
|
||||
+ slice_type = create_array_type (NULL, element_type, slice_range_type);
|
||||
|
||||
- slice_type = create_array_type (NULL,
|
||||
- element_type,
|
||||
- slice_range_type);
|
||||
- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
|
||||
+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
|
||||
+
|
||||
+ slice_type->set_code (array_type->code ());
|
||||
|
||||
- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
|
||||
- slice = allocate_value_lazy (slice_type);
|
||||
@ -1731,12 +1722,12 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+
|
||||
+ slice_type = create_array_type (NULL, element_type, slice_range_type);
|
||||
+
|
||||
+ /* If we have a one dimensional array, we copy its TYPE_CODE. For a
|
||||
+ multi dimensional array we copy the embedded type's TYPE_CODE. */
|
||||
+ /* If we have a one dimensional array, we copy its type code. For a
|
||||
+ multi dimensional array we copy the embedded type's type code. */
|
||||
+ if (call_count == 1)
|
||||
+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
|
||||
+ slice_type->set_code (array_type->code ());
|
||||
+ else
|
||||
+ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
|
||||
+ slice_type->set_code ((TYPE_TARGET_TYPE (array_type)->code ()));
|
||||
+
|
||||
+ v = allocate_value (slice_type);
|
||||
+
|
||||
@ -1772,16 +1763,16 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+ return v;
|
||||
}
|
||||
|
||||
/* Create a value for a FORTRAN complex number. Currently most of the
|
||||
/* See value.h. */
|
||||
diff --git a/gdb/value.h b/gdb/value.h
|
||||
--- a/gdb/value.h
|
||||
+++ b/gdb/value.h
|
||||
@@ -1145,6 +1145,8 @@ extern struct value *varying_to_slice (struct value *);
|
||||
@@ -1144,6 +1144,8 @@ extern struct value *varying_to_slice (struct value *);
|
||||
|
||||
extern struct value *value_slice (struct value *, int, int);
|
||||
|
||||
+extern struct value *value_slice_1 (struct value *, int, int, int, int);
|
||||
+
|
||||
extern struct value *value_literal_complex (struct value *, struct value *,
|
||||
struct type *);
|
||||
|
||||
/* Create a complex number. The type is the complex type; the values
|
||||
are cast to the underlying scalar type before the complex number is
|
||||
created. */
|
||||
|
@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings
|
||||
diff --git a/gdb/NEWS b/gdb/NEWS
|
||||
--- a/gdb/NEWS
|
||||
+++ b/gdb/NEWS
|
||||
@@ -805,6 +805,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd*
|
||||
@@ -985,6 +985,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd*
|
||||
|
||||
*** Changes in GDB 8.1
|
||||
|
||||
@ -45,11 +45,11 @@ diff --git a/gdb/NEWS b/gdb/NEWS
|
||||
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
|
||||
--- a/gdb/c-valprint.c
|
||||
+++ b/gdb/c-valprint.c
|
||||
@@ -649,6 +649,28 @@ c_value_print (struct value *val, struct ui_file *stream,
|
||||
@@ -572,6 +572,28 @@ c_value_print (struct value *val, struct ui_file *stream,
|
||||
else
|
||||
{
|
||||
/* normal case */
|
||||
+ if (TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
+ if (type->code () == TYPE_CODE_PTR
|
||||
+ && 1 == is_dynamic_type (type))
|
||||
+ {
|
||||
+ CORE_ADDR addr;
|
||||
@ -64,7 +64,7 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
|
||||
+ && (0 == type_not_associated (type)))
|
||||
+ TYPE_TARGET_TYPE (type) =
|
||||
+ resolve_dynamic_type (TYPE_TARGET_TYPE (type),
|
||||
+ NULL, addr);
|
||||
+ {}, addr);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
@ -74,10 +74,10 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
|
||||
fprintf_filtered (stream, "(");
|
||||
type_print (value_type (val), "", stream, -1);
|
||||
fprintf_filtered (stream, ") ");
|
||||
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -1827,7 +1827,10 @@ static void read_signatured_type (struct signatured_type *);
|
||||
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
||||
--- a/gdb/dwarf2/read.c
|
||||
+++ b/gdb/dwarf2/read.c
|
||||
@@ -1562,7 +1562,10 @@ static void read_signatured_type (signatured_type *sig_type,
|
||||
|
||||
static int attr_to_dynamic_prop (const struct attribute *attr,
|
||||
struct die_info *die, struct dwarf2_cu *cu,
|
||||
@ -89,16 +89,25 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
|
||||
/* memory allocation interface */
|
||||
|
||||
@@ -13799,7 +13802,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -13631,7 +13634,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
newobj->static_link
|
||||
= XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
|
||||
attr_to_dynamic_prop (attr, die, cu, newobj->static_link,
|
||||
- dwarf2_per_cu_addr_type (cu->per_cu));
|
||||
+ dwarf2_per_cu_addr_type (cu->per_cu), NULL, 0);
|
||||
- cu->addr_type ());
|
||||
+ cu->addr_type (), NULL, 0);
|
||||
}
|
||||
|
||||
cu->list_in_scope = cu->get_builder ()->get_local_symbols ();
|
||||
@@ -16565,7 +16568,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -16073,7 +16076,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
else
|
||||
{
|
||||
struct dynamic_prop prop;
|
||||
- if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type ()))
|
||||
+ if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type (), NULL, 0))
|
||||
type->add_dyn_prop (DYN_PROP_BYTE_SIZE, prop);
|
||||
TYPE_LENGTH (type) = 0;
|
||||
}
|
||||
@@ -16764,7 +16767,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
byte_stride_prop
|
||||
= (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop));
|
||||
stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop,
|
||||
@ -107,7 +116,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
if (!stride_ok)
|
||||
{
|
||||
complaint (_("unable to read array DW_AT_byte_stride "
|
||||
@@ -17325,7 +17328,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -17522,7 +17525,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
struct attribute *attr;
|
||||
struct dynamic_prop prop;
|
||||
bool length_is_constant = true;
|
||||
@ -116,7 +125,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
|
||||
/* There are a couple of places where bit sizes might be made use of
|
||||
when parsing a DW_TAG_string_type, however, no producer that we know
|
||||
@@ -17346,6 +17349,10 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -17543,6 +17546,10 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,9 +134,9 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+
|
||||
+ /* If DW_AT_string_length is defined, the length is stored in memory. */
|
||||
attr = dwarf2_attr (die, DW_AT_string_length, cu);
|
||||
if (attr != nullptr && !attr_form_is_constant (attr))
|
||||
if (attr != nullptr && !attr->form_is_constant ())
|
||||
{
|
||||
@@ -17372,13 +17379,71 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -17569,13 +17576,68 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
|
||||
/* Convert the attribute into a dynamic property. */
|
||||
@ -139,7 +148,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
}
|
||||
else if (attr != nullptr)
|
||||
{
|
||||
+ if (attr_form_is_block (attr))
|
||||
+ if (attr->form_is_block ())
|
||||
+ {
|
||||
+ struct attribute *byte_size, *bit_size;
|
||||
+ struct dynamic_prop high;
|
||||
@ -189,18 +198,15 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ complaint (_("Could not parse DW_AT_string_length"));
|
||||
+ }
|
||||
+
|
||||
+ TYPE_RANGE_DATA (range_type)->high = high;
|
||||
+ range_type->bounds ()->high = high;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
|
||||
+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
|
||||
+ }
|
||||
+ range_type->bounds ()->high.set_const_val (DW_UNSND(attr));
|
||||
+
|
||||
/* This DW_AT_string_length just contains the length with no
|
||||
indirection. There's no need to create a dynamic property in this
|
||||
case. Pass 0 for the default value as we know it will not be
|
||||
@@ -17392,6 +17457,20 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -17589,6 +17651,14 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -208,28 +214,22 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ in this case. */
|
||||
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
|
||||
+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
|
||||
+ }
|
||||
+ range_type->bounds ()->high.set_const_val (DW_UNSND(attr));
|
||||
+ else
|
||||
+ {
|
||||
+ TYPE_HIGH_BOUND (range_type) = 1;
|
||||
+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
|
||||
+ }
|
||||
+ range_type->bounds ()->high.set_const_val (1);
|
||||
+
|
||||
/* Use 1 as a fallback length if we have nothing else. */
|
||||
length = 1;
|
||||
}
|
||||
@@ -17407,6 +17486,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
low_bound.data.const_val = 1;
|
||||
@@ -17603,6 +17673,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
low_bound.set_const_val (1);
|
||||
range_type = create_range_type (NULL, index_type, &low_bound, &prop, 0);
|
||||
}
|
||||
+
|
||||
char_type = language_string_char_type (cu->language_defn, gdbarch);
|
||||
type = create_string_type (NULL, char_type, range_type);
|
||||
|
||||
@@ -17858,7 +17938,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -18078,7 +18149,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
static int
|
||||
attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
|
||||
struct dwarf2_cu *cu, struct dynamic_prop *prop,
|
||||
@ -238,18 +238,17 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ const gdb_byte *additional_data, int additional_data_size)
|
||||
{
|
||||
struct dwarf2_property_baton *baton;
|
||||
struct obstack *obstack
|
||||
@@ -17885,9 +17966,30 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
|
||||
baton->locexpr.is_reference = false;
|
||||
dwarf2_per_objfile *per_objfile = cu->per_objfile;
|
||||
@@ -18108,6 +18180,26 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
|
||||
break;
|
||||
}
|
||||
+
|
||||
|
||||
+ if (additional_data != NULL && additional_data_size > 0)
|
||||
+ {
|
||||
+ gdb_byte *data;
|
||||
+
|
||||
+ data = (gdb_byte *) obstack_alloc(
|
||||
+ &cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
|
||||
+ &cu->per_objfile->objfile->objfile_obstack,
|
||||
+ DW_BLOCK (attr)->size + additional_data_size);
|
||||
+ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
|
||||
+ memcpy (data + DW_BLOCK (attr)->size, additional_data,
|
||||
@ -264,17 +263,13 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ baton->locexpr.size = DW_BLOCK (attr)->size;
|
||||
+ }
|
||||
+
|
||||
prop->data.baton = baton;
|
||||
prop->kind = PROP_LOCEXPR;
|
||||
- gdb_assert (prop->data.baton != NULL);
|
||||
+ gdb_assert(prop->data.baton != NULL);
|
||||
prop->set_locexpr (baton);
|
||||
gdb_assert (prop->baton () != NULL);
|
||||
}
|
||||
else if (attr_form_is_ref (attr))
|
||||
{
|
||||
@@ -17920,9 +18022,29 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
|
||||
baton = XOBNEW (obstack, struct dwarf2_property_baton);
|
||||
@@ -18142,11 +18234,31 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
|
||||
baton->property_type = die_type (target_die, target_cu);
|
||||
baton->locexpr.per_cu = cu->per_cu;
|
||||
baton->locexpr.per_objfile = per_objfile;
|
||||
- baton->locexpr.size = DW_BLOCK (target_attr)->size;
|
||||
- baton->locexpr.data = DW_BLOCK (target_attr)->data;
|
||||
baton->locexpr.is_reference = true;
|
||||
@ -283,7 +278,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ {
|
||||
+ gdb_byte *data;
|
||||
+
|
||||
+ data = (gdb_byte *) obstack_alloc (&cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
|
||||
+ data = (gdb_byte *) obstack_alloc (&cu->per_objfile->objfile->objfile_obstack,
|
||||
+ DW_BLOCK (target_attr)->size + additional_data_size);
|
||||
+ memcpy (data, DW_BLOCK (target_attr)->data,
|
||||
+ DW_BLOCK (target_attr)->size);
|
||||
@ -300,10 +295,13 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ baton->locexpr.size = DW_BLOCK (target_attr)->size;
|
||||
+ }
|
||||
+
|
||||
prop->data.baton = baton;
|
||||
prop->kind = PROP_LOCEXPR;
|
||||
gdb_assert (prop->data.baton != NULL);
|
||||
@@ -18099,8 +18221,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
prop->set_locexpr (baton);
|
||||
- gdb_assert (prop->baton () != NULL);
|
||||
+ gdb_assert (prop->baton() != NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -18308,8 +18420,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
|
||||
attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
|
||||
@ -314,7 +312,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
else if (!low_default_is_valid)
|
||||
complaint (_("Missing DW_AT_lower_bound "
|
||||
"- DIE at %s [in module %s]"),
|
||||
@@ -18109,10 +18231,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@@ -18318,10 +18430,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
|
||||
struct attribute *attr_ub, *attr_count;
|
||||
attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu);
|
||||
@ -326,80 +324,54 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||
+ if (attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0))
|
||||
{
|
||||
/* If bounds are constant do the final calculation here. */
|
||||
if (low.kind == PROP_CONST && high.kind == PROP_CONST)
|
||||
@@ -18164,7 +18286,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
struct type *prop_type
|
||||
= dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
|
||||
if (low.kind () == PROP_CONST && high.kind () == PROP_CONST)
|
||||
@@ -18372,7 +18484,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
struct type *prop_type = cu->addr_sized_int_type (false);
|
||||
attr_to_dynamic_prop (attr_byte_stride, die, cu, &byte_stride_prop,
|
||||
- prop_type);
|
||||
+ prop_type, NULL, 0);
|
||||
}
|
||||
|
||||
struct dynamic_prop bit_stride_prop;
|
||||
@@ -18185,7 +18307,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
struct type *prop_type
|
||||
= dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
|
||||
@@ -18392,7 +18504,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
struct type *prop_type = cu->addr_sized_int_type (false);
|
||||
attr_to_dynamic_prop (attr_bit_stride, die, cu, &bit_stride_prop,
|
||||
- prop_type);
|
||||
+ prop_type, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25879,7 +26001,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
|
||||
@@ -24424,7 +24536,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
|
||||
if (attr != NULL)
|
||||
{
|
||||
struct type *prop_type
|
||||
= dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
|
||||
struct type *prop_type = cu->addr_sized_int_type (false);
|
||||
- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
|
||||
+ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0))
|
||||
add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
|
||||
type->add_dyn_prop (DYN_PROP_ALLOCATED, prop);
|
||||
}
|
||||
else if (attr != NULL)
|
||||
@@ -25895,7 +26017,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
|
||||
|
||||
@@ -24433,13 +24545,13 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
|
||||
if (attr != NULL)
|
||||
{
|
||||
struct type *prop_type
|
||||
= dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
|
||||
struct type *prop_type = cu->addr_sized_int_type (false);
|
||||
- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
|
||||
+ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0))
|
||||
add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
|
||||
type->add_dyn_prop (DYN_PROP_ASSOCIATED, prop);
|
||||
}
|
||||
else if (attr != NULL)
|
||||
@@ -25908,7 +26030,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
|
||||
|
||||
/* Read DW_AT_data_location and set in type. */
|
||||
attr = dwarf2_attr (die, DW_AT_data_location, cu);
|
||||
if (attr_to_dynamic_prop (attr, die, cu, &prop,
|
||||
- dwarf2_per_cu_addr_type (cu->per_cu)))
|
||||
+ dwarf2_per_cu_addr_type (cu->per_cu), NULL, 0))
|
||||
add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
|
||||
- if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type ()))
|
||||
+ if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type (), NULL, 0))
|
||||
type->add_dyn_prop (DYN_PROP_DATA_LOCATION, prop);
|
||||
|
||||
if (dwarf2_per_objfile->die_type_hash == NULL)
|
||||
if (per_objfile->die_type_hash == NULL)
|
||||
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
|
||||
--- a/gdb/f-typeprint.c
|
||||
+++ b/gdb/f-typeprint.c
|
||||
@@ -197,15 +197,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
print_rank_only = true;
|
||||
else if ((TYPE_ASSOCIATED_PROP (type)
|
||||
&& PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
|
||||
- || (TYPE_ALLOCATED_PROP (type)
|
||||
- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
|
||||
- || (TYPE_DATA_LOCATION (type)
|
||||
- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
|
||||
- {
|
||||
- /* This case exist when we ptype a typename which has the dynamic
|
||||
- properties but cannot be resolved as there is no object. */
|
||||
- print_rank_only = true;
|
||||
- }
|
||||
+ || (TYPE_ALLOCATED_PROP (type)
|
||||
+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
|
||||
+ || (TYPE_DATA_LOCATION (type)
|
||||
+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
|
||||
+ /* This case exist when we ptype a typename which has the
|
||||
+ dynamic properties but cannot be resolved as there is
|
||||
+ no object. */
|
||||
+ print_rank_only = true;
|
||||
|
||||
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
|
||||
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
|
||||
@@ -217,8 +216,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
@@ -217,8 +217,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
else
|
||||
{
|
||||
LONGEST lower_bound = f77_get_lowerbound (type);
|
||||
@ -410,7 +382,7 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
|
||||
|
||||
/* Make sure that, if we have an assumed size array, we
|
||||
print out a warning and print the upperbound as '*'. */
|
||||
@@ -229,7 +229,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
@@ -229,7 +230,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
{
|
||||
LONGEST upper_bound = f77_get_upperbound (type);
|
||||
|
||||
@ -419,7 +391,7 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
@@ -249,7 +250,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
case TYPE_CODE_REF:
|
||||
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
|
||||
arrayprint_recurse_level, false);
|
||||
@ -431,17 +403,17 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
|
||||
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
|
||||
--- a/gdb/gdbtypes.c
|
||||
+++ b/gdb/gdbtypes.c
|
||||
@@ -1939,7 +1939,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
|
||||
@@ -1977,7 +1977,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
|
||||
type = check_typedef (type);
|
||||
|
||||
/* We only want to recognize references at the outermost level. */
|
||||
- if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
- if (top_level && type->code () == TYPE_CODE_REF)
|
||||
+ if (top_level &&
|
||||
+ (TYPE_CODE (type) == TYPE_CODE_REF || TYPE_CODE (type) == TYPE_CODE_PTR))
|
||||
+ (type->code () == TYPE_CODE_REF || type-> code() == TYPE_CODE_PTR))
|
||||
type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
/* Types that have a dynamic TYPE_DATA_LOCATION are considered
|
||||
@@ -1972,10 +1973,10 @@ is_dynamic_type_internal (struct type *type, int top_level)
|
||||
@@ -2017,10 +2018,10 @@ is_dynamic_type_internal (struct type *type, int top_level)
|
||||
|| is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0));
|
||||
}
|
||||
|
||||
@ -451,26 +423,26 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
|
||||
case TYPE_CODE_ARRAY:
|
||||
+ case TYPE_CODE_STRING:
|
||||
{
|
||||
gdb_assert (TYPE_NFIELDS (type) == 1);
|
||||
gdb_assert (type->num_fields () == 1);
|
||||
|
||||
@@ -2139,11 +2140,15 @@ resolve_dynamic_array_or_string (struct type *type,
|
||||
@@ -2183,11 +2184,15 @@ resolve_dynamic_array_or_string (struct type *type,
|
||||
|
||||
ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
|
||||
|
||||
- if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY)
|
||||
+ if (ary_dim != NULL && (TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY
|
||||
+ || TYPE_CODE (ary_dim) == TYPE_CODE_STRING))
|
||||
- if (ary_dim != NULL && ary_dim->code () == TYPE_CODE_ARRAY)
|
||||
+ if (ary_dim != NULL && (ary_dim->code () == TYPE_CODE_ARRAY
|
||||
+ || ary_dim->code () == TYPE_CODE_STRING))
|
||||
elt_type = resolve_dynamic_array_or_string (ary_dim, addr_stack);
|
||||
else
|
||||
elt_type = TYPE_TARGET_TYPE (type);
|
||||
|
||||
+ if (TYPE_CODE (type) == TYPE_CODE_STRING)
|
||||
+ if (type->code () == TYPE_CODE_STRING)
|
||||
+ return create_string_type (type, elt_type, range_type);
|
||||
+
|
||||
prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
|
||||
prop = type->dyn_prop (DYN_PROP_BYTE_STRIDE);
|
||||
if (prop != NULL)
|
||||
{
|
||||
@@ -2295,6 +2300,28 @@ resolve_dynamic_struct (struct type *type,
|
||||
@@ -2533,6 +2538,25 @@ resolve_dynamic_struct (struct type *type,
|
||||
return resolved_type;
|
||||
}
|
||||
|
||||
@ -488,10 +460,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
|
||||
+ /* Resolve associated property. */
|
||||
+ prop = TYPE_ASSOCIATED_PROP (type);
|
||||
+ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
|
||||
+ {
|
||||
+ TYPE_DYN_PROP_ADDR (prop) = value;
|
||||
+ TYPE_DYN_PROP_KIND (prop) = PROP_CONST;
|
||||
+ }
|
||||
+ prop->set_const_val (value);
|
||||
+
|
||||
+ return type;
|
||||
+}
|
||||
@ -499,7 +468,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
|
||||
/* Worker for resolved_dynamic_type. */
|
||||
|
||||
static struct type *
|
||||
@@ -2349,6 +2376,9 @@ resolve_dynamic_type_internal (struct type *type,
|
||||
@@ -2594,6 +2618,9 @@ resolve_dynamic_type_internal (struct type *type,
|
||||
case TYPE_CODE_ARRAY:
|
||||
resolved_type = resolve_dynamic_array_or_string (type, addr_stack);
|
||||
break;
|
||||
@ -804,7 +773,7 @@ diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortra
|
||||
# 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
|
||||
@@ -40,7 +41,7 @@ set complex [fortran_complex4]
|
||||
@@ -42,7 +43,7 @@ set complex [fortran_complex4]
|
||||
# matches the string TYPE.
|
||||
proc check_pointer_type { var_name type } {
|
||||
gdb_test "ptype ${var_name}" \
|
||||
@ -813,7 +782,7 @@ diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortra
|
||||
}
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
|
||||
@@ -85,7 +86,8 @@ gdb_test "ptype twop" \
|
||||
@@ -87,7 +88,8 @@ gdb_test "ptype twop" \
|
||||
[multi_line "type = PTR TO -> \\( Type two" \
|
||||
" $int, allocatable :: ivla1\\(:\\)" \
|
||||
" $int, allocatable :: ivla2\\(:,:\\)" \
|
||||
@ -823,7 +792,7 @@ diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortra
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "After value assignment"]
|
||||
gdb_continue_to_breakpoint "After value assignment"
|
||||
@@ -97,11 +99,11 @@ gdb_test "ptype intv" "type = $int"
|
||||
@@ -99,11 +101,11 @@ gdb_test "ptype intv" "type = $int"
|
||||
gdb_test "ptype inta" "type = $int \\(10,2\\)"
|
||||
gdb_test "ptype realv" "type = $real"
|
||||
|
||||
@ -840,7 +809,7 @@ diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortra
|
||||
set test "ptype intap"
|
||||
gdb_test_multiple $test $test {
|
||||
-re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {
|
||||
@@ -111,4 +113,4 @@ gdb_test_multiple $test $test {
|
||||
@@ -113,4 +115,4 @@ gdb_test_multiple $test $test {
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
@ -1001,7 +970,7 @@ new file mode 100644
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-value.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-value.exp
|
||||
@@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"]
|
||||
@@ -37,7 +37,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"]
|
||||
gdb_continue_to_breakpoint "vla1-init"
|
||||
gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"
|
||||
gdb_test "print &vla1" \
|
||||
@ -1010,7 +979,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran
|
||||
"print non-allocated &vla1"
|
||||
gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \
|
||||
"print member in non-allocated vla1 (1)"
|
||||
@@ -56,7 +56,7 @@ with_timeout_factor 15 {
|
||||
@@ -58,7 +58,7 @@ with_timeout_factor 15 {
|
||||
"step over value assignment of vla1"
|
||||
}
|
||||
gdb_test "print &vla1" \
|
||||
@ -1019,7 +988,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran
|
||||
"print allocated &vla1"
|
||||
gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)"
|
||||
gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)"
|
||||
@@ -76,7 +76,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \
|
||||
@@ -78,7 +78,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \
|
||||
# Try to access values in undefined pointer to VLA (dangling)
|
||||
gdb_test "print pvla" " = <not associated>" "print undefined pvla"
|
||||
gdb_test "print &pvla" \
|
||||
@ -1028,7 +997,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran
|
||||
"print non-associated &pvla"
|
||||
gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
|
||||
"print undefined pvla(1,3,8)"
|
||||
@@ -85,7 +85,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated
|
||||
@@ -87,7 +87,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated
|
||||
gdb_breakpoint [gdb_get_line_number "pvla-associated"]
|
||||
gdb_continue_to_breakpoint "pvla-associated"
|
||||
gdb_test "print &pvla" \
|
||||
@ -1040,7 +1009,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran
|
||||
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
|
||||
--- a/gdb/typeprint.c
|
||||
+++ b/gdb/typeprint.c
|
||||
@@ -574,6 +574,25 @@ whatis_exp (const char *exp, int show)
|
||||
@@ -565,6 +565,25 @@ whatis_exp (const char *exp, int show)
|
||||
printf_filtered (" */\n");
|
||||
}
|
||||
|
||||
@ -1048,7 +1017,7 @@ diff --git a/gdb/typeprint.c b/gdb/typeprint.c
|
||||
+ additional information about the target.
|
||||
+ For example, in Fortran and C we are printing the dimension of the
|
||||
+ dynamic array the pointer is pointing to. */
|
||||
+ if (TYPE_CODE (type) == TYPE_CODE_PTR
|
||||
+ if (type->code () == TYPE_CODE_PTR
|
||||
+ && is_dynamic_type (type) == 1)
|
||||
+ {
|
||||
+ CORE_ADDR addr;
|
||||
@ -1060,7 +1029,7 @@ diff --git a/gdb/typeprint.c b/gdb/typeprint.c
|
||||
+ if (addr != 0
|
||||
+ && type_not_associated (type) == 0)
|
||||
+ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type),
|
||||
+ NULL, addr);
|
||||
+ {}, addr);
|
||||
+ }
|
||||
+
|
||||
LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
|
||||
@ -1070,7 +1039,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
--- a/gdb/valops.c
|
||||
+++ b/gdb/valops.c
|
||||
@@ -1553,6 +1553,19 @@ value_ind (struct value *arg1)
|
||||
if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
|
||||
if (base_type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
struct type *enc_type;
|
||||
+ CORE_ADDR addr;
|
||||
@ -1085,24 +1054,24 @@ diff --git a/gdb/valops.c b/gdb/valops.c
|
||||
+
|
||||
+ if (addr != 0)
|
||||
+ TYPE_TARGET_TYPE (base_type) =
|
||||
+ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), NULL, addr);
|
||||
+ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), {}, addr);
|
||||
|
||||
/* We may be pointing to something embedded in a larger object.
|
||||
Get the real type of the enclosing object. */
|
||||
@@ -1568,8 +1581,7 @@ value_ind (struct value *arg1)
|
||||
@@ -1570,8 +1583,7 @@ value_ind (struct value *arg1)
|
||||
else
|
||||
/* Retrieve the enclosing object pointed to. */
|
||||
arg2 = value_at_lazy (enc_type,
|
||||
- (value_as_address (arg1)
|
||||
- - value_pointed_to_offset (arg1)));
|
||||
+ (addr - value_pointed_to_offset (arg1)));
|
||||
|
||||
{
|
||||
/* Retrieve the enclosing object pointed to. */
|
||||
- base_addr = (value_as_address (arg1)
|
||||
- - value_pointed_to_offset (arg1));
|
||||
+ base_addr = (addr - value_pointed_to_offset (arg1));
|
||||
}
|
||||
arg2 = value_at_lazy (enc_type, base_addr);
|
||||
enc_type = value_type (arg2);
|
||||
return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
|
||||
diff --git a/gdb/valprint.c b/gdb/valprint.c
|
||||
--- a/gdb/valprint.c
|
||||
+++ b/gdb/valprint.c
|
||||
@@ -1149,12 +1149,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
|
||||
@@ -1046,12 +1046,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -27,10 +27,10 @@ cannot reproduce it.
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
|
||||
--- a/gdb/dwarf2loc.c
|
||||
+++ b/gdb/dwarf2loc.c
|
||||
@@ -2154,6 +2154,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
|
||||
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
|
||||
--- a/gdb/dwarf2/loc.c
|
||||
+++ b/gdb/dwarf2/loc.c
|
||||
@@ -2249,6 +2249,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
|
||||
ctx.per_cu = per_cu;
|
||||
ctx.obj_address = 0;
|
||||
|
||||
@ -50,7 +50,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
|
||||
+
|
||||
scoped_value_mark free_values;
|
||||
|
||||
ctx.gdbarch = get_objfile_arch (objfile);
|
||||
ctx.gdbarch = per_objfile->objfile->arch ();
|
||||
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
|
@ -18,12 +18,15 @@ diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.f
|
||||
diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
|
||||
@@ -42,4 +42,4 @@ gdb_test "ptype say_numbers" \
|
||||
@@ -42,7 +42,7 @@ gdb_test "ptype say_numbers" \
|
||||
"type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)"
|
||||
|
||||
gdb_test "ptype fun_ptr" \
|
||||
- "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)"
|
||||
+ "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)"
|
||||
|
||||
gdb_test "ptype say_string" \
|
||||
"type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
@ -169,12 +172,12 @@ new file mode 100644
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
|
||||
@@ -28,5 +28,5 @@ if ![runto_main] {
|
||||
@@ -33,5 +33,5 @@ set real4 [fortran_real4]
|
||||
# Check the status of a pointer to a dynamic array.
|
||||
gdb_breakpoint [gdb_get_line_number "pvla-associated"]
|
||||
gdb_continue_to_breakpoint "pvla-associated"
|
||||
-gdb_test "print &pvla" " = \\(PTR TO -> \\( real\\(kind=4\\) \\(10,10,10\\) \\)\\) ${hex}" \
|
||||
+gdb_test "print &pvla" " = \\(PTR TO -> \\( real\\(kind=4\\) \\(10,10,10\\)\\)\\) ${hex}" \
|
||||
-gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\) \\)\\) ${hex}" \
|
||||
+gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\)\\)\\) ${hex}" \
|
||||
"print pvla pointer information"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
|
||||
new file mode 100644
|
||||
|
206
gdb.changes
206
gdb.changes
@ -1,3 +1,209 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 30 14:46:49 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Mention fedora patch fixups added:
|
||||
* fixup-3-gdb-archer-vla-tests.patch
|
||||
- Mention patch to be upstreamed added:
|
||||
* gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 27 13:54:42 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Fedora patch fixups update:
|
||||
* fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
- Fedora patch fixups added:
|
||||
* fixup-gdb-test-ivy-bridge.patch
|
||||
- Add xz to BuildRequires for testsuite flavour.
|
||||
- Add note on mpfr-devel for SLE-11.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 26 08:05:44 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Backport from master:
|
||||
* gdb-testsuite-fix-failure-in-gdb-base-step-over-no-symbols-exp.patch
|
||||
- Patch to be upstreamed:
|
||||
* gdb-testsuite-fix-control-flow-in-gdb-reverse-insn-reverse-exp.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 26 00:35:52 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Patch updated:
|
||||
* gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 25 23:45:19 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Patch updated:
|
||||
* gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 24 13:10:46 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Patch to be upstreamed:
|
||||
* gdb-testsuite-gdb-base-morestack-exp-no-clang.patch
|
||||
* gdb-testsuite-handle-sigill-in-gdb-reverse-insn-reverse-exp.patch
|
||||
* gdb-testsuite-fix-gdb-reverse-insn-reverse-x86-c-for-m32.patch
|
||||
* gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch
|
||||
* gdb-tui-enable-work-around-libncurses-segfault.patch
|
||||
- Backport from master dropped:
|
||||
* gdb-testsuite-fix-unbalanced-braces-in-gdb-tui-new-layout-exp.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 18 09:59:52 UTC 2020 - Tom de Vries <tdevries@suse.com> - 10.1
|
||||
|
||||
- Fedora patch fixups updated:
|
||||
* fixup-2-gdb-archer-vla-tests.patch
|
||||
- Fedora patch fixups added:
|
||||
* fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
- Testsuite patch:
|
||||
* gdb-testsuite-disable-selftests-for-factory.patch
|
||||
- Backport from master:
|
||||
* gdb-symtab-read-cu-base-address-for-enqueued-cu.patch
|
||||
* gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch
|
||||
* gdb-fix-section-matching-in-find_pc_sect_compunit.patch
|
||||
* gdb-symtab-fix-language-of-frame-without-debug-info.patch
|
||||
- Patch to be upstreamed:
|
||||
* gdb-symtab-set-default-dwarf-max-cache-age-1000.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 12 22:30:53 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- BuildRequire curl for debuginfod test-case.
|
||||
- Patch to be upstreamed:
|
||||
* gdb-don-t-return-non-existing-path-in-debuginfod-source-query.patch
|
||||
* gdb-fix-assert-in-process-event-stop-test.patch
|
||||
* gdb-fix-filename-in-not-in-executable-format-error.patch
|
||||
* gdb-handle-no-upper-bound-in-value-subscript.patch
|
||||
* gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch
|
||||
- Testsuite patch:
|
||||
* gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch
|
||||
- Fedora patch fixups added:
|
||||
* fixup-gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
- Fedora patch fixups updated:
|
||||
* fixup-gdb-btrobust.patch
|
||||
* fixup-2-gdb-archer-vla-tests.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 12 17:04:42 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Add missing patch command for:
|
||||
* gdb-fortran-fix-print-dynamic-array.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 12 16:31:58 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Fix patch application on SLE-11:
|
||||
* gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 12 07:44:58 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Disable xz-devel and binutils-gold for SLE-10.
|
||||
- More enabling of gdbserver for riscv64.
|
||||
- Backport from master:
|
||||
* gdb-testsuite-fix-unbalanced-braces-in-gdb-tui-new-layout-exp.patch
|
||||
* gdb-testsuite-catch-condition-evaluation-errors-in-gdb-assert.patch
|
||||
* gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch
|
||||
* gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch
|
||||
- Patch to be upstreamed:
|
||||
* gdb-fortran-fix-print-dynamic-array.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 11 22:13:49 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Enable gdbserver for riscv64.
|
||||
- Restrict BuildRequires libdebuginfod to Factory and supporting
|
||||
archs.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 10 15:12:24 UTC 2020 - Tom de Vries <tdevries@suse.com>
|
||||
|
||||
- Rebase to 10.1 release (as in fedora 33 @ 6c8ccd6).
|
||||
* Debuginfod support.
|
||||
* Multi-target debugging support.
|
||||
* Multithreaded symbol loading enabled by default.
|
||||
* New command set exec-file-mismatch.
|
||||
* New command tui new-layout.
|
||||
* Alias command can now specify default args for an alias.
|
||||
- Update libipt to v2.0.2.
|
||||
- Fedora-specific patches dropped:
|
||||
* gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
- Broken/obsolete fedora patches dropped:
|
||||
* gdb-bz533176-fortran-omp-step.patch
|
||||
* gdb-6.5-BEA-testsuite.patch
|
||||
* gdb-6.7-charsign-test.patch
|
||||
- Obsoleted fedora patches dropped:
|
||||
* gdb-6.3-attach-see-vdso-test.patch
|
||||
* gdb-6.3-inferior-notification-20050721.patch
|
||||
* gdb-6.5-gcore-buffer-limit-test.patch
|
||||
* gdb-6.5-missed-trap-on-step-test.patch
|
||||
* gdb-rhbz1818011-bfd-gcc10-error.patch
|
||||
- Fedora patches updated:
|
||||
* gdb-6.3-gstack-20050411.patch
|
||||
* gdb-6.3-test-self-20050110.patch
|
||||
* gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
* gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
* gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
* gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
* gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
* gdb-6.6-buildid-locate-rpm.patch
|
||||
* gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
* gdb-6.6-buildid-locate.patch
|
||||
* gdb-6.7-testsuite-stable-results.patch
|
||||
* gdb-6.8-quit-never-aborts.patch
|
||||
* gdb-archer-pie-addons-keep-disabled.patch
|
||||
* gdb-archer-pie-addons.patch
|
||||
* gdb-archer-vla-tests.patch
|
||||
* gdb-attach-fail-reasons-5of5.patch
|
||||
* gdb-bz1219747-attach-kills.patch
|
||||
* gdb-bz533176-fortran-omp-step.patch
|
||||
* gdb-container-rh-pkg.patch
|
||||
* gdb-fedora-libncursesw.patch
|
||||
* gdb-gnat-dwarf-crash-3of3.patch
|
||||
* gdb-jit-reader-multilib.patch
|
||||
* gdb-linux_perf-bundle.patch
|
||||
* gdb-moribund-utrace-workaround.patch
|
||||
* gdb-runtest-pie-override.patch
|
||||
* gdb-vla-intel-fix-print-char-array.patch
|
||||
* gdb-vla-intel-fortran-strides.patch
|
||||
* gdb-vla-intel-fortran-vla-strings.patch
|
||||
* gdb-vla-intel-stringbt-fix.patch
|
||||
* gdb-vla-intel-tests.patch
|
||||
- Fedora patches added:
|
||||
* gdb-config.patch
|
||||
- Obsoleted patched dropped:
|
||||
* gdb-testsuite-avoid-pagination-in-attach-32.exp.patch
|
||||
* gdb-fix-toplevel-types-with-fdebug-types-section.patch
|
||||
* gdb-fix-range-loop-index-in-find_method.patch
|
||||
* gdb-fix-python3.9-related-runtime-problems.patch
|
||||
* gdb-fix-unused-function-error.patch
|
||||
* gdb-fix-the-thread-pool.c-compilation.patch
|
||||
* gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch
|
||||
* gdb-fix-debug-agent-odr-bool-int.patch
|
||||
* gdbserver-fix-build-with-make-3.81.patch
|
||||
* gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch
|
||||
- Fedora patch fixups added:
|
||||
* fixup-gdb-6.3-test-pie-20050107.patch
|
||||
* fixup-gdb-6.5-sharedlibrary-path.patch
|
||||
* fixup-gdb-6.6-buildid-locate.patch
|
||||
* fixup-gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
* fixup-gdb-archer-vla-tests.patch
|
||||
* fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch
|
||||
* fixup-gdb-btrobust.patch
|
||||
* fixup-gdb-bz634108-solib_address.patch
|
||||
* fixup-gdb-dts-rhel6-python-compat.patch
|
||||
* fixup-gdb-gnat-dwarf-crash-3of3.patch
|
||||
* fixup-gdb-vla-intel-fortran-vla-strings.patch
|
||||
* fixup-gdb-vla-intel-tests.patch
|
||||
* fixup-gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
- Patches renamed:
|
||||
* gdb-testsuite-fix-perror-in-gdb.opt-fortran-string.exp.patch
|
||||
to fixup-2-gdb-archer-vla-tests.patch
|
||||
- Patches updated:
|
||||
* gdb-testsuite-ada-pie.patch
|
||||
- Backport from master:
|
||||
* gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 7 09:04:30 UTC 2020 - Andreas Schwab <schwab@suse.de>
|
||||
|
||||
|
353
gdb.spec
353
gdb.spec
@ -54,8 +54,8 @@ ExclusiveArch: do_not_build
|
||||
|
||||
%if %{build_main}
|
||||
Summary: A GNU source-level debugger for C, C++, Fortran and other languages
|
||||
License: GPL-3.0-or-later AND GPL-3.0-with-GCC-exception AND LGPL-2.1-or-later AND LGPL-3.0-or-later
|
||||
Group: Development/Tools/Debuggers
|
||||
License: SUSE-Public-Domain
|
||||
Group: Development/Languages/C and C++
|
||||
%endif
|
||||
%if %{build_testsuite}
|
||||
Summary: GDB testsuite results
|
||||
@ -64,7 +64,7 @@ Group: Development/Languages/C and C++
|
||||
%endif
|
||||
Name: gdb%{name_suffix}
|
||||
|
||||
Version: 9.2
|
||||
Version: 10.1
|
||||
Release: 0
|
||||
|
||||
# The release always contains a leading reserved number, start it at 1.
|
||||
@ -123,7 +123,7 @@ Source4: gdbinit
|
||||
Source5: gdbinit.without-python
|
||||
|
||||
# libipt: Intel Processor Trace Decoder Library
|
||||
%global libipt_version 2.0.1
|
||||
%global libipt_version 2.0.2
|
||||
Source7: v%{libipt_version}.tar.gz
|
||||
|
||||
# Infrastructure to sync patches from the Fedora rpm
|
||||
@ -154,103 +154,123 @@ Patch7: gdb-6.3-test-self-20050110.patch
|
||||
Patch8: gdb-6.3-test-dtorfix-20050121.patch
|
||||
Patch9: gdb-6.3-test-movedir-20050125.patch
|
||||
Patch10: gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
Patch11: gdb-6.3-inferior-notification-20050721.patch
|
||||
Patch12: gdb-6.3-inheritancetest-20050726.patch
|
||||
Patch13: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
Patch14: gdb-6.5-sharedlibrary-path.patch
|
||||
Patch15: gdb-6.5-BEA-testsuite.patch
|
||||
Patch16: gdb-6.5-last-address-space-byte-test.patch
|
||||
Patch17: gdb-6.5-readline-long-line-crash-test.patch
|
||||
Patch18: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
Patch19: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
Patch20: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
||||
Patch21: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
||||
Patch22: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
Patch23: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
Patch24: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
Patch25: gdb-6.6-testsuite-timeouts.patch
|
||||
Patch26: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
Patch27: gdb-6.3-attach-see-vdso-test.patch
|
||||
Patch28: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
Patch29: gdb-6.6-buildid-locate.patch
|
||||
Patch30: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
Patch31: gdb-6.6-buildid-locate-rpm.patch
|
||||
Patch32: gdb-6.7-charsign-test.patch
|
||||
Patch33: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
Patch34: gdb-6.7-testsuite-stable-results.patch
|
||||
Patch35: gdb-6.5-ia64-libunwind-leak-test.patch
|
||||
Patch36: gdb-6.5-missed-trap-on-step-test.patch
|
||||
Patch37: gdb-6.5-gcore-buffer-limit-test.patch
|
||||
Patch38: gdb-6.3-mapping-zero-inode-test.patch
|
||||
Patch39: gdb-6.3-focus-cmd-prev-test.patch
|
||||
Patch40: gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
Patch41: gdb-6.5-section-num-fixup-test.patch
|
||||
Patch42: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
Patch43: gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
Patch44: gdb-core-open-vdso-warning.patch
|
||||
Patch45: gdb-bz533176-fortran-omp-step.patch
|
||||
Patch46: gdb-ccache-workaround.patch
|
||||
Patch47: gdb-archer-pie-addons.patch
|
||||
Patch48: gdb-archer-pie-addons-keep-disabled.patch
|
||||
Patch49: gdb-lineno-makeup-test.patch
|
||||
Patch50: gdb-ppc-power7-test.patch
|
||||
Patch51: gdb-moribund-utrace-workaround.patch
|
||||
Patch52: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
Patch53: gdb-bz601887-dwarf4-rh-test.patch
|
||||
Patch54: gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
Patch55: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
Patch56: gdb-test-bt-cfi-without-die.patch
|
||||
Patch57: gdb-bz634108-solib_address.patch
|
||||
Patch58: gdb-test-pid0-core.patch
|
||||
Patch59: gdb-test-dw2-aranges.patch
|
||||
Patch60: gdb-test-expr-cumulative-archer.patch
|
||||
Patch61: gdb-physname-pr11734-test.patch
|
||||
Patch62: gdb-physname-pr12273-test.patch
|
||||
Patch63: gdb-test-ivy-bridge.patch
|
||||
Patch64: gdb-runtest-pie-override.patch
|
||||
Patch65: gdb-attach-fail-reasons-5of5.patch
|
||||
Patch66: gdb-glibc-strstr-workaround.patch
|
||||
Patch67: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
|
||||
Patch68: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
Patch69: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
Patch70: gdb-gnat-dwarf-crash-3of3.patch
|
||||
Patch71: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
Patch73: gdb-archer-vla-tests.patch
|
||||
Patch74: gdb-vla-intel-tests.patch
|
||||
Patch75: gdb-btrobust.patch
|
||||
Patch76: gdb-fortran-frame-string.patch
|
||||
Patch77: gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
Patch78: gdb-jit-reader-multilib.patch
|
||||
Patch79: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
Patch80: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
|
||||
Patch81: gdb-rhbz1350436-type-printers-error.patch
|
||||
Patch82: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
Patch83: gdb-bz1219747-attach-kills.patch
|
||||
Patch84: gdb-fedora-libncursesw.patch
|
||||
Patch85: gdb-opcodes-clflushopt-test.patch
|
||||
Patch86: gdb-dts-rhel6-python-compat.patch
|
||||
Patch87: gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
Patch88: gdb-6.8-quit-never-aborts.patch
|
||||
Patch89: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
Patch90: gdb-container-rh-pkg.patch
|
||||
Patch91: gdb-rhbz1325795-framefilters-test.patch
|
||||
Patch92: gdb-linux_perf-bundle.patch
|
||||
Patch94: gdb-rhbz1398387-tab-crash-test.patch
|
||||
Patch95: gdb-archer.patch
|
||||
Patch96: gdb-vla-intel-fix-print-char-array.patch
|
||||
Patch97: gdb-rhbz1553104-s390x-arch12-test.patch
|
||||
Patch98: gdb-rhbz1818011-bfd-gcc10-error.patch
|
||||
Patch11: gdb-6.3-inheritancetest-20050726.patch
|
||||
Patch12: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
Patch13: gdb-6.5-sharedlibrary-path.patch
|
||||
Patch15: gdb-6.5-last-address-space-byte-test.patch
|
||||
Patch16: gdb-6.5-readline-long-line-crash-test.patch
|
||||
Patch17: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
Patch18: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
|
||||
Patch19: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
|
||||
Patch20: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
||||
Patch21: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
Patch22: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
Patch23: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
Patch24: gdb-6.6-testsuite-timeouts.patch
|
||||
Patch25: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
Patch26: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
Patch27: gdb-6.6-buildid-locate.patch
|
||||
Patch28: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
Patch29: gdb-6.6-buildid-locate-rpm.patch
|
||||
Patch31: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
Patch32: gdb-6.7-testsuite-stable-results.patch
|
||||
Patch33: gdb-6.5-ia64-libunwind-leak-test.patch
|
||||
Patch34: gdb-6.3-mapping-zero-inode-test.patch
|
||||
Patch35: gdb-6.3-focus-cmd-prev-test.patch
|
||||
Patch36: gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
Patch37: gdb-6.5-section-num-fixup-test.patch
|
||||
Patch39: gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
Patch40: gdb-core-open-vdso-warning.patch
|
||||
Patch42: gdb-ccache-workaround.patch
|
||||
Patch43: gdb-archer-pie-addons.patch
|
||||
Patch44: gdb-archer-pie-addons-keep-disabled.patch
|
||||
Patch45: gdb-lineno-makeup-test.patch
|
||||
Patch46: gdb-ppc-power7-test.patch
|
||||
Patch47: gdb-moribund-utrace-workaround.patch
|
||||
Patch48: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
Patch49: gdb-bz601887-dwarf4-rh-test.patch
|
||||
Patch50: gdb-6.6-buildid-locate-core-as-arg.patch
|
||||
Patch51: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
Patch52: gdb-test-bt-cfi-without-die.patch
|
||||
Patch53: gdb-bz634108-solib_address.patch
|
||||
Patch54: gdb-test-pid0-core.patch
|
||||
Patch55: gdb-test-dw2-aranges.patch
|
||||
Patch56: gdb-test-expr-cumulative-archer.patch
|
||||
Patch57: gdb-physname-pr11734-test.patch
|
||||
Patch58: gdb-physname-pr12273-test.patch
|
||||
Patch59: gdb-test-ivy-bridge.patch
|
||||
Patch60: gdb-runtest-pie-override.patch
|
||||
Patch61: gdb-attach-fail-reasons-5of5.patch
|
||||
Patch62: gdb-glibc-strstr-workaround.patch
|
||||
Patch63: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
|
||||
Patch64: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
Patch65: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
Patch66: gdb-gnat-dwarf-crash-3of3.patch
|
||||
Patch67: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
Patch69: gdb-archer-vla-tests.patch
|
||||
Patch70: gdb-vla-intel-tests.patch
|
||||
Patch71: gdb-btrobust.patch
|
||||
Patch72: gdb-fortran-frame-string.patch
|
||||
Patch73: gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
Patch74: gdb-jit-reader-multilib.patch
|
||||
Patch75: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
Patch76: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
|
||||
Patch77: gdb-rhbz1350436-type-printers-error.patch
|
||||
Patch78: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
Patch79: gdb-bz1219747-attach-kills.patch
|
||||
Patch80: gdb-fedora-libncursesw.patch
|
||||
Patch81: gdb-opcodes-clflushopt-test.patch
|
||||
Patch82: gdb-dts-rhel6-python-compat.patch
|
||||
Patch83: gdb-6.6-buildid-locate-rpm-scl.patch
|
||||
Patch84: gdb-6.8-quit-never-aborts.patch
|
||||
Patch85: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
Patch86: gdb-container-rh-pkg.patch
|
||||
Patch87: gdb-rhbz1325795-framefilters-test.patch
|
||||
Patch88: gdb-linux_perf-bundle.patch
|
||||
Patch90: gdb-rhbz1398387-tab-crash-test.patch
|
||||
Patch91: gdb-archer.patch
|
||||
Patch92: gdb-vla-intel-fix-print-char-array.patch
|
||||
Patch93: gdb-rhbz1553104-s390x-arch12-test.patch
|
||||
Patch94: gdb-config.patch
|
||||
#Fedora Packages end
|
||||
|
||||
# Fedora Packages not copied:
|
||||
#
|
||||
# Not applicable for openSUSE:
|
||||
# - gdb-libexec-add-index.patch
|
||||
# - gdb-6.3-rh-testversion-20041202.patch
|
||||
# - gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
# - gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
#
|
||||
# Broken:
|
||||
# - gdb-bz533176-fortran-omp-step.patch
|
||||
# reported at https://sourceware.org/bugzilla/show_bug.cgi?id=26851
|
||||
# - gdb-6.5-BEA-testsuite.patch
|
||||
# over-specific test-case in a shell script
|
||||
#
|
||||
# Obsolete:
|
||||
# - gdb-6.7-charsign-test.patch
|
||||
|
||||
# Fedora patches fixup
|
||||
|
||||
Patch500: gdb-testsuite-avoid-pagination-in-attach-32.exp.patch
|
||||
Patch501: gdb-testsuite-fix-perror-in-gdb.opt-fortran-string.exp.patch
|
||||
Patch501: fixup-2-gdb-archer-vla-tests.patch
|
||||
Patch502: fixup-gdb-6.5-sharedlibrary-path.patch
|
||||
Patch503: fixup-gdb-6.6-buildid-locate.patch
|
||||
Patch504: fixup-gdb-dts-rhel6-python-compat.patch
|
||||
Patch505: fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch
|
||||
Patch506: fixup-gdb-vla-intel-fortran-vla-strings.patch
|
||||
Patch507: fixup-gdb-archer-vla-tests.patch
|
||||
Patch508: fixup-gdb-6.3-test-pie-20050107.patch
|
||||
Patch509: fixup-gdb-btrobust.patch
|
||||
Patch510: fixup-gdb-bz634108-solib_address.patch
|
||||
Patch511: fixup-gdb-gnat-dwarf-crash-3of3.patch
|
||||
Patch512: fixup-gdb-6.8-bz442765-threaded-exec-test.patch
|
||||
Patch513: fixup-gdb-vla-intel-tests.patch
|
||||
Patch514: fixup-gdb-6.3-threaded-watchpoints2-20050225.patch
|
||||
Patch515: fixup-3-gdb-archer-vla-tests.patch
|
||||
Patch516: fixup-gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
Patch517: fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
Patch518: fixup-gdb-test-ivy-bridge.patch
|
||||
|
||||
# openSUSE specific
|
||||
|
||||
@ -259,24 +279,40 @@ Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch
|
||||
Patch1003: gdb-testsuite-ada-pie.patch
|
||||
|
||||
# Patches to upstream
|
||||
Patch1500: gdb-fix-debug-agent-odr-bool-int.patch
|
||||
Patch1501: gdbserver-fix-build-with-make-3.81.patch
|
||||
|
||||
Patch1500: gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch
|
||||
Patch1501: gdb-fortran-fix-print-dynamic-array.patch
|
||||
Patch1502: gdb-don-t-return-non-existing-path-in-debuginfod-source-query.patch
|
||||
Patch1503: gdb-fix-assert-in-process-event-stop-test.patch
|
||||
Patch1504: gdb-fix-filename-in-not-in-executable-format-error.patch
|
||||
Patch1505: gdb-handle-no-upper-bound-in-value-subscript.patch
|
||||
Patch1506: gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch
|
||||
Patch1507: gdb-symtab-set-default-dwarf-max-cache-age-1000.patch
|
||||
Patch1508: gdb-testsuite-gdb-base-morestack-exp-no-clang.patch
|
||||
Patch1509: gdb-testsuite-handle-sigill-in-gdb-reverse-insn-reverse-exp.patch
|
||||
Patch1510: gdb-testsuite-fix-gdb-reverse-insn-reverse-x86-c-for-m32.patch
|
||||
Patch1511: gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch
|
||||
Patch1512: gdb-tui-enable-work-around-libncurses-segfault.patch
|
||||
Patch1513: gdb-testsuite-fix-control-flow-in-gdb-reverse-insn-reverse-exp.patch
|
||||
|
||||
# Backports from master
|
||||
|
||||
Patch2018: gdb-fix-toplevel-types-with-fdebug-types-section.patch
|
||||
Patch2019: gdb-fix-range-loop-index-in-find_method.patch
|
||||
Patch2020: gdb-fix-python3.9-related-runtime-problems.patch
|
||||
Patch2021: gdb-fix-unused-function-error.patch
|
||||
Patch2022: gdb-fix-the-thread-pool.c-compilation.patch
|
||||
Patch2023: gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch
|
||||
|
||||
# Proposed patch for PR threads/25478
|
||||
Patch2502: gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch
|
||||
Patch2000: gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch
|
||||
Patch2002: gdb-testsuite-catch-condition-evaluation-errors-in-gdb-assert.patch
|
||||
Patch2003: gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch
|
||||
Patch2004: gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch
|
||||
Patch2005: gdb-symtab-read-cu-base-address-for-enqueued-cu.patch
|
||||
Patch2006: gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch
|
||||
Patch2007: gdb-fix-section-matching-in-find_pc_sect_compunit.patch
|
||||
Patch2008: gdb-symtab-fix-language-of-frame-without-debug-info.patch
|
||||
Patch2009: gdb-testsuite-fix-failure-in-gdb-base-step-over-no-symbols-exp.patch
|
||||
|
||||
# Testsuite patches
|
||||
|
||||
# -
|
||||
Patch2500: gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch
|
||||
%if 0%{?suse_version} > 1500
|
||||
Patch2501: gdb-testsuite-disable-selftests-for-factory.patch
|
||||
%endif
|
||||
|
||||
# libipt support
|
||||
Patch3000: v1.5-libipt-static.patch
|
||||
@ -304,18 +340,33 @@ BuildRequires: makeinfo
|
||||
BuildRequires: texinfo
|
||||
%endif
|
||||
BuildRequires: expect
|
||||
|
||||
# Dependency is there for SLE-11, but configure test fails.
|
||||
BuildRequires: mpfr-devel
|
||||
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: readline-devel
|
||||
BuildRequires: rpm-devel
|
||||
# SLE-10 doesn't have xz-devel.
|
||||
%if 0%{suse_version} >= 1110
|
||||
BuildRequires: xz-devel
|
||||
%endif
|
||||
BuildRequires: zlib-devel
|
||||
%if 0%{!?_without_python:1}
|
||||
Requires: %{python}-base
|
||||
BuildRequires: %{python}-devel
|
||||
%endif # 0%{!?_without_python:1}
|
||||
|
||||
%global have_libdebuginfod 0
|
||||
%if 0%{?suse_version} > 1500
|
||||
%ifarch %{ix86} x86_64 aarch64 armv7l ppc64 ppc64le s390x
|
||||
%global have_libdebuginfod 1
|
||||
%endif
|
||||
%endif
|
||||
%if 0%{have_libdebuginfod}
|
||||
BuildRequires: libdebuginfod-devel
|
||||
BuildRequires: libdebuginfod1
|
||||
%endif
|
||||
%global have_libipt 0
|
||||
%if 0%{suse_version} > 1110
|
||||
%ifarch %{ix86} x86_64
|
||||
@ -437,13 +488,27 @@ BuildRequires: valgrind
|
||||
BuildRequires: binutils-gold
|
||||
%endif
|
||||
%else
|
||||
# SLE-10 doesn't have binutils-gold.
|
||||
%if 0%{suse_version} >= 1110
|
||||
BuildRequires: binutils-gold
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} >= 1200
|
||||
BuildRequires: systemtap-sdt-devel
|
||||
%endif
|
||||
|
||||
%if 0%{have_libdebuginfod}
|
||||
BuildRequires: curl
|
||||
BuildRequires: elfutils-debuginfod
|
||||
%endif
|
||||
|
||||
# SLE-10 doesn't have xz.
|
||||
%if 0%{suse_version} >= 1110
|
||||
# Missing on SLE-11
|
||||
BuildRequires: xz
|
||||
%endif
|
||||
|
||||
%endif # %%{build_testsuite}
|
||||
|
||||
%ifarch ia64
|
||||
@ -458,7 +523,6 @@ GDB, the GNU debugger, allows you to debug programs written in C, C++,
|
||||
Java, and other languages, by executing them in a controlled fashion
|
||||
and printing their data.
|
||||
|
||||
%ifnarch riscv64
|
||||
%package -n gdbserver
|
||||
Summary: A standalone server for GDB (the GNU source-level debugger)
|
||||
License: GPL-3.0-or-later AND GPL-3.0-with-GCC-exception AND LGPL-2.1-or-later AND LGPL-3.0-or-later
|
||||
@ -471,7 +535,6 @@ and printing their data.
|
||||
|
||||
This package provides a program that allows you to run GDB on a different
|
||||
machine than the one which is running the program being debugged.
|
||||
%endif
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for GDB (the GNU source-level debugger)
|
||||
@ -525,7 +588,6 @@ find -name "*.info*"|xargs rm -f
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
@ -541,7 +603,6 @@ find -name "*.info*"|xargs rm -f
|
||||
%patch27 -p1
|
||||
%patch28 -p1
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
%patch31 -p1
|
||||
%patch32 -p1
|
||||
%patch33 -p1
|
||||
@ -549,10 +610,8 @@ find -name "*.info*"|xargs rm -f
|
||||
%patch35 -p1
|
||||
%patch36 -p1
|
||||
%patch37 -p1
|
||||
%patch38 -p1
|
||||
%patch39 -p1
|
||||
%patch40 -p1
|
||||
%patch41 -p1
|
||||
%patch42 -p1
|
||||
%patch43 -p1
|
||||
%patch44 -p1
|
||||
@ -579,10 +638,10 @@ find -name "*.info*"|xargs rm -f
|
||||
%patch65 -p1
|
||||
%patch66 -p1
|
||||
%patch67 -p1
|
||||
%patch68 -p1
|
||||
%patch69 -p1
|
||||
%patch70 -p1
|
||||
%patch71 -p1
|
||||
%patch72 -p1
|
||||
%patch73 -p1
|
||||
%patch74 -p1
|
||||
%patch75 -p1
|
||||
@ -599,19 +658,31 @@ find -name "*.info*"|xargs rm -f
|
||||
%patch86 -p1
|
||||
%patch87 -p1
|
||||
%patch88 -p1
|
||||
%patch89 -p1
|
||||
%patch90 -p1
|
||||
%patch91 -p1
|
||||
%patch92 -p1
|
||||
%patch93 -p1
|
||||
%patch94 -p1
|
||||
%patch95 -p1
|
||||
%patch96 -p1
|
||||
%patch97 -p1
|
||||
%patch98 -p1
|
||||
#Fedora patching end
|
||||
|
||||
%patch500 -p1
|
||||
%patch501 -p1
|
||||
%patch502 -p1
|
||||
%patch503 -p1
|
||||
%patch504 -p1
|
||||
%patch505 -p1
|
||||
%patch506 -p1
|
||||
%patch507 -p1
|
||||
%patch508 -p1
|
||||
%patch509 -p1
|
||||
%patch510 -p1
|
||||
%patch511 -p1
|
||||
%patch512 -p1
|
||||
%patch513 -p1
|
||||
%patch514 -p1
|
||||
%patch515 -p1
|
||||
%patch516 -p1
|
||||
%patch517 -p1
|
||||
%patch518 -p1
|
||||
|
||||
%patch1000 -p1
|
||||
%patch1002 -p1
|
||||
@ -619,15 +690,33 @@ find -name "*.info*"|xargs rm -f
|
||||
|
||||
%patch1500 -p1
|
||||
%patch1501 -p1
|
||||
%patch1502 -p1
|
||||
%patch1503 -p1
|
||||
%patch1504 -p1
|
||||
%patch1505 -p1
|
||||
%patch1506 -p1
|
||||
%patch1507 -p1
|
||||
%patch1508 -p1
|
||||
%patch1509 -p1
|
||||
%patch1510 -p1
|
||||
%patch1511 -p1
|
||||
%patch1512 -p1
|
||||
%patch1513 -p1
|
||||
|
||||
%patch2018 -p1
|
||||
%patch2019 -p1
|
||||
%patch2020 -p1
|
||||
%patch2021 -p1
|
||||
%patch2022 -p1
|
||||
%patch2023 -p1
|
||||
%patch2000 -p1
|
||||
%patch2002 -p1
|
||||
%patch2003 -p1
|
||||
%patch2004 -p1
|
||||
%patch2005 -p1
|
||||
%patch2006 -p1
|
||||
%patch2007 -p1
|
||||
%patch2008 -p1
|
||||
%patch2009 -p1
|
||||
|
||||
%patch2502 -p1
|
||||
%patch2500 -p1
|
||||
%if 0%{?suse_version} > 1500
|
||||
%patch2501 -p1
|
||||
%endif
|
||||
|
||||
#unpack libipt
|
||||
%if 0%{have_libipt}
|
||||
@ -795,6 +884,8 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \
|
||||
%endif
|
||||
--with-bugurl=http://bugs.opensuse.org/ \
|
||||
--with-pkgversion="GDB; %{DIST}" \
|
||||
$(: ia64 is obsolete. ) \
|
||||
--enable-obsolete \
|
||||
${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \
|
||||
%ifarch sparc sparcv9
|
||||
--build=sparc-%{_vendor}-%{_target_os}%{?_gnu}
|
||||
@ -1168,16 +1259,6 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/stabs*
|
||||
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
|
||||
%ifarch riscv64
|
||||
# Work around RPM build error:
|
||||
# ...
|
||||
# Installed (but unpackaged) file(s) found:
|
||||
# /usr/share/man/man1/gdbserver.1.gz
|
||||
# ...
|
||||
# Filed at PR24575 - "gdbserver.1 should only be installed if gdbserver was
|
||||
# build" ( https://sourceware.org/bugzilla/show_bug.cgi?id=24575 ).
|
||||
rm %{buildroot}/usr/share/man/man1/gdbserver.1
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%post
|
||||
@ -1237,7 +1318,7 @@ fi
|
||||
# don't include the files in include, they are part of binutils
|
||||
|
||||
%if %{build_main}
|
||||
%ifnarch riscv64 sparcv9 hppa
|
||||
%ifnarch sparcv9 hppa
|
||||
%files -n gdbserver
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/gdbserver
|
||||
|
@ -1,33 +0,0 @@
|
||||
[gdbserver] Fix build with make 3.81
|
||||
|
||||
---
|
||||
gdb/gdbserver/Makefile.in | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
|
||||
index 16a9f2fd38..687bee2658 100644
|
||||
--- a/gdb/gdbserver/Makefile.in
|
||||
+++ b/gdb/gdbserver/Makefile.in
|
||||
@@ -580,9 +580,22 @@ ax.o: ax.c
|
||||
$(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
+ifeq ($(WORKAROUND_ALLOC_IPA),)
|
||||
+ifeq ($(MAKE_VERSION),3.81)
|
||||
+WORKAROUND_ALLOC_IPA = 1
|
||||
+else
|
||||
+WORKAROUND_ALLOC_IPA = 0
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(WORKAROUND_ALLOC_IPA),0)
|
||||
alloc-ipa.o: ../alloc.c
|
||||
$(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
|
||||
$(POSTCOMPILE)
|
||||
+else
|
||||
+alloc-ipa.o: ../alloc.c
|
||||
+ @$(MAKE) $(FLAGS_TO_PASS) WORKAROUND_ALLOC_IPA=0 alloc-ipa.o
|
||||
+endif
|
||||
|
||||
# Rules for objects that go in the in-process agent.
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:541e0cc969144ce64bcfced40fa21b08b77277d2420cffe2e86f1497f39e0e5c
|
||||
size 355385
|
3
v2.0.2.tar.gz
Normal file
3
v2.0.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8650195c4bc59b817c4819b778fddb8045c7fc6ecce78043bba89e2215af3ba1
|
||||
size 355877
|
Loading…
x
Reference in New Issue
Block a user