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

Side by Side Diff: gdb/testsuite/gdb.base/gcore-relro-pie.exp

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/gcore-relro-pie.c ('k') | gdb/testsuite/gdb.base/gdb1056.exp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2013 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 # PR 11786 (Gold and strip differ on flags,align fields of PT_GNU_RELRO).
17 # Generate a core file from the stripped version of the program,
18 # and then try to debug the core with the unstripped version.
19
20 standard_testfile
21
22 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug additional_flag s=-fpie "ldflags=-pie -Wl,-z,relro"}]} {
23 return -1
24 }
25
26 set stripped_binfile ${binfile}.stripped
27 set gcorefile ${binfile}.gcore
28
29 set strip_program [transform strip]
30 remote_file host delete ${stripped_binfile}
31 if [run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"] {
32 return -1
33 }
34
35 # Workaround PR binutils/10802:
36 # Preserve the 'x' bit also for PIEs (Position Independent Executables).
37 set perm [file attributes ${binfile} -permissions]
38 file attributes ${stripped_binfile} -permissions $perm
39
40 clean_restart ${stripped_binfile}
41
42 # Does this gdb support gcore?
43 set test "help gcore"
44 gdb_test_multiple $test $test {
45 -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
46 # gcore command not supported -- nothing to test here.
47 unsupported "gdb does not support gcore on this target"
48 return -1
49 }
50 -re "Save a core file .*\r\n$gdb_prompt $" {
51 pass $test
52 }
53 }
54
55 # The binary is stripped of debug info, but not minsyms.
56 if ![runto break_here] {
57 fail "Can't run to break_here"
58 return -1
59 }
60
61 if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
62 return -1
63 }
64
65 # Now restart gdb with the unstripped binary and load the corefile.
66
67 clean_restart ${binfile}
68
69 gdb_test "core ${gcorefile}" \
70 "Core was generated by .*" "re-load generated corefile"
71
72 # Put $pc in gdb.log for debug purposes for comparison with stripped case.
73 gdb_test "x/i \$pc" "break_here.*"
74
75 gdb_test "frame" "#0 \[^\r\n\]* break_here .*" "unstripped + core ok"
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.base/gcore-relro-pie.c ('k') | gdb/testsuite/gdb.base/gdb1056.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698