[pushed] Change inline frame breakpoint skipping logic (fix gdb.gdb/selftest.exp)

Pedro Alves palves@redhat.com
Thu Jun 28 14:48:00 GMT 2018


On 06/27/2018 05:28 PM, Pedro Alves wrote:
> Hi Joel,
> 
> On 06/26/2018 11:02 PM, Joel Brobecker wrote:
> 
>> Just a quick message that the patch makes sense to me, and that
>> I was just able to run it through AdaCore's testsuite with succes.
>> Or, I should qualify that - there is one tiny change that I haven't
>> had time to analyze, but from the surface, it is exactly what you
>> explained about why you need the second hunk.
>>
>> I haven't had a chance to run it through the official testsuite,
>> however, as I have to go ... I am so laaaaate!
>>
>> I can do that tomorrow, or if you prefer to just finish the patch
>> up and push it, it'd be perfect. I think the patch is good.
>>
>> Thanks again!
> 
> FYI, I'm starting to look at this now.

So while poking some more at this, noticed that setting a breakpoint
by address crashes in the same way, like "b *ADDRESS".  So I thought
that maybe it would be better to make stopped_by_user_bp_inline_frame
return true if the location has no symbol instead of returning
false like in the version I sent before.  That preserves the previous
behavior of showing the stop at the inline function if we miss
setting the sal's symbol somewhere.

However, playing with that made me notice something else
unrelated to my "Change inline frame breakpoint skipping"
patch:

  (gdb) b *0x40062f
  Breakpoint 2 at 0x40062f: file inline-break.c, line 32.
  (gdb) info breakpoints
  Num     Type           Disp Enb Address            What
  2       breakpoint     keep y   0x000000000040062f in main at inline-break.c:32
   (gdb) r
   ....
  Breakpoint 2, func1 (x=1) at inline-break.c:32
  32        return x * 23; /* break here */

Notice that above "info break" says "in main":

   in main at inline-break.c:32
      ^^^^

Since we say "inline-break.c:32" everywhere, and present the
stop at the inline function, I think that "info break" should say instead:

   in func1 at inline-break.c:32
      ^^^^^

Fixing that ends up going back to setting the symbol in the sal
again, but I decided to do that in a separate patch, and still
make "loc->symbol == nullptr" in stopped_by_user_bp_inline_frame return
true, unlike the previous version of the patch.

I'll be sending two patches in response to this email.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list