Index: gdb/testsuite/gdb.base/macscp.exp |
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp |
index aed9b8d7d161f6dc0aa765a8b70eccadeb7447a1..1f995d570643e5f86a8844ab9a0503ec7412c02f 100644 |
--- a/gdb/testsuite/gdb.base/macscp.exp |
+++ b/gdb/testsuite/gdb.base/macscp.exp |
@@ -14,10 +14,6 @@ |
# You should have received a copy of the GNU General Public License |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
-if $tracelevel then { |
- strace $tracelevel |
-} |
- |
set srcfile macscp1.c |
set testfile "macscp" |
@@ -26,7 +22,7 @@ set binfile ${objdir}/${subdir}/${testfile} |
set options { debug additional_flags=-DFROM_COMMANDLINE=ARG} |
-get_compiler_info ${binfile} |
+get_compiler_info |
if [test_compiler_info gcc*] { |
lappend options additional_flags=-g3 |
} |
@@ -231,6 +227,10 @@ list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before macscp3_2}} |
gdb_test "info macro FROM_COMMANDLINE" \ |
"Defined at \[^\r\n\]*:0\r\n-DFROM_COMMANDLINE=ARG" |
+gdb_test "info macro __FILE__" "#define __FILE__ \".*macscp3.h\"" \ |
+ "info macro __FILE__ before running" |
+gdb_test "info macro __LINE__" "#define __LINE__ 26" \ |
+ "info macro __LINE__ before running" |
# Although GDB's macro table structures distinguish between multiple |
# #inclusions of the same file, GDB's other structures don't. So the |
@@ -440,6 +440,17 @@ gdb_test "break [gdb_get_line_number "set breakpoint here"]" \ |
"Breakpoint.*at.* file .*, line.*" \ |
"breakpoint macscp_expr" |
+gdb_test "cond \$bpnum foo == MACRO_TO_EXPAND" \ |
+ "No symbol \"MACRO_TO_EXPAND\" in current context\." \ |
+ "macro MACRO_TO_EXPAND not in scope at breakpoint" |
+ |
+# Note that we choose the condition so that this breakpoint never |
+# stops. |
+set l2 [gdb_get_line_number "set second breakpoint here"] |
+gdb_test "break $l2 if foo != MACRO_TO_EXPAND" \ |
+ "Breakpoint.*at.*" \ |
+ "breakpoint macscp_expr using MACRO_TO_EXPAND" |
+ |
gdb_test "continue" "foo = 0;.*" "continue to macsp_expr" |
gdb_test "print address.addr" \ |
@@ -450,7 +461,7 @@ gdb_test "print MACRO_TO_EXPAND" \ |
"No symbol \"MACRO_TO_EXPAND\" in current context\." \ |
"print expression with macro before define." |
-gdb_test "next" "foo = 1;" "next to definition 1" |
+gdb_test "next" "foo = 1;.*here.*/" "next to definition 1" |
gdb_test "print MACRO_TO_EXPAND" \ |
" = 0" \ |
@@ -470,7 +481,7 @@ gdb_test "print MACRO_TO_EXPAND" \ |
" = 0" \ |
"print expression with macro after removing override" |
-gdb_test "next" "foo = 2;" "next to definition 2" |
+gdb_test "next" "foo = 2;.*" "next to definition 2" |
gdb_test "print MACRO_TO_EXPAND" \ |
"No symbol \"MACRO_TO_EXPAND\" in current context\." \ |
@@ -677,3 +688,7 @@ gdb_test_no_output "macro define si_addr fields.fault.si_addr" \ |
gdb_test "macro expand siginfo.si_addr" \ |
"expands to: siginfo.fields.fault.si_addr" \ |
"macro expand siginfo.si_addr" |
+ |
+gdb_test "print __FILE__" " = \".*macscp1.c\"" |
+gdb_test "print __LINE__" \ |
+ " = [gdb_get_line_number {stopping point for line test}]" |