This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/2] mips: Switch inferior function calls to ON_STACK method.
On Mon, 14 May 2012, Joel Brobecker wrote:
> > I gave it yet more thinking and came to the conclusion that at least
> > for the MIPS target, where it is safe to use either way, but both
> > have some drawbacks, we should really apply both, switching
> > dynamically. The reason is the stack may be unwritable for whatever
> > reason (e.g. not correctly set up), so we should try ON_STACK first
> > and if that fails (e.g. SP is NULL or writing to the stack has
> > faulted), then fall back to AT_ENTRY_POINT. This is another corner
> > case however and I don't feel compelled to implement it right now.
> > Let's leave it for another sunny day in Cambridgeshire. ;)
>
> Is that something we could detect at gdbarch init? (I don't think we
> have a process at init time)
That has to be done every time a request for a manual call is made --
according to current conditions. The stack may be in oblivion during
early startup for example, but get into working state later on. Of course
the callee may need to use the stack too, in which case it's not going to
work anyway. So it is really leaf functions only that could be called and
then not even all of them.
Therefore I'll just reiterate the unimportance of this corner case. I
guess nobody will really notice, it looks to me the manual call feature is
not used by people that often in the first place. I've looked through our
bugzilla and the long-lived breakage of MIPS16 manual calls I posted fixes
for recently (both the FP ABI fix and the ISA bit fix) has never been
reported by anyone.
> > 2012-05-14 Maciej W. Rozycki <macro@codesourcery.com>
> >
> > gdb/
> > * mips-tdep.c (mips_push_dummy_code): Handle microMIPS code.
>
> FWIW, the change looks good to me.
Thanks for checking and confirming.
Maciej