mirror of
https://github.com/openharmony/third_party_elfutils.git
synced 2026-07-16 07:44:26 -04:00
6e6e54e12a
This tests the new dwarf_getlocations, dwarf_getlocation_attr and dwarf_getlocation_die functions. But it is also an example of how to handle location expressions and which libdw functions can be used to access all information required to interpret each DW_OP. It might make sense to extend this test/example into a program that verifies various properties of DWARF expressions. Signed-off-by: Mark Wielaard <mjw@redhat.com>
13 lines
215 B
C
13 lines
215 B
C
// gcc -m32 -g -O2 -o implicit_value implicit_value.c
|
|
|
|
static __attribute__((noinline, noclone)) int foo ()
|
|
{
|
|
unsigned long long a[] = { 2, 21 };
|
|
return a[0] * a[1];
|
|
}
|
|
|
|
int main (void)
|
|
{
|
|
return foo () - 42;
|
|
}
|