Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1142)

Unified Diff: gdb/testsuite/gdb.reverse/solib-precsave.exp

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.reverse/singlejmp-reverse-nodebug.c ('k') | gdb/testsuite/gdb.reverse/solib-reverse.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.reverse/solib-precsave.exp
diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp
index 4082672fb9e48fc07e2f371bcae91a98be62861e..85384c374fe43bcedc279cc050c94b4747ff2b3f 100644
--- a/gdb/testsuite/gdb.reverse/solib-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp
@@ -21,14 +21,13 @@ if ![supports_process_record] {
return
}
-set testfile "solib-reverse"
-set srcfile ${testfile}.c
+standard_testfile solib-reverse.c
+set precsave [standard_output_file solib.precsave]
set libfile "shr2"
set libsrc ${libfile}.c
-set library ${objdir}/${subdir}/${libfile}.sl
-set binfile ${objdir}/${subdir}/${testfile}
+set library [standard_output_file ${libfile}.sl]
-if [get_compiler_info ${binfile}] {
+if [get_compiler_info] {
return -1
}
@@ -39,7 +38,13 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${libsrc} ${library} "debug"] != ""
set exec_opts [list debug shlib=${library}]
-if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opts] != "" } {
+# Attempt to prevent -Wl,-z,relro which may happen by default with some
+# toolchain configurations. Due to PR corefiles/11804 GDB will then produce
+# invalid core file.
+
+if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable \
+ [concat $exec_opts additional_flags=-Wl,-z,norelro]] != ""
+ && [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opts] != "" } {
untested "Could not compile $binfile."
return -1
}
@@ -48,6 +53,10 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opt
gdb_exit
gdb_start
+
+# Clear it to never find any separate system debug infos.
+gdb_test_no_output "set debug-file-directory"
+
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
@@ -66,14 +75,14 @@ gdb_test "break $end_of_main" \
gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main"
-gdb_test "record save solib.precsave" \
- "Saved core file solib.precsave with execution log\." \
+gdb_test "record save $precsave" \
+ "Saved core file $precsave with execution log\." \
"save process recfile"
gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
-gdb_test "record restore solib.precsave" \
+gdb_test "record restore $precsave" \
"Program terminated with signal .*" \
"reload core file"
« no previous file with comments | « gdb/testsuite/gdb.reverse/singlejmp-reverse-nodebug.c ('k') | gdb/testsuite/gdb.reverse/solib-reverse.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698