Skip to content

Instantly share code, notes, and snippets.

@jmorse
Created February 28, 2022 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmorse/1d950ec4af341adc0fdf59f8324dcbe7 to your computer and use it in GitHub Desktop.
Save jmorse/1d950ec4af341adc0fdf59f8324dcbe7 to your computer and use it in GitHub Desktop.
struct foo {
int bar;
int baz;
int qux;
};
int quux(int a, int b, int c) {
struct foo xyzzy = {0, 0, 0};
xyzzy.bar += a;
xyzzy.baz += b;
xyzzy.qux -= c;
return xyzzy.bar * xyzzy.baz * xyzzy.qux;
}
0x00000054: DW_TAG_variable
DW_AT_location (indexed (0x0) loclist = 0x00000010:
[0x0000000000000000, 0x0000000000000002): DW_OP_reg5 RDI, DW_OP_piece 0x4, DW_OP_reg4 RSI, DW_OP_piece 0x4
[0x0000000000000002, 0x000000000000000b): DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4, DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4, DW_OP_lit0, DW_OP_stack_value, DW_OP_piece 0x4)
DW_AT_name ("xyzzy")
DW_AT_decl_file ("/tmp/test.c")
DW_AT_decl_line (8)
DW_AT_type (0x00000062 "foo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment