1 http://sourceware.org/ml/gdb-patches/2012-10/msg00095.html
2 Subject: [patch] entry values: Fix resolving in inlined frames
6 Breakpoint 1, fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
7 32 y = -2 + x; /* break-here */
10 #0 fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
11 #1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
12 #2 0x00000000004004af in main () at gdb.arch/amd64-entry-value-inline.c:48
14 Stack level 0, frame at 0x7fffffffdb68:
15 rip = 0x4005bc in fn2 (gdb.arch/amd64-entry-value-inline.c:32); saved rip 0x4004af
18 (gdb) set debug entry-values 1
20 DW_OP_GNU_entry_value resolving expects callee fn1 at 0x4005a0 but the called frame is for fn3 at 0x4005b0
32 #1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
36 The problem is that DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value binding
37 exists between DW_TAG_subprogram, nor DW_TAG_inlined_subroutine as described
38 by Jakub Jelinek. This makes sense, when we look at DW_TAG_GNU_call_site and
39 we just unwind the current inlined frame we get the same PC - this is no new
42 TAILCALL_FRAME is a different case, while also an artificial frame the
43 sequence cannot be determined at compile time and the binding
44 DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value exists also for
49 No regressions on {x86_64,x86_64-m32,i686}-fedora18-linux-gnu.
57 2012-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
59 Fix entry values resolving in inlined frames.
60 * dwarf2loc.c (dwarf_expr_reg_to_entry_parameter): Move func_addr,
61 gdbarch and caller_frame initialization later. Skip INLINE_FRAME
65 2012-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
67 Fix entry values resolving in inlined frames.
68 * gdb.arch/amd64-entry-value-inline.S: New file.
69 * gdb.arch/amd64-entry-value-inline.c: New file.
70 * gdb.arch/amd64-entry-value-inline.exp: New file.
72 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
73 index e8d39fe..0bdc042 100644
76 @@ -980,16 +980,27 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
77 union call_site_parameter_u kind_u,
78 struct dwarf2_per_cu_data **per_cu_return)
80 - CORE_ADDR func_addr = get_frame_func (frame);
81 - CORE_ADDR caller_pc;
82 - struct gdbarch *gdbarch = get_frame_arch (frame);
83 - struct frame_info *caller_frame = get_prev_frame (frame);
84 + CORE_ADDR func_addr, caller_pc;
85 + struct gdbarch *gdbarch;
86 + struct frame_info *caller_frame;
87 struct call_site *call_site;
89 /* Initialize it just to avoid a GCC false warning. */
90 struct call_site_parameter *parameter = NULL;
91 CORE_ADDR target_addr;
93 + /* Skip any inlined frames, entry value call sites work between real
94 + functions. They do not make sense between inline functions as even PC
95 + does not change there. */
96 + while (get_frame_type (frame) == INLINE_FRAME)
98 + frame = get_prev_frame (frame);
99 + gdb_assert (frame != NULL);
102 + func_addr = get_frame_func (frame);
103 + gdbarch = get_frame_arch (frame);
104 + caller_frame = get_prev_frame (frame);
105 if (gdbarch != frame_unwind_arch (frame))
107 struct minimal_symbol *msym = lookup_minimal_symbol_by_pc (func_addr);
108 diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S
110 index 0000000..5f353f5
112 +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S
114 +/* This testcase is part of GDB, the GNU debugger.
116 + Copyright 2012 Free Software Foundation, Inc.
118 + This program is free software; you can redistribute it and/or modify
119 + it under the terms of the GNU General Public License as published by
120 + the Free Software Foundation; either version 3 of the License, or
121 + (at your option) any later version.
123 + This program is distributed in the hope that it will be useful,
124 + but WITHOUT ANY WARRANTY; without even the implied warranty of
125 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
126 + GNU General Public License for more details.
128 + You should have received a copy of the GNU General Public License
129 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
131 +/* This file is compiled from gdb.arch/amd64-entry-value-inline.c
132 + using -g -dA -S -O2. */
134 + .file "amd64-entry-value-inline.c"
138 + .type fn1, @function
141 + .file 1 "gdb.arch/amd64-entry-value-inline.c"
142 + # gdb.arch/amd64-entry-value-inline.c:22
146 +# BLOCK 2 freq:10000 seq:0
147 +# PRED: ENTRY [100.0%] (FALLTHRU)
148 + # gdb.arch/amd64-entry-value-inline.c:23
153 +# SUCC: EXIT [100.0%]
160 + .type fn3, @function
163 + # gdb.arch/amd64-entry-value-inline.c:41
167 +# BLOCK 2 freq:10000 seq:0
168 +# PRED: ENTRY [100.0%] (FALLTHRU)
171 + # gdb.arch/amd64-entry-value-inline.c:29
176 + # gdb.arch/amd64-entry-value-inline.c:41
179 + .cfi_def_cfa_offset 16
181 + # gdb.arch/amd64-entry-value-inline.c:41
186 +# SUCC: 3 [39.0%] (FALLTHRU,CAN_FALLTHRU) 4 [61.0%] (CAN_FALLTHRU)
187 + # gdb.arch/amd64-entry-value-inline.c:29
190 +# BLOCK 3 freq:3898 seq:1
191 +# PRED: 2 [39.0%] (FALLTHRU,CAN_FALLTHRU)
192 + # gdb.arch/amd64-entry-value-inline.c:31
196 + # gdb.arch/amd64-entry-value-inline.c:32
198 + leal -2(%rbx), %eax
200 + # gdb.arch/amd64-entry-value-inline.c:33
208 + # gdb.arch/amd64-entry-value-inline.c:34
210 + leal (%rbx,%rax), %edi
213 +# SUCC: 4 [100.0%] (FALLTHRU,CAN_FALLTHRU)
214 +# BLOCK 4 freq:10000 seq:2
215 +# PRED: 2 [61.0%] (CAN_FALLTHRU) 3 [100.0%] (FALLTHRU,CAN_FALLTHRU)
219 + # gdb.arch/amd64-entry-value-inline.c:43
223 + .cfi_def_cfa_offset 8
225 +# SUCC: EXIT [100.0%]
230 + .section .text.startup,"ax",@progbits
233 + .type main, @function
236 + # gdb.arch/amd64-entry-value-inline.c:47
239 +# BLOCK 2 freq:10000 seq:0
240 +# PRED: ENTRY [100.0%] (FALLTHRU)
241 + # gdb.arch/amd64-entry-value-inline.c:48
247 + # gdb.arch/amd64-entry-value-inline.c:50
250 +# SUCC: EXIT [100.0%]
259 + .section .debug_info,"",@progbits
261 + .long 0x164 # Length of Compilation Unit Info
262 + .value 0x4 # DWARF version number
263 + .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
264 + .byte 0x8 # Pointer Size (in bytes)
265 + .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
266 + .long .LASF0 # DW_AT_producer: "GNU C 4.8.0 20121005 (experimental) -mtune=generic -march=x86-64 -g -O2"
267 + .byte 0x1 # DW_AT_language
268 + .long .LASF1 # DW_AT_name: "gdb.arch/amd64-entry-value-inline.c"
269 + .long .LASF2 # DW_AT_comp_dir: ""
270 + .long .Ldebug_ranges0+0x30 # DW_AT_ranges
271 + .quad 0 # DW_AT_low_pc
272 + .long .Ldebug_line0 # DW_AT_stmt_list
273 + .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
274 + .ascii "fn1\0" # DW_AT_name
275 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
276 + .byte 0x15 # DW_AT_decl_line
278 + .quad .LFB0 # DW_AT_low_pc
279 + .quad .LFE0-.LFB0 # DW_AT_high_pc
280 + .uleb128 0x1 # DW_AT_frame_base
281 + .byte 0x9c # DW_OP_call_frame_cfa
282 + # DW_AT_GNU_all_call_sites
283 + .long 0x52 # DW_AT_sibling
284 + .uleb128 0x3 # (DIE (0x46) DW_TAG_formal_parameter)
285 + .ascii "x\0" # DW_AT_name
286 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
287 + .byte 0x15 # DW_AT_decl_line
288 + .long 0x52 # DW_AT_type
289 + .uleb128 0x1 # DW_AT_location
290 + .byte 0x55 # DW_OP_reg5
291 + .byte 0 # end of children of DIE 0x29
292 + .uleb128 0x4 # (DIE (0x52) DW_TAG_base_type)
293 + .byte 0x4 # DW_AT_byte_size
294 + .byte 0x5 # DW_AT_encoding
295 + .ascii "int\0" # DW_AT_name
296 + .uleb128 0x5 # (DIE (0x59) DW_TAG_subprogram)
297 + .ascii "fn2\0" # DW_AT_name
298 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
299 + .byte 0x1b # DW_AT_decl_line
301 + .long 0x52 # DW_AT_type
302 + .byte 0x1 # DW_AT_inline
303 + .long 0x7c # DW_AT_sibling
304 + .uleb128 0x6 # (DIE (0x69) DW_TAG_formal_parameter)
305 + .ascii "x\0" # DW_AT_name
306 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
307 + .byte 0x1b # DW_AT_decl_line
308 + .long 0x52 # DW_AT_type
309 + .uleb128 0x6 # (DIE (0x72) DW_TAG_formal_parameter)
310 + .ascii "y\0" # DW_AT_name
311 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
312 + .byte 0x1b # DW_AT_decl_line
313 + .long 0x52 # DW_AT_type
314 + .byte 0 # end of children of DIE 0x59
315 + .uleb128 0x7 # (DIE (0x7c) DW_TAG_subprogram)
317 + .ascii "fn3\0" # DW_AT_name
318 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
319 + .byte 0x28 # DW_AT_decl_line
321 + .long 0x52 # DW_AT_type
322 + .quad .LFB2 # DW_AT_low_pc
323 + .quad .LFE2-.LFB2 # DW_AT_high_pc
324 + .uleb128 0x1 # DW_AT_frame_base
325 + .byte 0x9c # DW_OP_call_frame_cfa
326 + # DW_AT_GNU_all_call_sites
327 + .long 0x115 # DW_AT_sibling
328 + .uleb128 0x8 # (DIE (0x9d) DW_TAG_formal_parameter)
329 + .ascii "x\0" # DW_AT_name
330 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
331 + .byte 0x28 # DW_AT_decl_line
332 + .long 0x52 # DW_AT_type
333 + .long .LLST0 # DW_AT_location
334 + .uleb128 0x8 # (DIE (0xaa) DW_TAG_formal_parameter)
335 + .ascii "y\0" # DW_AT_name
336 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
337 + .byte 0x28 # DW_AT_decl_line
338 + .long 0x52 # DW_AT_type
339 + .long .LLST1 # DW_AT_location
340 + .uleb128 0x9 # (DIE (0xb7) DW_TAG_inlined_subroutine)
341 + .long 0x59 # DW_AT_abstract_origin
342 + .quad .LBB4 # DW_AT_entry_pc
343 + .long .Ldebug_ranges0+0 # DW_AT_ranges
344 + .byte 0x1 # DW_AT_call_file (gdb.arch/amd64-entry-value-inline.c)
345 + .byte 0x2a # DW_AT_call_line
346 + .uleb128 0xa # (DIE (0xca) DW_TAG_formal_parameter)
347 + .long 0x72 # DW_AT_abstract_origin
348 + .long .LLST2 # DW_AT_location
349 + .uleb128 0xa # (DIE (0xd3) DW_TAG_formal_parameter)
350 + .long 0x69 # DW_AT_abstract_origin
351 + .long .LLST0 # DW_AT_location
352 + .uleb128 0xb # (DIE (0xdc) DW_TAG_GNU_call_site)
353 + .quad .LVL2 # DW_AT_low_pc
354 + .long 0x29 # DW_AT_abstract_origin
355 + .long 0xf4 # DW_AT_sibling
356 + .uleb128 0xc # (DIE (0xed) DW_TAG_GNU_call_site_parameter)
357 + .uleb128 0x1 # DW_AT_location
358 + .byte 0x55 # DW_OP_reg5
359 + .uleb128 0x2 # DW_AT_GNU_call_site_value
360 + .byte 0x73 # DW_OP_breg3
362 + .byte 0 # end of children of DIE 0xdc
363 + .uleb128 0xd # (DIE (0xf4) DW_TAG_GNU_call_site)
364 + .quad .LVL6 # DW_AT_low_pc
365 + .long 0x29 # DW_AT_abstract_origin
366 + .uleb128 0xc # (DIE (0x101) DW_TAG_GNU_call_site_parameter)
367 + .uleb128 0x1 # DW_AT_location
368 + .byte 0x55 # DW_OP_reg5
369 + .uleb128 0xd # DW_AT_GNU_call_site_value
370 + .byte 0x73 # DW_OP_breg3
372 + .byte 0x73 # DW_OP_breg3
374 + .byte 0x73 # DW_OP_breg3
376 + .byte 0x1e # DW_OP_mul
377 + .byte 0x23 # DW_OP_plus_uconst
379 + .byte 0x1e # DW_OP_mul
380 + .byte 0x73 # DW_OP_breg3
382 + .byte 0x22 # DW_OP_plus
383 + .byte 0 # end of children of DIE 0xf4
384 + .byte 0 # end of children of DIE 0xb7
385 + .byte 0 # end of children of DIE 0x7c
386 + .uleb128 0xe # (DIE (0x115) DW_TAG_subprogram)
388 + .long .LASF3 # DW_AT_name: "main"
389 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
390 + .byte 0x2e # DW_AT_decl_line
391 + .long 0x52 # DW_AT_type
392 + .quad .LFB3 # DW_AT_low_pc
393 + .quad .LFE3-.LFB3 # DW_AT_high_pc
394 + .uleb128 0x1 # DW_AT_frame_base
395 + .byte 0x9c # DW_OP_call_frame_cfa
396 + # DW_AT_GNU_all_call_sites
397 + .long 0x14f # DW_AT_sibling
398 + .uleb128 0xd # (DIE (0x136) DW_TAG_GNU_call_site)
399 + .quad .LVL8 # DW_AT_low_pc
400 + .long 0x7c # DW_AT_abstract_origin
401 + .uleb128 0xc # (DIE (0x143) DW_TAG_GNU_call_site_parameter)
402 + .uleb128 0x1 # DW_AT_location
403 + .byte 0x55 # DW_OP_reg5
404 + .uleb128 0x1 # DW_AT_GNU_call_site_value
405 + .byte 0x36 # DW_OP_lit6
406 + .uleb128 0xc # (DIE (0x148) DW_TAG_GNU_call_site_parameter)
407 + .uleb128 0x1 # DW_AT_location
408 + .byte 0x54 # DW_OP_reg4
409 + .uleb128 0x1 # DW_AT_GNU_call_site_value
410 + .byte 0x49 # DW_OP_lit25
411 + .byte 0 # end of children of DIE 0x136
412 + .byte 0 # end of children of DIE 0x115
413 + .uleb128 0xf # (DIE (0x14f) DW_TAG_variable)
414 + .ascii "v\0" # DW_AT_name
415 + .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
416 + .byte 0x12 # DW_AT_decl_line
417 + .long 0x162 # DW_AT_type
418 + .uleb128 0x9 # DW_AT_location
419 + .byte 0x3 # DW_OP_addr
421 + .uleb128 0x10 # (DIE (0x162) DW_TAG_volatile_type)
422 + .long 0x52 # DW_AT_type
423 + .byte 0 # end of children of DIE 0xb
424 + .section .debug_abbrev,"",@progbits
426 + .uleb128 0x1 # (abbrev code)
427 + .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
428 + .byte 0x1 # DW_children_yes
429 + .uleb128 0x25 # (DW_AT_producer)
430 + .uleb128 0xe # (DW_FORM_strp)
431 + .uleb128 0x13 # (DW_AT_language)
432 + .uleb128 0xb # (DW_FORM_data1)
433 + .uleb128 0x3 # (DW_AT_name)
434 + .uleb128 0xe # (DW_FORM_strp)
435 + .uleb128 0x1b # (DW_AT_comp_dir)
436 + .uleb128 0xe # (DW_FORM_strp)
437 + .uleb128 0x55 # (DW_AT_ranges)
438 + .uleb128 0x17 # (DW_FORM_sec_offset)
439 + .uleb128 0x11 # (DW_AT_low_pc)
440 + .uleb128 0x1 # (DW_FORM_addr)
441 + .uleb128 0x10 # (DW_AT_stmt_list)
442 + .uleb128 0x17 # (DW_FORM_sec_offset)
445 + .uleb128 0x2 # (abbrev code)
446 + .uleb128 0x2e # (TAG: DW_TAG_subprogram)
447 + .byte 0x1 # DW_children_yes
448 + .uleb128 0x3 # (DW_AT_name)
449 + .uleb128 0x8 # (DW_FORM_string)
450 + .uleb128 0x3a # (DW_AT_decl_file)
451 + .uleb128 0xb # (DW_FORM_data1)
452 + .uleb128 0x3b # (DW_AT_decl_line)
453 + .uleb128 0xb # (DW_FORM_data1)
454 + .uleb128 0x27 # (DW_AT_prototyped)
455 + .uleb128 0x19 # (DW_FORM_flag_present)
456 + .uleb128 0x11 # (DW_AT_low_pc)
457 + .uleb128 0x1 # (DW_FORM_addr)
458 + .uleb128 0x12 # (DW_AT_high_pc)
459 + .uleb128 0x7 # (DW_FORM_data8)
460 + .uleb128 0x40 # (DW_AT_frame_base)
461 + .uleb128 0x18 # (DW_FORM_exprloc)
462 + .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
463 + .uleb128 0x19 # (DW_FORM_flag_present)
464 + .uleb128 0x1 # (DW_AT_sibling)
465 + .uleb128 0x13 # (DW_FORM_ref4)
468 + .uleb128 0x3 # (abbrev code)
469 + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
470 + .byte 0 # DW_children_no
471 + .uleb128 0x3 # (DW_AT_name)
472 + .uleb128 0x8 # (DW_FORM_string)
473 + .uleb128 0x3a # (DW_AT_decl_file)
474 + .uleb128 0xb # (DW_FORM_data1)
475 + .uleb128 0x3b # (DW_AT_decl_line)
476 + .uleb128 0xb # (DW_FORM_data1)
477 + .uleb128 0x49 # (DW_AT_type)
478 + .uleb128 0x13 # (DW_FORM_ref4)
479 + .uleb128 0x2 # (DW_AT_location)
480 + .uleb128 0x18 # (DW_FORM_exprloc)
483 + .uleb128 0x4 # (abbrev code)
484 + .uleb128 0x24 # (TAG: DW_TAG_base_type)
485 + .byte 0 # DW_children_no
486 + .uleb128 0xb # (DW_AT_byte_size)
487 + .uleb128 0xb # (DW_FORM_data1)
488 + .uleb128 0x3e # (DW_AT_encoding)
489 + .uleb128 0xb # (DW_FORM_data1)
490 + .uleb128 0x3 # (DW_AT_name)
491 + .uleb128 0x8 # (DW_FORM_string)
494 + .uleb128 0x5 # (abbrev code)
495 + .uleb128 0x2e # (TAG: DW_TAG_subprogram)
496 + .byte 0x1 # DW_children_yes
497 + .uleb128 0x3 # (DW_AT_name)
498 + .uleb128 0x8 # (DW_FORM_string)
499 + .uleb128 0x3a # (DW_AT_decl_file)
500 + .uleb128 0xb # (DW_FORM_data1)
501 + .uleb128 0x3b # (DW_AT_decl_line)
502 + .uleb128 0xb # (DW_FORM_data1)
503 + .uleb128 0x27 # (DW_AT_prototyped)
504 + .uleb128 0x19 # (DW_FORM_flag_present)
505 + .uleb128 0x49 # (DW_AT_type)
506 + .uleb128 0x13 # (DW_FORM_ref4)
507 + .uleb128 0x20 # (DW_AT_inline)
508 + .uleb128 0xb # (DW_FORM_data1)
509 + .uleb128 0x1 # (DW_AT_sibling)
510 + .uleb128 0x13 # (DW_FORM_ref4)
513 + .uleb128 0x6 # (abbrev code)
514 + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
515 + .byte 0 # DW_children_no
516 + .uleb128 0x3 # (DW_AT_name)
517 + .uleb128 0x8 # (DW_FORM_string)
518 + .uleb128 0x3a # (DW_AT_decl_file)
519 + .uleb128 0xb # (DW_FORM_data1)
520 + .uleb128 0x3b # (DW_AT_decl_line)
521 + .uleb128 0xb # (DW_FORM_data1)
522 + .uleb128 0x49 # (DW_AT_type)
523 + .uleb128 0x13 # (DW_FORM_ref4)
526 + .uleb128 0x7 # (abbrev code)
527 + .uleb128 0x2e # (TAG: DW_TAG_subprogram)
528 + .byte 0x1 # DW_children_yes
529 + .uleb128 0x3f # (DW_AT_external)
530 + .uleb128 0x19 # (DW_FORM_flag_present)
531 + .uleb128 0x3 # (DW_AT_name)
532 + .uleb128 0x8 # (DW_FORM_string)
533 + .uleb128 0x3a # (DW_AT_decl_file)
534 + .uleb128 0xb # (DW_FORM_data1)
535 + .uleb128 0x3b # (DW_AT_decl_line)
536 + .uleb128 0xb # (DW_FORM_data1)
537 + .uleb128 0x27 # (DW_AT_prototyped)
538 + .uleb128 0x19 # (DW_FORM_flag_present)
539 + .uleb128 0x49 # (DW_AT_type)
540 + .uleb128 0x13 # (DW_FORM_ref4)
541 + .uleb128 0x11 # (DW_AT_low_pc)
542 + .uleb128 0x1 # (DW_FORM_addr)
543 + .uleb128 0x12 # (DW_AT_high_pc)
544 + .uleb128 0x7 # (DW_FORM_data8)
545 + .uleb128 0x40 # (DW_AT_frame_base)
546 + .uleb128 0x18 # (DW_FORM_exprloc)
547 + .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
548 + .uleb128 0x19 # (DW_FORM_flag_present)
549 + .uleb128 0x1 # (DW_AT_sibling)
550 + .uleb128 0x13 # (DW_FORM_ref4)
553 + .uleb128 0x8 # (abbrev code)
554 + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
555 + .byte 0 # DW_children_no
556 + .uleb128 0x3 # (DW_AT_name)
557 + .uleb128 0x8 # (DW_FORM_string)
558 + .uleb128 0x3a # (DW_AT_decl_file)
559 + .uleb128 0xb # (DW_FORM_data1)
560 + .uleb128 0x3b # (DW_AT_decl_line)
561 + .uleb128 0xb # (DW_FORM_data1)
562 + .uleb128 0x49 # (DW_AT_type)
563 + .uleb128 0x13 # (DW_FORM_ref4)
564 + .uleb128 0x2 # (DW_AT_location)
565 + .uleb128 0x17 # (DW_FORM_sec_offset)
568 + .uleb128 0x9 # (abbrev code)
569 + .uleb128 0x1d # (TAG: DW_TAG_inlined_subroutine)
570 + .byte 0x1 # DW_children_yes
571 + .uleb128 0x31 # (DW_AT_abstract_origin)
572 + .uleb128 0x13 # (DW_FORM_ref4)
573 + .uleb128 0x52 # (DW_AT_entry_pc)
574 + .uleb128 0x1 # (DW_FORM_addr)
575 + .uleb128 0x55 # (DW_AT_ranges)
576 + .uleb128 0x17 # (DW_FORM_sec_offset)
577 + .uleb128 0x58 # (DW_AT_call_file)
578 + .uleb128 0xb # (DW_FORM_data1)
579 + .uleb128 0x59 # (DW_AT_call_line)
580 + .uleb128 0xb # (DW_FORM_data1)
583 + .uleb128 0xa # (abbrev code)
584 + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
585 + .byte 0 # DW_children_no
586 + .uleb128 0x31 # (DW_AT_abstract_origin)
587 + .uleb128 0x13 # (DW_FORM_ref4)
588 + .uleb128 0x2 # (DW_AT_location)
589 + .uleb128 0x17 # (DW_FORM_sec_offset)
592 + .uleb128 0xb # (abbrev code)
593 + .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
594 + .byte 0x1 # DW_children_yes
595 + .uleb128 0x11 # (DW_AT_low_pc)
596 + .uleb128 0x1 # (DW_FORM_addr)
597 + .uleb128 0x31 # (DW_AT_abstract_origin)
598 + .uleb128 0x13 # (DW_FORM_ref4)
599 + .uleb128 0x1 # (DW_AT_sibling)
600 + .uleb128 0x13 # (DW_FORM_ref4)
603 + .uleb128 0xc # (abbrev code)
604 + .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter)
605 + .byte 0 # DW_children_no
606 + .uleb128 0x2 # (DW_AT_location)
607 + .uleb128 0x18 # (DW_FORM_exprloc)
608 + .uleb128 0x2111 # (DW_AT_GNU_call_site_value)
609 + .uleb128 0x18 # (DW_FORM_exprloc)
612 + .uleb128 0xd # (abbrev code)
613 + .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
614 + .byte 0x1 # DW_children_yes
615 + .uleb128 0x11 # (DW_AT_low_pc)
616 + .uleb128 0x1 # (DW_FORM_addr)
617 + .uleb128 0x31 # (DW_AT_abstract_origin)
618 + .uleb128 0x13 # (DW_FORM_ref4)
621 + .uleb128 0xe # (abbrev code)
622 + .uleb128 0x2e # (TAG: DW_TAG_subprogram)
623 + .byte 0x1 # DW_children_yes
624 + .uleb128 0x3f # (DW_AT_external)
625 + .uleb128 0x19 # (DW_FORM_flag_present)
626 + .uleb128 0x3 # (DW_AT_name)
627 + .uleb128 0xe # (DW_FORM_strp)
628 + .uleb128 0x3a # (DW_AT_decl_file)
629 + .uleb128 0xb # (DW_FORM_data1)
630 + .uleb128 0x3b # (DW_AT_decl_line)
631 + .uleb128 0xb # (DW_FORM_data1)
632 + .uleb128 0x49 # (DW_AT_type)
633 + .uleb128 0x13 # (DW_FORM_ref4)
634 + .uleb128 0x11 # (DW_AT_low_pc)
635 + .uleb128 0x1 # (DW_FORM_addr)
636 + .uleb128 0x12 # (DW_AT_high_pc)
637 + .uleb128 0x7 # (DW_FORM_data8)
638 + .uleb128 0x40 # (DW_AT_frame_base)
639 + .uleb128 0x18 # (DW_FORM_exprloc)
640 + .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
641 + .uleb128 0x19 # (DW_FORM_flag_present)
642 + .uleb128 0x1 # (DW_AT_sibling)
643 + .uleb128 0x13 # (DW_FORM_ref4)
646 + .uleb128 0xf # (abbrev code)
647 + .uleb128 0x34 # (TAG: DW_TAG_variable)
648 + .byte 0 # DW_children_no
649 + .uleb128 0x3 # (DW_AT_name)
650 + .uleb128 0x8 # (DW_FORM_string)
651 + .uleb128 0x3a # (DW_AT_decl_file)
652 + .uleb128 0xb # (DW_FORM_data1)
653 + .uleb128 0x3b # (DW_AT_decl_line)
654 + .uleb128 0xb # (DW_FORM_data1)
655 + .uleb128 0x49 # (DW_AT_type)
656 + .uleb128 0x13 # (DW_FORM_ref4)
657 + .uleb128 0x2 # (DW_AT_location)
658 + .uleb128 0x18 # (DW_FORM_exprloc)
661 + .uleb128 0x10 # (abbrev code)
662 + .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
663 + .byte 0 # DW_children_no
664 + .uleb128 0x49 # (DW_AT_type)
665 + .uleb128 0x13 # (DW_FORM_ref4)
669 + .section .debug_loc,"",@progbits
672 + .quad .LVL1 # Location list begin address (*.LLST0)
673 + .quad .LVL2-1 # Location list end address (*.LLST0)
674 + .value 0x1 # Location expression size
675 + .byte 0x55 # DW_OP_reg5
676 + .quad .LVL2-1 # Location list begin address (*.LLST0)
677 + .quad .LVL7 # Location list end address (*.LLST0)
678 + .value 0x1 # Location expression size
679 + .byte 0x53 # DW_OP_reg3
680 + .quad .LVL7 # Location list begin address (*.LLST0)
681 + .quad .LFE2 # Location list end address (*.LLST0)
682 + .value 0x1 # Location expression size
683 + .byte 0x50 # DW_OP_reg0
684 + .quad 0 # Location list terminator begin (*.LLST0)
685 + .quad 0 # Location list terminator end (*.LLST0)
687 + .quad .LVL1 # Location list begin address (*.LLST1)
688 + .quad .LVL2-1 # Location list end address (*.LLST1)
689 + .value 0x1 # Location expression size
690 + .byte 0x54 # DW_OP_reg4
691 + .quad .LVL2-1 # Location list begin address (*.LLST1)
692 + .quad .LFE2 # Location list end address (*.LLST1)
693 + .value 0x4 # Location expression size
694 + .byte 0xf3 # DW_OP_GNU_entry_value
696 + .byte 0x54 # DW_OP_reg4
697 + .byte 0x9f # DW_OP_stack_value
698 + .quad 0 # Location list terminator begin (*.LLST1)
699 + .quad 0 # Location list terminator end (*.LLST1)
701 + .quad .LVL1 # Location list begin address (*.LLST2)
702 + .quad .LVL2-1 # Location list end address (*.LLST2)
703 + .value 0x1 # Location expression size
704 + .byte 0x54 # DW_OP_reg4
705 + .quad .LVL2-1 # Location list begin address (*.LLST2)
706 + .quad .LVL3 # Location list end address (*.LLST2)
707 + .value 0x4 # Location expression size
708 + .byte 0xf3 # DW_OP_GNU_entry_value
710 + .byte 0x54 # DW_OP_reg4
711 + .byte 0x9f # DW_OP_stack_value
712 + .quad .LVL3 # Location list begin address (*.LLST2)
713 + .quad .LVL4 # Location list end address (*.LLST2)
714 + .value 0x1 # Location expression size
715 + .byte 0x50 # DW_OP_reg0
716 + .quad .LVL4 # Location list begin address (*.LLST2)
717 + .quad .LVL5 # Location list end address (*.LLST2)
718 + .value 0x6 # Location expression size
719 + .byte 0x70 # DW_OP_breg0
721 + .byte 0x75 # DW_OP_breg5
723 + .byte 0x1e # DW_OP_mul
724 + .byte 0x9f # DW_OP_stack_value
725 + .quad .LVL5 # Location list begin address (*.LLST2)
726 + .quad .LVL6-1 # Location list end address (*.LLST2)
727 + .value 0x1 # Location expression size
728 + .byte 0x50 # DW_OP_reg0
729 + .quad .LVL6-1 # Location list begin address (*.LLST2)
730 + .quad .LVL6 # Location list end address (*.LLST2)
731 + .value 0xb # Location expression size
732 + .byte 0x73 # DW_OP_breg3
734 + .byte 0x73 # DW_OP_breg3
736 + .byte 0x73 # DW_OP_breg3
738 + .byte 0x1e # DW_OP_mul
739 + .byte 0x23 # DW_OP_plus_uconst
741 + .byte 0x1e # DW_OP_mul
742 + .byte 0x9f # DW_OP_stack_value
743 + .quad 0 # Location list terminator begin (*.LLST2)
744 + .quad 0 # Location list terminator end (*.LLST2)
745 + .section .debug_aranges,"",@progbits
746 + .long 0x3c # Length of Address Ranges Info
747 + .value 0x2 # DWARF Version
748 + .long .Ldebug_info0 # Offset of Compilation Unit Info
749 + .byte 0x8 # Size of Address
750 + .byte 0 # Size of Segment Descriptor
751 + .value 0 # Pad to 16 byte boundary
753 + .quad .Ltext0 # Address
754 + .quad .Letext0-.Ltext0 # Length
755 + .quad .LFB3 # Address
756 + .quad .LFE3-.LFB3 # Length
759 + .section .debug_ranges,"",@progbits
761 + .quad .LBB4 # Offset 0
767 + .quad .Ltext0 # Offset 0x30
769 + .quad .LFB3 # Offset 0x40
773 + .section .debug_line,"",@progbits
775 + .section .debug_str,"MS",@progbits,1
777 + .string "GNU C 4.8.0 20121005+patches (experimental) -mtune=generic -march=x86-64 -g -O2"
779 + .string "gdb.arch/amd64-entry-value-inline.c"
784 + .ident "GCC: (GNU) 4.8.0 20121005 (experimental)"
785 + .section .note.GNU-stack,"",@progbits
786 diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c
788 index 0000000..f7fefb8
790 +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c
792 +/* This testcase is part of GDB, the GNU debugger.
794 + Copyright 2012 Free Software Foundation, Inc.
796 + This program is free software; you can redistribute it and/or modify
797 + it under the terms of the GNU General Public License as published by
798 + the Free Software Foundation; either version 3 of the License, or
799 + (at your option) any later version.
801 + This program is distributed in the hope that it will be useful,
802 + but WITHOUT ANY WARRANTY; without even the implied warranty of
803 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
804 + GNU General Public License for more details.
806 + You should have received a copy of the GNU General Public License
807 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
809 +static volatile int v;
811 +static __attribute__((noinline, noclone)) void
823 + y = -2 + x; /* break-here */
830 +__attribute__((noinline, noclone)) int
842 diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
844 index 0000000..6aa92c1
846 +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
848 +# Copyright (C) 2012 Free Software Foundation, Inc.
850 +# This program is free software; you can redistribute it and/or modify
851 +# it under the terms of the GNU General Public License as published by
852 +# the Free Software Foundation; either version 3 of the License, or
853 +# (at your option) any later version.
855 +# This program is distributed in the hope that it will be useful,
856 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
857 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
858 +# GNU General Public License for more details.
860 +# You should have received a copy of the GNU General Public License
861 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
864 +standard_testfile .S
866 +if [info exists COMPILE] {
867 + # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-inline.exp COMPILE=1"
869 + lappend opts debug optimize=-O2
870 +} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
871 + verbose "Skipping ${testfile}."
875 +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
883 +set srcfile $testfile.c
884 +gdb_breakpoint [gdb_get_line_number "break-here"]
886 +gdb_continue_to_breakpoint "break-here" ".* break-here .*"
887 +gdb_test "p y" " = 25"