]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: modernize gdb.dwarf2/dw2-noloc.exp
authorGuinevere Larsen <blarsen@redhat.com>
Wed, 20 Dec 2023 11:46:42 +0000 (12:46 +0100)
committerGuinevere Larsen <blarsen@redhat.com>
Mon, 22 Jan 2024 10:30:07 +0000 (11:30 +0100)
commitb9bdebba83fafa4ad4a2328d00880410acd922aa
tree436433c6294eaf38818ab5c8876d28d9f1514d54
parent7b0b94b7b9a97c2af8c9557b2e5a3fc7ac3e6ee0
gdb/testsuite: modernize gdb.dwarf2/dw2-noloc.exp

The test gdb.dwarf2/dw2-noloc.exp predates the dwarf assembler, and uses
some unreliable assumptions about where global labels get put.
Specifically, when using clang to compile the test, both labels it uses
to gauge the adresses of the main function get reshuffled to be side-by-side,
and the debug information ends up making it look like main's high pc is equal
to low pc, meaning we never enter the main function's scope, and that leads to
22 failures because the "main_*" variables are technically never in scope.

This patch modernizes the aforementioned test to use the dwarf
assembler, which removes all failures when using clang.  It also renames
the .c file to be more inline with current standard.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.dwarf2/dw2-noloc-main.c [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-noloc.S [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-noloc.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/dw2-noloc.exp