From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8039 invoked by alias); 7 Jun 2004 08:50:57 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8022 invoked from network); 7 Jun 2004 08:50:55 -0000 Received: from unknown (HELO gizmo08ps.bigpond.com) (144.140.71.18) by sourceware.org with SMTP; 7 Jun 2004 08:50:55 -0000 Received: (qmail 16434 invoked from network); 7 Jun 2004 08:37:59 -0000 Received: from unknown (HELO psmam01.bigpond.com) (144.135.25.69) by gizmo08ps.bigpond.com with SMTP; 7 Jun 2004 08:37:59 -0000 Received: from cpe-203-51-247-11.qld.bigpond.net.au ([203.51.247.11]) by psmam01.bigpond.com(MAM REL_3_4_2a 65/8121647) with SMTP id 8121647; Mon, 07 Jun 2004 18:50:52 +1000 Message-ID: <40C42C75.5020208@neurizon.net> Date: Mon, 07 Jun 2004 08:50:00 -0000 From: Steven Johnson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040115 MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: GDB and ARM Frame Pointer strangeness Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00040.txt.bz2 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