fission-loclists-pie.exp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 2016-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. #
  15. # This testcase exercises PR symtab/19999.
  16. # For Fission, while we shouldn't add the DWARF base address to addresses
  17. # coming from .debug_addr, will still need to add the base offset in case
  18. # we're debugging a PIE executable.
  19. load_lib dwarf.exp
  20. # We run objcopy locally to split out the .dwo file.
  21. if [is_remote host] {
  22. return 0
  23. }
  24. # This test can only be run on targets which support DWARF-2 and use gas.
  25. if ![dwarf2_support] {
  26. return 0
  27. }
  28. # This test can only be run on x86-64 targets.
  29. if {![istarget x86_64-*] || ![is_lp64_target]} {
  30. return 0
  31. }
  32. standard_testfile .S
  33. set obj [standard_output_file "${testfile}.o"]
  34. set dwo [standard_output_file "${testfile}.dwo"]
  35. if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" \
  36. {nodebug pie} \
  37. [list $srcfile [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
  38. $obj]] {
  39. return -1
  40. }
  41. clean_restart $binfile
  42. if ![runto_main] {
  43. return -1
  44. }
  45. # Verify gdb can find argc.
  46. gdb_test "p argc" " = 1"