2 Copyright 2009-2019 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* This was compiled from a trivial program just to test the
18 DW_OP_stack_value and DW_OP_implicit_value operators:
20 unsigned int func (unsigned int arg) __attribute__ ((__noinline__));
22 unsigned int func (unsigned int arg)
24 unsigned int uses_stack_op = 23;
25 unsigned int uses_lit_op = 0x7fffffff;
26 unsigned int result = arg;
29 result += uses_lit_op + uses_stack_op;
35 result -= uses_stack_op + uses_lit_op;
38 return result * uses_stack_op; // line 19, see the .exp file
41 int main (int argc, char *argv[])
46 Then it was compiled with:
48 gcc -fvar-tracking{,-assignments} -gdwarf-3
49 -fno-inline{,-functions,-small-functions,-functions-called-once}
55 .section .debug_abbrev,"",@progbits
57 .section .debug_info,"",@progbits
59 .section .debug_line,"",@progbits
76 .cfi_def_cfa_register 5
85 addl $2147483624, %eax
105 subl $2147483626, %eax
123 .type _start, @function
130 .cfi_def_cfa_offset 8
133 .cfi_def_cfa_register 5
146 .size _start, .-_start
148 .section .debug_loc,"",@progbits
224 .long .LVL11-1-.Ltext0
232 .long .LVL11-1-.Ltext0
241 .long .Ldebug_abbrev0
334 .section .debug_abbrev
456 .section .debug_pubnames,"",@progbits
466 .section .debug_aranges,"",@progbits
475 .long .Letext0-.Ltext0
478 .section .debug_str,"MS",@progbits,1
480 .string "unsigned int"
484 .string "uses_stack_op"
494 .string "GNU C 4.5.0 20090818 (experimental) [var-tracking-assignments-branch revision 150964]"
500 .string "uses_lit_op"
503 .ident "GCC: (GNU) 4.5.0 20090818 (experimental) [var-tracking-assignments-branch revision 150964]"
504 .section .note.GNU-stack,"",@progbits