gdb: Dynamic string length support
[binutils-gdb.git] / gdb / testsuite / gdb.fortran / nested-funcs.exp
index 2cfd402937ab43205a00d83c9216b576d9f75f5d..abc2423f8cfd5de4560309b4548d8523c37964a1 100755 (executable)
@@ -30,6 +30,11 @@ if ![runto MAIN__] then {
     continue\r
 }\r
 \r
+# Test if we can set a breakpoint in a nested function\r
+gdb_breakpoint "testnestedfuncs::sub_nested_outer"\r
+gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_outer" \\r
+    ".*local_int = 19"\r
+\r
 # Test if we can access local and\r
 # non-local variables defined one level up.\r
 gdb_breakpoint [gdb_get_line_number "! BP_outer"]\r
@@ -43,6 +48,11 @@ gdb_test "print local_int" "= 19" "print local_int in outer function"
 gdb_test "up"\r
 gdb_test "print index" "= 42" "print index at BP1, one frame up"\r
 \r
+# Test if we can set a breakpoint in a nested function\r
+gdb_breakpoint "testnestedfuncs::sub_nested_inner"\r
+gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_inner" \\r
+    ".*local_int = 17"\r
+\r
 # Test if we can access local and\r
 # non-local variables defined two level up.\r
 gdb_breakpoint [gdb_get_line_number "! BP_inner"]\r
@@ -57,6 +67,24 @@ gdb_continue_to_breakpoint "! BP_outer_2" ".*! BP_outer_2"
 gdb_test "print local_int" "= 19" \\r
   "print local_int in outer function, after sub_nested_inner"\r
 \r
+# Test if we can set a breakpoint in public routine with the same name\r
+# as the internal\r
+gdb_breakpoint "sub_nested_outer"\r
+gdb_continue_to_breakpoint "sub_nested_outer" \\r
+    ".*name = 'sub_nested_outer external'"\r
+\r
+# Test if we can set a breakpoint in public routine with the same name\r
+# as the internal\r
+gdb_breakpoint "sub_with_sub_nested_outer::sub_nested_outer"\r
+gdb_continue_to_breakpoint \\r
+    "sub_with_sub_nested_outer::sub_nested_outer" ".*local_int = 11"\r
+\r
+# Test if we can set a breakpoint in public routine with the same name\r
+# as the internal\r
+gdb_breakpoint "mod1::sub_nested_outer"\r
+gdb_continue_to_breakpoint "mod1::sub_nested_outer" \\r
+    ".*name = 'sub_nested_outer_mod1'"\r
+\r
 # Sanity check in main.\r
 gdb_breakpoint [gdb_get_line_number "! BP_main"]\r
 gdb_continue_to_breakpoint "! BP_main" ".*! BP_main"\r