-# Copyright 2016-2018 Free Software Foundation, Inc.\r
+# Copyright 2016-2019 Free Software Foundation, Inc.\r
\r
# This program is free software; you can redistribute it and/or modify\r
# it under the terms of the GNU General Public License as published by\r
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
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
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