This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] entry values: Fix resolving in inlined frames


> Date: Fri, 5 Oct 2012 14:41:07 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> 
> Hi,
> 
> Breakpoint 1, fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
> 32	      y = -2 + x;	/* break-here */
> (gdb) info addr y
> (gdb) bt
> #0  fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
> #1  fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
> #2  0x00000000004004af in main () at gdb.arch/amd64-entry-value-inline.c:48
> (gdb) info frame
> Stack level 0, frame at 0x7fffffffdb68:
>  rip = 0x4005bc in fn2 (gdb.arch/amd64-entry-value-inline.c:32); saved rip 0x4004af
>  inlined into frame 1
> [...]
> (gdb) set debug entry-values 1
> (gdb) p y
> DW_OP_GNU_entry_value resolving expects callee fn1 at 0x4005a0 but the called frame is for fn3 at 0x4005b0
> 
> FAIL:
> -----
> $1 = <optimized out>
> PASS:
> -----
> $1 = 25
> 
> (gdb) p/x $pc
> $2 = 0x4005bc
> (gdb) up
> #1  fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
> (gdb) p/x $pc
> $3 = 0x4005bc
> 
> The problem is that DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value binding
> exists between DW_TAG_subprogram, nor DW_TAG_inlined_subroutine as described
> by Jakub Jelinek.  This makes sense, when we look at DW_TAG_GNU_call_site and
> we just unwind the current inlined frame we get the same PC - this is no new
> information.
> 
> TAILCALL_FRAME is a different case, while also an artificial frame the
> sequence cannot be determined at compile time and the binding
> DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value exists also for
> TAILCALL_FRAMEs.

Your explanation makes no sense to me, and unfortunately that extends
to the comment you added in the code.

> +  /* Skip any inlined frames, entry value call sites work between real
> +     functions.  They do not make sense between inline functions as even PC
> +     does not change there.  */

I realize that you're not a native speaker, but a big part of the
problem is that there are a lot of grammatical mistakes in your
english.  Can you get some help from a native speaker to make sure the
comments in the code make sense?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]