From: Bill Gatliff <bgat@billgatliff.com>
To: gdb@sources.redhat.com, crossgcc@sources.redhat.com
Subject: Re: arm-elf-gdb "Cannot find bounds of current function"
Date: Thu, 29 Jan 2004 04:51:00 -0000 [thread overview]
Message-ID: <4018911C.2020707@billgatliff.com> (raw)
In-Reply-To: <40176535.8070603@billgatliff.com>
Guys:
Here's a little bit more on this. When running the arm-elf-gdb under
gdb (thank goodness for the 'set prompt' command!), I have found that
when I do a "step", arm-elf-gdb ends up in find_pc_sect_section(). The
interesting part is this:
find_pc_sect_section (pc=0x0, section=0x30821820) at
../../gdb-5.3/gdb/objfiles.c:955
[snip]
...
959 ALL_OBJSECTIONS (objfile, s)
(gdb) step
960 if ((section == 0 || section == s->the_bfd_section) &&
s->addr <= pc && pc < s->endaddr)
(gdb) print *s
$5 = {addr = 0x20188000, endaddr = 0x2018801c, offset = 0x0,
the_bfd_section = 0x9398f4c, objfile = 0x9393ff8, ovly_mapped = 0x0}
(gdb) print pc
$6 = 0x30821820
(gdb)
In other words, the obj_section structure's first (?) section starts at
address 0x20188000, and is 0x1c bytes long. The PC received from the
target, however, is 0x30821820, which is 0x20188230 reversed. The
lookup is failing because the address is endian-swapped.
Funny thing is, arm-elf-gdb appears to be able to show me source lines
just fine when I breakpoint them, I just can't step them after that.
Almost as if it's using two different numbers for the PC (one in the
correct endian sense, the other not). My stub sends back a T message
after a breakpoint, and I see gdb asking with 'g' shortly thereafter,
I'm wondering if that's somehow related...
Ideas now anyone?
b.g.
Bill Gatliff wrote:
> Guys:
>
>
> I'm trying to track down a problem here that's got me stumped. I've
> tested with gdb-5.2.1, 5.3, and 6.0, all with the same results.
>
> I'm using one of my own gdb stubs to debug on an arm-elf target. I'm
> using the remote serial protocol and pristine gdb sources.
>
> I can load and stepi instructions just fine, but when I try to step a
> source line, gdb reports an error, "Cannot find bounds of current
> function". I can list and disassemble functions just fine, and the
> application is an ELF file that was compiled with -g.
>
> The same program steps fine on the simulator, and I've verified that
> there are no differences between the sp, lr, pc, or other register
> values between the two environments. RDI on another target works fine
> as well.
>
> I'm using gcc-3.2.1, binutils-2.13.1.
>
> Any suggestions? I'm pulling my hair out on this one...
>
>
> b.g.
>
--
Bill Gatliff
Do you do embedded GNU? I do!
bgat@billgatliff.com
next prev parent reply other threads:[~2004-01-29 4:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-28 7:31 Bill Gatliff
2004-01-29 4:51 ` Bill Gatliff [this message]
2004-01-29 5:20 ` Bill Gatliff
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=4018911C.2020707@billgatliff.com \
--to=bgat@billgatliff.com \
--cc=crossgcc@sources.redhat.com \
--cc=gdb@sources.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