- Fix crash on pending breakpoints with PIE (position-indep.-exec.) (BZ

505943).
This commit is contained in:
Jan Kratochvil 2009-06-15 12:53:17 +00:00
commit bcdbb34cad
3 changed files with 12 additions and 5 deletions

View file

@ -873,7 +873,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp 2008-12-09 17:24:34.000000000 +0100
@@ -0,0 +1,973 @@
@@ -0,0 +1,977 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
+# Free Software Foundation, Inc.
@ -1055,6 +1055,9 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
+set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
+set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
+
+# Test a pending breakpoint in PIE executable does not crash later GDB.
+gdb_breakpoint "non_existent_function" allow-pending
+
+gdb_test "info break" \
+ "Num\[ \]+Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
@ -1064,7 +1067,8 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location2.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_if_conditional at .*$srcfile:$bp_location3.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4" \
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4.*
+\[0-9\]+\[\t \]+breakpoint keep y.* <PENDING> *non_existent_function" \
+ "breakpoint info"
+
+# FIXME: The rest of this test doesn't work with anything that can't
@ -1490,7 +1494,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
+}
+send_gdb "print marker2(99)\n"
+gdb_expect {
+ -re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
+ -re "The program being debugged stopped while in a function called from GDB.\r\nEvaluation of the expression containing the function\r\n.marker2$proto. will be abandoned.\r\nWhen the function is done executing, GDB will silently stop.\r\n$gdb_prompt $"\
+ {pass "hit breakpoint on called function"}
+ -re "$gdb_prompt $"\
+ {fail "hit breakpoint on called function"}