Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Steven Johnson <sjohnson@neurizon.net>
To: gdb@sources.redhat.com
Subject: GDB and ARM Frame Pointer strangeness
Date: Mon, 07 Jun 2004 08:50:00 -0000	[thread overview]
Message-ID: <40C42C75.5020208@neurizon.net> (raw)

Hi all,

I have compiled GDB 6.1 for ARM Cross Debugging. Hosted on X86 Linux.  
Ive been doing this for a while with PowerPC, so im no stranger to it.  
Well, now I have an ARM target and I am writing an ARM remote interface 
to my target communicating using the Remote Protocol over TCP/IP.  The 
strange thing is, right after startup, if I try and write an absolute 
memory location GDB insists on dereferencing the Frame Pointer (R11) and 
reading the address stored there.  It then does something with the 
result and dereferences that.

The problem is, I havent got a program loaded yet. And the Registers are 
just in any old state, a program not having been loaded and run.  
Dereferencing the FP (R11) is causing the target to crash, becasue the 
memory it is trying to access is a random address (being the default 
garbage in the register) and this is causing the target to get a memory 
exception and die.

Not Good.

Why is GDB insisting on de-referencing the FP when all I asked it to do 
is write to an absolute memory location. I have not told it to do 
anything that is frame pointer relative.  The last thing I expect to see 
is 2 memory read packets when i execute:

set (unsigned int)0x0 0x12345

all i should see is the memory write packet.  The single memory write 
packet is all i ever saw with my PowerPC target, it never dereferenced 
the FP on a memory write operation????

Is there a way to turn this undesirable operation off?

Any help would be appreciated.

Also, as an aside, 2 other strange things ive noticed with the ARM GDB:

 it seems "set architecture" causes GDB to crash for ARM targets.  eg 
set architecture armv4t followed by the write indicated above crashes 
GDB.  Leaving it on Auto does not.

and, set osabi does not work with ARM for anything other than "none" or 
"auto" I was trying to set an ABI to an embedded ABI, that theoretically 
doesnt use an FP, but the command doesnt work. Eg,
(gdb) set osabi ARM EABI v1
Ambiguous item "ARM EABI v1 ".

same goes for "ARM EABI v2" and "ARM APCS"

only "none" "default" and "auto" works.

Also, this is a raw GDB, meaning I havent loaded any application.  Im 
just trying to get GDB to talk to my target, so am not interested in 
debugging an actual application yet.  Reading and writing 
registers/memory and disassembling are the big ticket items at the moment.

Steven Johnson


             reply	other threads:[~2004-06-07  8:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-07  8:50 Steven Johnson [this message]
2004-06-08  4:25 ` Steven Johnson
2004-06-08  4:29   ` Daniel Jacobowitz
2004-06-08  5:02     ` Steven Johnson
2004-06-08 12:26       ` Mark Salter
2004-06-08 23:47         ` Steven Johnson
2004-06-09 15:14           ` Andrew Cagney
2004-06-10  0:06             ` Steven Johnson
2004-06-10  2:20               ` Ian Lance Taylor
2004-06-10  4:37                 ` Steven Johnson
2004-06-10  5:10                   ` Ian Lance Taylor
2004-06-10  7:16                     ` Steven Johnson
2004-06-10 21:32                       ` Andrew Cagney
2004-06-11  0:46                         ` Steven Johnson
2004-06-11 15:33                           ` Andrew Cagney
2004-06-10  9:03                   ` Richard Earnshaw

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=40C42C75.5020208@neurizon.net \
    --to=sjohnson@neurizon.net \
    --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