Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] MIPS16 FP manual call/return fixes
Date: Wed, 02 May 2012 21:28:00 -0000	[thread overview]
Message-ID: <20120502212811.GA22285@host2.jankratochvil.net> (raw)
In-Reply-To: <alpine.DEB.1.10.1205011754050.18334@tp.orcam.me.uk>

On Tue, 01 May 2012 19:21:20 +0200, Maciej W. Rozycki wrote:
>  OK, so let me put this another way.  Here we have just returned from a 
> function that we called.  Obviously that function does exist somewhere no 
> matter if symbol tables have been unloaded or whatever.  How can we 
> determine the address of that function?

We can no longer reliably do so.


> -- in a different way, presumably.  
> We must have somehow established its address previously or we couldn't 
> have called it.  Is it possible to cache it somehow for example?

Yes, we could.  In set_breakpoint_location_function is created
bp_gnu_ifunc_resolver, so cache it into 'struct bp_location' there (or even
into 'struct breakpoint', I do not see too much difference there)..

Then transfer this info when bp_gnu_ifunc_resolver_return is created from that
bp_gnu_ifunc_resolver.

I would be fine also with just some error there.


>  Thanks for raising the issue of unloading symbol tables, that's an 
> important point as to how MIPS16 and microMIPS symbols should be treated 
> in general -- here I think it will only matter in the asynchronous mode. 

No, even in synchronous mode.  If you still do "stepi", "stepi", "stepi"...
you will get something like:

(gdb) start
(gdb) b strcmp
Breakpoint 2 at gnu-indirect-function resolver at 0x7ffff7aaa3d0: file ../sysdeps/x86_64/multiarch/strcmp.S, line 87.
(gdb) b *strcmp
Note: breakpoint 2 also set at pc 0x7ffff7aaa3d0.
Breakpoint 3 at 0x7ffff7aaa3d0: file ../sysdeps/x86_64/multiarch/strcmp.S, line 87.
(gdb) c
Continuing.
warning: Breakpoint 2 address previously adjusted from 0x004003c6 to 0x7ffff7aaa3d0.
Breakpoint 2, strcmp () at ../sysdeps/x86_64/multiarch/strcmp.S:87
87		cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
(gdb) maintenance info breakpoints 
Num     Type                          Disp Enb Address            What
[...]
2       STT_GNU_IFUNC resolver        keep y   0x00007ffff7aaa3d0 ../sysdeps/x86_64/multiarch/strcmp.S:87 inf 1
	breakpoint already hit 1 time
3       breakpoint                    keep y   0x00007ffff7aaa3d0 ../sysdeps/x86_64/multiarch/strcmp.S:87 inf 1
	breakpoint already hit 1 time
0       STT_GNU_IFUNC resolver return keep y   0x00007ffff7deb3be <_dl_fixup+446> inf 1 thread 1
	stop only in thread 1

So you can see anything can happen now before we hit that breakpoint #0.
I can for example unload the glibc symbol file by 'nosharedlibrary' (which has
led to unrelated PR 14054 now).


Thanks,
Jan


  reply	other threads:[~2012-05-02 21:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 13:30 Maciej W. Rozycki
2012-04-26 19:20 ` Tom Tromey
2012-04-26 22:23   ` Maciej W. Rozycki
2012-04-27 15:16     ` Maciej W. Rozycki
2012-04-27 15:28       ` Tom Tromey
2012-04-26 19:33 ` Tom Tromey
2012-04-30 23:45   ` Maciej W. Rozycki
2012-05-01 14:05     ` Jan Kratochvil
2012-05-01 17:22       ` Maciej W. Rozycki
2012-05-02 21:28         ` Jan Kratochvil [this message]
2012-05-08 14:30           ` Maciej W. Rozycki
2012-05-12 19:38             ` Jan Kratochvil
2012-05-14  9:12               ` Maciej W. Rozycki
2012-05-14 11:54                 ` Jan Kratochvil
2012-05-16 14:45                   ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120502212811.GA22285@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@codesourcery.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox