2 Copyright 2009, 2010 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/>.
18 /* This was compiled from a trivial program just to test the
19 DW_OP_stack_value and DW_OP_implicit_value operators:
21 unsigned int func (unsigned int arg) __attribute__ ((__noinline__));
23 unsigned int func (unsigned int arg)
25 unsigned int uses_stack_op = 23;
26 unsigned int uses_lit_op = 0x7fffffff;
27 unsigned int result = arg;
30 result += uses_lit_op + uses_stack_op;
36 result -= uses_stack_op + uses_lit_op;
39 return result * uses_stack_op; // line 19, see the .exp file
42 int main (int argc, char *argv[])
47 Then it was compiled with:
49 gcc -fvar-tracking{,-assignments} -gdwarf-3
50 -fno-inline{,-functions,-small-functions,-functions-called-once}
56 .section .debug_abbrev,"",@progbits
58 .section .debug_info,"",@progbits
60 .section .debug_line,"",@progbits
77 .cfi_def_cfa_register 5
86 addl $2147483624, %eax
106 subl $2147483626, %eax
124 .type _start, @function
131 .cfi_def_cfa_offset 8
134 .cfi_def_cfa_register 5
147 .size _start, .-_start
149 .section .debug_loc,"",@progbits
225 .long .LVL11-1-.Ltext0
233 .long .LVL11-1-.Ltext0
242 .long .Ldebug_abbrev0
335 .section .debug_abbrev
457 .section .debug_pubnames,"",@progbits
467 .section .debug_aranges,"",@progbits
476 .long .Letext0-.Ltext0
479 .section .debug_str,"MS",@progbits,1
481 .string "unsigned int"
485 .string "uses_stack_op"
495 .string "GNU C 4.5.0 20090818 (experimental) [var-tracking-assignments-branch revision 150964]"
501 .string "uses_lit_op"
504 .ident "GCC: (GNU) 4.5.0 20090818 (experimental) [var-tracking-assignments-branch revision 150964]"
505 .section .note.GNU-stack,"",@progbits