Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFC] mips-tdep.c: Fix mips16 bit rot
Date: Mon, 14 May 2012 20:11:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1204202126340.19835@tp.orcam.me.uk> (raw)
In-Reply-To: <20111214162117.0b1ce834@mesquite.lan>

Hi Kevin,

> Sorry it's taken me so long to get back to you this.  I will try to
> answer your questions to the best of my ability, but it's been a
> while since I've looked at or thought about this code.  I fear
> that I might not be of much help...

 No worries, I keep being distracted by various stuff too.  Thanks for 
your time.

> >  First of all this construct used in a few places:
> > 
> > +  if (is_mips16_addr (pc))
> > +    pc = unmake_mips16_addr (pc);
> > 
> > makes me a bit nervous you might be removing the ISA bit for code 
> > references where it is the only means of signalling GDB the address is a 
> > MIPS16 code address -- that would happen if pc pointed to a location that 
> > has no associated symbol information.  While in this case the 
> > functionality GDB provides is limited, it still has to work correctly up 
> > to expectations, e.g. instruction-level single-stepping has to work and 
> > where software stepping is used the MIPS16 BREAK instruction encoding has 
> > to be used rather than the MIPS32 one.  Have you verified this 
> > functionality has not regressed?  Similarly the MIPS16 heuristic frame 
> > unwinder may be affected.
> > 
> >  Otherwise I'd just be tempted to change all these cases into something 
> > functionally equivalent to:
> > 
> > +  if (msymbol_is_special (lookup_minimal_symbol_by_pc (pc)))
> > +    pc = unmake_mips16_addr (pc);
> > 
> > where the ISA bit is only stripped if there's symbol information 
> > indicating this is a piece of MIPS16 code so there's no information lost.
> 
> I see your point.  You proposed change looks reasonable to me.
> 
> >  Second, you only made corresponding adjustments to 
> > mips_eabi_push_dummy_call and mips_o64_push_dummy_call which are the least 
> > standard and probably the least used MIPS ABIs.  Any particular reason you 
> > did not make similar changes to mips_o32_push_dummy_call or 
> > mips_n32n64_push_dummy_call?
> > 
> >  Also I see you only adjust function pointers that are arguments on their 
> > own -- isn't a similar adjustment required for such pointers that are 
> > parts of aggregate types as well?
> 
> I don't remember enough about what I did roughly a year ago to be able
> to answer this.  I think it's likely that changes should be made to the
> areas that you've identified.
> 
> >  Overall, what was the rationale behing your change? -- as it's unclear to 
> > me from your e-mail.  Did you just want to fix test results you discovered 
> > that were quite poor or does this change address problems you stumbled 
> > across during actual MIPS16 debugging?
> 
> The former - I was attempting to fix some very bad test results with respect
> to mips16.

 So essentially at this point, after some testing and lots of thinking, 
I'd like to revert your change entirely and make additional changes 
elsewhere, so that the ISA bit is actually preserved all the time.  This 
reflects the program's view of the world which I think GDB should mimic.  
Unless proved otherwise, I think any other approach is unworkable and is 
simply missing the point.

 I've opened a discussion and sent a proposal here:

http://sourceware.org/ml/gdb-patches/2012-05/msg00515.html

-- feel free to join if interested.

  Maciej


      reply	other threads:[~2012-05-14 20:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14  0:06 Kevin Buettner
2010-12-14  5:39 ` Joel Brobecker
2010-12-17 21:40 ` Kevin Buettner
2011-11-23 12:41 ` Maciej W. Rozycki
2011-12-14 23:24   ` Kevin Buettner
2012-05-14 20:11     ` Maciej W. Rozycki [this message]

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=alpine.DEB.1.10.1204202126340.19835@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@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