Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Jakub Jelinek <jakub@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing
Date: Mon, 26 Nov 2001 13:19:00 -0000	[thread overview]
Message-ID: <3C02B1D6.2030407@cygnus.com> (raw)
In-Reply-To: <20011126154347.A8899@nevyn.them.org>

> Well, remember that we can't cast things to (CORE_ADDR *) reliably. 
> With --enable-64-bit-bfd, that has a tendency to turn into a 'long long *'.
> What was happening was reading $sp out of the regcache, and then
> passing it to target_read_memory.  If this were MIPS, I think we'd have
> to sign extend there, for "correctness".  We'd eventually truncate it
> back down with a cast in infptrace.c, though.
> 
> I just don't like duplicating that above code sequence everywhere we
> get a pointer out of a register into a CORE_ADDR.  It seems like a very
> frequent operation, in nat or in tdep.


[Carefully read code ... Hmm, why is it reading registers from memory 
(stack) .....  Hmm, why were all the registers written direct to the 
stack   ...?  Hmm, nothing does something that stupid except something 
with register windows ....  Er, Oh dear....]

Sorry, yes that code, as it stands, looks like it does need to do an 
extract_XXXX_address() call on the register.

As it stands?  gdbarch_register_read/write and the fetch registers for 
frame function should be mapping those registers onto memory addresses 
instead of passing the problem down to the target fetch register code. 
That way, those stored-in-memory registers are fetched via the memory 
and not the data cache.  That, however, is currently just theory :-)

Andrew



WARNING: multiple messages have this Message-ID
From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Jakub Jelinek <jakub@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing
Date: Tue, 13 Nov 2001 08:28:00 -0000	[thread overview]
Message-ID: <3C02B1D6.2030407@cygnus.com> (raw)
Message-ID: <20011113082800.oplUOinYW0N8ZAqJnBtoP6nZT02-M1PjZtEq6JDzY0Y@z> (raw)
In-Reply-To: <20011126154347.A8899@nevyn.them.org>


> Well, remember that we can't cast things to (CORE_ADDR *) reliably. 
> With --enable-64-bit-bfd, that has a tendency to turn into a 'long long *'.
> What was happening was reading $sp out of the regcache, and then
> passing it to target_read_memory.  If this were MIPS, I think we'd have
> to sign extend there, for "correctness".  We'd eventually truncate it
> back down with a cast in infptrace.c, though.
> 
> I just don't like duplicating that above code sequence everywhere we
> get a pointer out of a register into a CORE_ADDR.  It seems like a very
> frequent operation, in nat or in tdep.


[Carefully read code ... Hmm, why is it reading registers from memory 
(stack) .....  Hmm, why were all the registers written direct to the 
stack   ...?  Hmm, nothing does something that stupid except something 
with register windows ....  Er, Oh dear....]

Sorry, yes that code, as it stands, looks like it does need to do an 
extract_XXXX_address() call on the register.

As it stands?  gdbarch_register_read/write and the fetch registers for 
frame function should be mapping those registers onto memory addresses 
instead of passing the problem down to the target fetch register code. 
That way, those stored-in-memory registers are fetched via the memory 
and not the data cache.  That, however, is currently just theory :-)

Andrew



  parent reply	other threads:[~2001-11-26 13:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-10  9:20 Jakub Jelinek
2001-11-10 13:03 ` Daniel Jacobowitz
2001-11-10 16:27   ` Jakub Jelinek
2001-11-10 16:35     ` Daniel Jacobowitz
2001-11-10 16:41       ` Jakub Jelinek
2001-11-10 16:42         ` Daniel Jacobowitz
2001-11-12 10:39       ` Andrew Cagney
2001-11-26  9:18         ` Andrew Cagney
2001-11-26 12:04         ` Daniel Jacobowitz
2001-11-12 18:40           ` Daniel Jacobowitz
2001-11-26 12:34           ` Andrew Cagney
2001-11-12 19:11             ` Andrew Cagney
2001-11-13  8:19             ` Daniel Jacobowitz
2001-11-26 12:43               ` Daniel Jacobowitz
2001-11-26 13:19               ` Andrew Cagney [this message]
2001-11-13  8:28                 ` Andrew Cagney
2001-11-26  9:08     ` Andrew Cagney
2001-11-12 10:04       ` Andrew Cagney

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=3C02B1D6.2030407@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jakub@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