From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11656 invoked by alias); 24 Jun 2005 20:40:58 -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 11647 invoked by uid 22791); 24 Jun 2005 20:40:53 -0000 Received: from smtp106.mail.sc5.yahoo.com (HELO smtp106.mail.sc5.yahoo.com) (66.163.169.226) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Fri, 24 Jun 2005 20:40:53 +0000 Received: (qmail 38482 invoked from network); 24 Jun 2005 20:40:51 -0000 Received: from unknown (HELO ?192.168.3.100?) (jcphillips@216.54.38.110 with plain) by smtp106.mail.sc5.yahoo.com with SMTP; 24 Jun 2005 20:40:51 -0000 Message-ID: <42BC6F5D.1080506@yahoo.com> Date: Fri, 24 Jun 2005 20:40:00 -0000 From: Chad Phillips User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: GDB requires software breakpoints? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-06/txt/msg00242.txt.bz2 Context: I'm rewriting MCORE support. My remote MCORE target executes code from flash. I've written a stub that resides on the same computer as GDB, talks to GDB using the remote protocol, and manipulates the target using the target's JTAG interface. As a result, only hardware breakpoints (2 of them) are supported. A log is included below (created using 'set debug remote 1') with my comments along the right side. Problem 1: After attaching to the target which is stopped in main, I issue the step command. The target correctly steps to the next source line. At the end of the stepping process, GDB tries to set a breakpoint at main. Using 'info break' replies "No breakpoints or watchpoints." First: How can I prevent it from trying to do this? Second: It attempt to set a software breakpoint, which is not supported by the stub. Then it tries to write a software breakpoint (instruction 0x0000) to memory at the start of main, which fails since the stub cannot write to flash. Why is it doing this if the stub has already indicated that software breakpoints are not supported? Problem 2: After two more commanded steps, the target jumps into a function. Issueing a 'finish' command tries to set another software breakpoint at the correct return location. However, that fails because the return location is in flash. How can I get GDB to use available hardware breakpoints for this functionality and to stop trying to write to flash? Thanks, Chad --------------------------------------------------------- (gdb) s //Commanded step Sending packet: $p1#a1...Ack Packet received: 00C70000 Sending packet: $vCont?#49...Ack Packet received: Packet vCont (verbose-resume) is NOT supported Sending packet: $Hc0#db...Ack Packet received: Sending packet: $s#73...Ack //automatic steps... Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 0000439A Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 0000439C Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 0000439E Sending packet: $p0#a0...Ack //finished stepping Packet received: 00801D8C Sending packet: $p1#a1...Ack Packet received: 00C70000 Sending packet: $pf#d6...Ack Packet received: 0000438C Sending packet: $Z0,4188,2#e9...Ack //break at main !?! Packet received: Packet Z0 (software-breakpoint) is NOT supported Sending packet: $m4188,2#a0...Ack Packet received: 6007 Sending packet: $X4188,0:#c3...Ack Packet received: binary downloading NOT suppported by target Sending packet: $M4188,2:0000#7a...Ack //break at main !?! Packet received: E00 Warning: Cannot insert breakpoint 0. Error accessing memory address 0x4188: Input/Output error. (gdb) s Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043A0 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043A2 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043A4 Sending packet: $p0#a0...Ack Packet received: 00801D8C Sending packet: $p1#a1...Ack Packet received: 00C70000 Sending packet: $pf#d6...Ack Packet received: 0000438C Sending packet: $m4188,2#a0...Ack //still breaking main? Packet received: 6007 Sending packet: $M4188,2:0000#7a...Ack Packet received: E00 Warning: Cannot insert breakpoint 0. Error accessing memory address 0x4188: Input/Output error. (gdb) s Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043A6 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043A8 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043AA Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043AC Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043AE Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043B0 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043B2 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043B4 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 000043B6 Sending packet: $s#73...Ack Packet received: S05 Sending packet: $p40#d4...Ack Packet received: 00008CCC Sending packet: $p0#a0...Ack //did not break main !?! Packet received: 00801D8C Sending packet: $p1#a1...Ack Packet received: 00C70000 Sending packet: $pf#d6...Ack Packet received: 000043B8 mQueueReadString () at mQueue.s:385 385 mQueue.s: No such file or directory. in mQueue.s Current language: auto; currently asm //now finish command tries to set break instruction at return addr (gdb) finish Run till exit from #0 mQueueReadString () at mQueue.s:385 Sending packet: $m43b8,2#cc...Ack Packet received: 1227 Sending packet: $M43b8,2:0000#a6...Ack Packet received: E00 Warning: Cannot insert breakpoint 0. Error accessing memory address 0x43b8: Input/Output error. (gdb)