dw2-unresolved.exp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright 2009-2022 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 3 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. load_lib dwarf.exp
  15. # This test can only be run on targets which support DWARF-2 and use gas.
  16. if {![dwarf2_support]} {
  17. return 0
  18. }
  19. # Some targets have leading underscores on assembly symbols.
  20. set additional_flags [gdb_target_symbol_prefix_flags_asm]
  21. if { [prepare_for_testing "failed to prepare" "dw2-unresolved" \
  22. {dw2-unresolved-main.c dw2-unresolved.S} \
  23. [list nodebug $additional_flags]] } {
  24. return -1
  25. }
  26. if ![runto_main] {
  27. return -1
  28. }
  29. # This testcase tests LOC_UNRESOLVED works right.
  30. gdb_breakpoint "*extern_block_start"
  31. gdb_continue_to_breakpoint "*extern_block_start"
  32. # Expect the inner value 2. Value 1 from the outer local block is shadowed.
  33. gdb_test "print/d var" "= 2"