From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Jonathan Larmour <jifl@eCosCentric.com>
Cc: gdb@sourceware.org
Subject: Re: dwarf_block_to_fb_offset() and 64-bit host
Date: Sun, 25 Jan 2015 08:32:00 -0000 [thread overview]
Message-ID: <20150125082727.GA5745@host1.jankratochvil.net> (raw)
In-Reply-To: <54C48488.6040100@eCosCentric.com>
On Sun, 25 Jan 2015 06:52:08 +0100, Jonathan Larmour wrote:
> In the 32-bit (working) build, in one failing example, fb_offset ends up
> as -28, whereas *fb_offset_return is 0xffffffe4 - this is because
> CORE_ADDR is an *unsigned* 32-bit type (due to bfd_vma). But LONGEST is a
> signed long long - 64-bits - so the comparison between fb_offset and
> *fb_offset_return ends up comparing -28 and 4294967268. So 0 is returned.
It is not really working. It is just a secondary bug which will omit the
'id@entry' value to be read/displayed. The primary bug is that reading the
value 'id@entry' errors.
> In the 64-bit (buggy) build, fb_offset is still -28 but *fb_offset_return
> is 0xffffffffffffffe4 (CORE_ADDR now being an unsigned 64-bit type), which
> when cast to LONGEST (which is signed) is still -28. Therefore 1 is
> returned. This later results in read_frame_arg()'s call to
> ops->read_variable_at_entry incorrectly believing there is a different
> value of the variable on entry.
To find out whether there is or isn't a different value one has to read it
first. Which for an unknown reason fails in your case.
If the id entry value was equal GDB would print:
Breakpoint 2, fileio1_main (id=id@entry=0) at /.../fatfs1.c:431
which happens in neither of your case.
The primary problem is why GDB fails to read the address 0x9001917c.
It usually happens that GDB tries to read address like 0x19001917c or address
0xffffffff9001917c while then the error report
return xstrprintf (_("Cannot access memory at address %s"),
paddress (gdbarch, memaddr));
strips the upper bits in paddress().
corefile.c:memory_error_message():
s/paddress (gdbarch, memaddr)/core_addr_to_string (memaddr)/
may reveal that.
Jan
next prev parent reply other threads:[~2015-01-25 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-25 8:03 Jonathan Larmour
2015-01-25 8:27 ` Doug Evans
2015-01-25 12:41 ` Jan Kratochvil
2015-01-26 8:48 ` Mark Kettenis
2015-01-25 8:32 ` Jan Kratochvil [this message]
2015-02-03 3:24 ` Jonathan Larmour
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=20150125082727.GA5745@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--cc=jifl@eCosCentric.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