Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: PAUL GILLIAM <pgilliam@us.ibm.com>
Cc: gdb@sources.redhat.com
Subject: Re: strange dereferencing behavior in gdb expressions
Date: Thu, 26 Jan 2006 00:41:00 -0000	[thread overview]
Message-ID: <20060125200000.GA18352@nevyn.them.org> (raw)
In-Reply-To: <1138218150.1423.36.camel@dufur.beaverton.ibm.com>

On Wed, Jan 25, 2006 at 11:42:30AM -0800, PAUL GILLIAM wrote:
> This seems inconsistent: GDB says it can't access memory at an address,
> but when given that address explicitly, it works fine.
>         
>         GDB was configured like this: CC='gcc -m64' ../src/configure
>         (i.e. GDB
>         is a 64-bit application)
>         
>         The target application is a 32-bit 'C' program.
>         
>         (gdb) show version
>         GNU gdb 6.4.50.20060124-cvs
>         ...
>         This GDB was configured as "powerpc64-unknown-linux-gnu".
>         (gdb) p/x *(*(0xffffc4a0)+4)
>         Cannot access memory at address 0xffffc504
>         (gdb) p/x *(int*)((*(int*)0xffffc4a0)+4)
>         $42 = 0xfd7e67c
>         (gdb) p/x *(0xffffc4a0)+4
>         $43 = 0xffffc504
>         (gdb) p/x *($43)
>         Cannot access memory at address 0xffffc504
>         (gdb) p/x *(0xffffc504)
>         $44 = 0xfd7e67c
>         (gdb)
>         
> Anyone what to hazard a guess as to what is going on?

I've had this happen when memory_error truncates the address; might
want to set a breakpoint there, and see if one of them is sign extended
differently than the other due to their different types.

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2006-01-25 20:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-25 20:00 PAUL GILLIAM
2006-01-26  0:41 ` Daniel Jacobowitz [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=20060125200000.GA18352@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=pgilliam@us.ibm.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