mirror of
https://github.com/openharmony/third_party_elfutils.git
synced 2026-07-15 07:28:18 -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>
20 lines
315 B
C
20 lines
315 B
C
// gcc -g -O2 -o entry_value entry_value.c
|
|
int __attribute__((noinline, noclone)) foo (int x, int y)
|
|
{
|
|
return x + y;
|
|
}
|
|
|
|
int __attribute__((noinline, noclone)) bar (int x, int y)
|
|
{
|
|
int z;
|
|
z = foo (x, y);
|
|
z += foo (y, x);
|
|
return z;
|
|
}
|
|
|
|
int
|
|
main (int argc, char **argv)
|
|
{
|
|
return bar (argc + 1, argc - 1);
|
|
}
|