Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: "Maciej W. Rozycki" <macro@mips.com>
Cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: MIPS: Handle manual calls of MIPS16 functions with a call stub
Date: Fri, 08 Feb 2008 14:57:00 -0000	[thread overview]
Message-ID: <20080208145631.GA14213@caradoc.them.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0802041642480.28589@perivale.mips.com>

On Fri, Feb 08, 2008 at 02:23:03PM +0000, Maciej W. Rozycki wrote:
> > I think that using mips_pc_is_mips16 can be made to work, by analogy
> > to ARM.  I'd look at this myself, but I don't think I'm set up to run
> 
>  It is much more than that, but I think it can be done with some 
> adjustments to pointer_to_address(), address_to_pointer() and 
> integer_to_address() methods.  If DWARF-2 records could be treated as 
> pointers (which they are given how the linker processes them) rather than 
> addresses then such a setup should work.  That should be done above the 
> level of the DWARF-2 interpreter, as losing the LSB from relative data 
> often contained in records would result in an accumulative error.

Hmm.  This sounds believable, but it may react badly with other
platforms.  We'll have to experiment.

> > mips16 tests (yet).  Should I be able to do this with just the GDB
> > simulator and a board file?
> 
>  I have attached the "mips-sim-sde32" board description file I use and the 
> necessary linker script.  You should be able to use it, though there may 
> be pitfalls.  When running tests you need -Wa,-O0 to disable branch 
> swapping as it makes MIPS16 code inconsistent with DWARF-2 information in 
> a fatal way.

Thanks.

> > I don't understand.  The stub is not annotated with debug information
> > in the example you posted earlier in the thread.  It's only "inside
> > the block" physically in the assembly file and for the purposes of
> > confusing gas (it probably puts the symbol and first instruction in
> > different frags, the first of which is zero length, breaking whatever
> > gas uses to annotate the symbol value).  It's not covered by the range
> > [.LFB20, .LEB20] because those labels are in the text section.
> 
>  It is still covered by the .loc directive and therefore recognised to be 
> a part of the code corresponding to the first line of the function.  It 
> makes single-stepping through it possible -- including correct frame 
> discovery as required by `nexti'/`step'/`next' (not `stepi' though).

This makes more sense, but not quite... I see how the .loc covers it.
That should get it into .debug_line.  However it shouldn't affect the
symbol table, or the frame unwinders... I must be missing something,
but I'll figure it out eventually.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-02-08 14:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 18:14 Maciej W. Rozycki
2008-01-31 22:08 ` Daniel Jacobowitz
2008-02-01 10:27   ` Maciej W. Rozycki
2008-02-01 14:19     ` Daniel Jacobowitz
2008-02-01 15:34       ` Maciej W. Rozycki
2008-02-01 16:58         ` Daniel Jacobowitz
2008-02-01 17:07           ` Maciej W. Rozycki
2008-02-01 17:15             ` Daniel Jacobowitz
2008-02-04 16:14     ` Maciej W. Rozycki
2008-02-04 16:39       ` Daniel Jacobowitz
2008-02-08 14:23         ` Maciej W. Rozycki
2008-02-08 14:57           ` Daniel Jacobowitz [this message]
2008-02-08 18:06           ` Jim Blandy
2008-02-08 18:08           ` Jim Blandy
2008-02-13 18:28             ` Maciej W. Rozycki
2008-02-13 20:54               ` Jim Blandy
2008-02-15 11:36                 ` Maciej W. Rozycki
2008-02-18 13:32                   ` Nigel Stephens
2008-02-18 16:28                     ` Maciej W. Rozycki
2008-02-19 19:48                       ` Michael Snyder
2008-02-22 16:38                     ` Jim Blandy

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=20080208145631.GA14213@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@linux-mips.org \
    --cc=macro@mips.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