From: Manoj Iyer <manjo@austin.ibm.com>
To: gdb@sources.redhat.com
Subject: (PPC64) 64 bit GDB unable to set br in 32bit app
Date: Tue, 09 Mar 2004 05:55:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.58.0403090609200.19866@lazy> (raw)
Andrew,
I am trying to debug a 32 bit app using a 64 bit GDB on a PowerPC64 bit
machine, I am not able to set a breakpoint in the 32 bit app. I get the
following error.
Warning:
Cannot insert breakpoint -1.
Error accessing memory address 0xffffc4f4: Input/output error.
(gdb)
To recreate the problem, you need a PowerPC64 machine, build GDB (GDB 6.0)
as a 64bit binary, and use any 32bit app and try to debug this app. Set a
break point in main() and use the gdb command run.
I did some amount of debugging and I found that read_pc() is not returning
the value of PC correctly instead returns 0. So the base address of the
dynamic linker is miscalculated.
File:regcache.c read_pc_pid(): raw_val = 0
File:regcache.c read_pc_pid(): pc_val = 0
read_pc() calls legacy_read_register_gen() function which calls
register_buffer() which is used to read the contents of the structure
(struct regcache *regcache) and returns a pointer to the register buffer
cache. I think this is where the problem is. The contents of the memory
location that this pointer points to are all 0x0's and that shouldint be
the case. legacy_read_register_gen() does a memcpy() from this location to
a variable myaddr ultimately used in the calculations to find the base
address of the dynamic linker.
So since the base address of the dynamic linker (ld.so), GDB is unable to
set default break points in _dl_debug_state. And GDB fails in the init
stage itself.
I dont have a good understanding of the structures regcache and
regcache_dscr to do more debugging.
Am I on the right track? Please help.
Thanks
Manoj Iyer
next reply other threads:[~2004-03-09 5:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-09 5:55 Manoj Iyer [this message]
2004-03-09 20:03 ` Andrew Cagney
2004-03-10 19:28 ` Manoj Iyer
2004-03-11 19:30 ` Andrew Cagney
2004-03-11 20:30 ` Manoj Iyer
2004-03-12 22:00 ` 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=Pine.LNX.4.58.0403090609200.19866@lazy \
--to=manjo@austin.ibm.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