* Disabling breakpoints does not work if rejected from remote stub @ 2007-02-27 11:55 Sascha 2007-02-27 12:52 ` Daniel Jacobowitz 0 siblings, 1 reply; 6+ messages in thread From: Sascha @ 2007-02-27 11:55 UTC (permalink / raw) To: gdb Hi, I guess the following problem is a bug, but I'm not sure: I have a remote stub which only allows two breakpoints. If GDB tries to insert another breakpoint the Z0 (yes, I only use Z0) packet will get rejected with an error code. So when I have three breakpoints... 1: 0x100000 2: 0x200000 3: 0x300000 The third will be rejected. GDB won't resume and report an error. That's ok. Z0,0x10000.... OK Z0,0x20000.... OK Z0,0x30000.... REJECTED (ENN) Alright. Removing ONE (no matter which) of the breakpoints will fix the situation. If BP3 gets deleted GDB simply won't try to insert BP3 any more. If BP1/BP2 gets deleted, GDB will remove this breakpoint (z0 packet) and insert BP3 instead. GDB is able to resume now. NOW THE PROBLEM: Disabling a breakpoint does not have the same effect. If I disable BP3 GDB simply won't try to insert BP3 any more (like before). But when I disable BP1/BP2, GDB will still try to insert BP3 without removing BP1/BP2 first. So even if all breakpoints except BP3 have been disabled, GDB will still try to insert BP3 without removing the other (already inserted) breakpoints first. GDB does not send the required z0 packets BEFORE trying the Z0 packet. I had a look at breakpoints.c but I'm still not sure why this happens. I'd appreciate any advice. Thanks. Sascha ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Disabling breakpoints does not work if rejected from remote stub 2007-02-27 11:55 Disabling breakpoints does not work if rejected from remote stub Sascha @ 2007-02-27 12:52 ` Daniel Jacobowitz 2007-02-27 19:29 ` Sascha 0 siblings, 1 reply; 6+ messages in thread From: Daniel Jacobowitz @ 2007-02-27 12:52 UTC (permalink / raw) To: Sascha; +Cc: gdb On Tue, Feb 27, 2007 at 10:29:36AM +0100, Sascha wrote: > Hi, > > I guess the following problem is a bug, but I'm not sure: Could you try two things for me? First, build a CVS snapshot from the current HEAD and see if the problem persists. Second, show a complete session log including "set debug remote 1" with the problem, so that I can reproduce the problem. This sounds familiar, but I'm not sure whether it's been fixed. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Disabling breakpoints does not work if rejected from remote stub 2007-02-27 12:52 ` Daniel Jacobowitz @ 2007-02-27 19:29 ` Sascha 2007-03-06 1:06 ` Michael Snyder 0 siblings, 1 reply; 6+ messages in thread From: Sascha @ 2007-02-27 19:29 UTC (permalink / raw) To: 'Daniel Jacobowitz'; +Cc: gdb [-- Attachment #1: Type: text/plain, Size: 212 bytes --] Hi >Could you try two things for me? - I downloaded the latest snapshot from head (27/02) and the problem still exists - I logged the MI session with debug remote set to 1 See attached file. Thanks Sascha [-- Attachment #2: gdblog.txt --] [-- Type: text/plain, Size: 6155 bytes --] ********** ********** Test: DISABLING breakpoints ------------------------------------ ENABLE BPS1,2,3 ------------ 249-break-enable 1 249^done (gdb) 250-break-enable 2 250^done (gdb) 251-break-enable 3 251^done (gdb) -------------------------------- RESUME FAILS (3 of 2 allowed bps) ------ 252-exec-step-instruction 1 252^running (gdb) &"Sending packet: $Z0,200094,4#45..." Sending packet: $Z0,200094,4#45...Ack Packet received: OK &"Ack\n" &"Packet received: OK\n" &"Packet Z0 (software-breakpoint) is supported\n" &"Sending packet: $Z0,20009c,4#74..." Packet Z0 (software-breakpoint) is supported Sending packet: $Z0,20009c,4#74...Ack Packet received: OK Sending packet: $Z0,200080,4#40...Ack Packet received: E11 Warning: Cannot insert breakpoint 3. Error accessing memory address 0x200080: (undocumented errno -1). &"Ack\n" &"Packet received: OK\n" &"Sending packet: $Z0,200080,4#40..." &"Ack\n" &"Packet received: E11\n" &"Warning:\n" &"Cannot insert breakpoint 3.\n" &"Error accessing memory address 0x200080: (undocumented errno -1).\n" &"\n" 252^error,msg="Warning:\nCannot insert breakpoint 3.\nError accessing memory address 0x200080: (undocumented errno -1).\n" (gdb) 253 info threads &"info threads\n" &"Sending packet: $qL1160000000000000000#55..." &"Ack\n" &"Packet received: \n" &"warning: RMT ERROR : failed to get remote thread list.\n" &"Sending packet: $qC#b4..." &"Ack\n" &"Packet received: \n" 253^done (gdb) 254-stack-info-depth 254^done,depth="2" (gdb) 255-stack-list-frames 0 2 255^done,stack=[frame={level="0",addr="0x00200078",func="my_handler"},frame={level="1",addr="0x002004b4",func="??"}] (gdb) 256-data-list-changed-registers 256^done,changed-registers=[] (gdb) 257 info sharedlibrary &"info sharedlibrary\n" ~"No shared libraries loaded at this time.\n" 257^done (gdb) -------------------------------- DISABLE BP1,2 --------------------- 258-break-disable 1 258^done (gdb) 259-break-disable 2 259^done (gdb) -------------------------------- RESUME (STILL!) FAILS ------------ 260-exec-step-instruction 1 260^running (gdb) &"Sending packet: $Z0,200080,4#40..." Sending packet: $Z0,200080,4#40...&"Ack\n" &"Packet received: E11\n" &"Warning:\n" &"Cannot insert breakpoint 3.\n" &"Error accessing memory address 0x200080: (undocumented errno -1).\n" &"\n" 260^error,msg="Warning:\nCannot insert breakpoint 3.\nError accessing memory address 0x200080: (undocumented errno -1).\n" (gdb) 261 info threads Ack Packet received: E11 Warning: Cannot insert breakpoint 3. Error accessing memory address 0x200080: (undocumented errno -1). -------------------------------------- ********** ********** Test: DELETING breakpoints ------------------------------------------ ENABLE ALL THREE BPS ------- 273-break-enable 1 273^done (gdb) 274-break-enable 2 274^done (gdb) 275-break-enable 3 275^done (gdb) ------------------------------ RESUME FAILS (3 of 2 allowed bps) ------- 276-exec-step-instruction 1 Sending packet: $Z0,200094,4#45...276^running (gdb) &"Sending packet: $Z0,200094,4#45..." Ack Packet received: OK Sending packet: $Z0,20009c,4#74...&"Ack\n" &"Packet received: OK\n" &"Sending packet: $Z0,20009c,4#74..." Ack Packet received: OK &"Ack\n" &"Packet received: OK\n" &"Sending packet: $Z0,200080,4#40..." Sending packet: $Z0,200080,4#40...Ack Packet received: E11 Warning: Cannot insert breakpoint 3. Error accessing memory address 0x200080: (undocumented errno -1). &"Ack\n" &"Packet received: E11\n" &"Warning:\n" &"Cannot insert breakpoint 3.\n" &"Error accessing memory address 0x200080: (undocumented errno -1).\n" &"\n" 276^error,msg="Warning:\nCannot insert breakpoint 3.\nError accessing memory address 0x200080: (undocumented errno -1).\n" (gdb) 277 info threads &"info threads\n" &"Sending packet: $qL1160000000000000000#55..." &"Ack\n" &"Packet received: \n" &"warning: RMT ERROR : failed to get remote thread list.\n" &"Sending packet: $qC#b4..." &"Ack\n" &"Packet received: \n" 277^done (gdb) 278-stack-info-depth 278^done,depth="2" (gdb) 279-stack-list-frames 0 2 279^done,stack=[frame={level="0",addr="0x0020007c",func="my_handler"},frame={level="1",addr="0x002004b4",func="??"}] (gdb) 280-data-list-changed-registers 280^done,changed-registers=[] (gdb) 281 info sharedlibrary &"info sharedlibrary\n" ~"No shared libraries loaded at this time.\n" 281^done (gdb) ------------------------------------------ DELETE BP1/BP2 ------- 282-break-delete 1 &"Sending packet: $z0,200094,4#65..." &"Ack\n" &"Packet received: OK\n" 282^done (gdb) Sending packet: $z0,200094,4#65...Ack Packet received: OK 283-break-delete 2 Sending packet: $z0,20009c,4#94...Ack Packet received: OK &"Sending packet: $z0,20009c,4#94..." &"Ack\n" &"Packet received: OK\n" 283^done (gdb) ------------------------------------- RESUME WORKS (1 of 2 allowed bps) ---------- 284-exec-step-instruction 1 Sending packet: $Z0,200080,4#40...Ack Packet received: OK Sending packet: $s#73...284^running (gdb) &"Sending packet: $Z0,200080,4#40..." &"Ack\n" &"Packet received: OK\n" &"Sending packet: $s#73..." Ack &"Ack\n" Packet received: S05 Sending packet: $g#67...&"Packet received: S05\n" &"Sending packet: $g#67..." Ack Packet received: 008000000d0000a5000006003402000000000000000000000000010000000000000000000000000000f0ffff1008200014082000900a2000b404200080002000 Sending packet: $z0,200080,4#60...&"Ack\n" &"Packet received: 008000000d0000a5000006003402000000000000000000000000010000000000000000000000000000f0ffff1008200014082000900a2000b404200080002000\n" &"Sending packet: $z0,200080,4#60..." Ack Packet received: OK Sending packet: $m200080,4#f7...&"Ack\n" &"Packet received: OK\n" &"Sending packet: $m200080,4#f7..." Ack Packet received: 440d8ae5 &"Ack\n" &"Packet received: 440d8ae5\n" 284*stopped,reason="breakpoint-hit",bkptno="3",thread-id="0",frame={addr="0x00200080",func="my_handler",args=[]} (gdb) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Disabling breakpoints does not work if rejected from remote stub 2007-02-27 19:29 ` Sascha @ 2007-03-06 1:06 ` Michael Snyder 2007-03-06 7:38 ` Disabling breakpoints does not work if rejected from remotestub Sascha 0 siblings, 1 reply; 6+ messages in thread From: Michael Snyder @ 2007-03-06 1:06 UTC (permalink / raw) To: Sascha; +Cc: 'Daniel Jacobowitz', gdb On Tue, 2007-02-27 at 18:05 +0100, Sascha wrote: > Hi > > >Could you try two things for me? > > - I downloaded the latest snapshot from head (27/02) and the problem still > exists > > - I logged the MI session with debug remote set to 1 > > See attached file. Looks like several problems, really: 252^running (gdb) &"Sending packet: $Z0,200094,4#45..." Sending packet: $Z0,200094,4#45...Ack Packet received: OK &"Ack\n" &"Packet received: OK\n" &"Packet Z0 (software-breakpoint) is supported\n" &"Sending packet: $Z0,20009c,4#74..." Packet Z0 (software-breakpoint) is supported Sending packet: $Z0,20009c,4#74...Ack Packet received: OK Sending packet: $Z0,200080,4#40...Ack Packet received: E11 Warning: Cannot insert breakpoint 3. Error accessing memory address 0x200080: (undocumented errno -1). Here, gdb reports the error as "error accessing memory", which isn't really the error (a minor point, perhaps). However, the more serious error is that at this point, the "run" (or "step") command is aborted, returning to the gdb prompt, but without removing the breakpoints. The error handling code at this point ought to remove all of the breakpoints that have been inserted. This is why the handshake state between gdb and your target is now broken. You can't insert a third breakpoint on the target, because the first two have not been removed. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Disabling breakpoints does not work if rejected from remotestub 2007-03-06 1:06 ` Michael Snyder @ 2007-03-06 7:38 ` Sascha 2007-03-06 19:44 ` Michael Snyder 0 siblings, 1 reply; 6+ messages in thread From: Sascha @ 2007-03-06 7:38 UTC (permalink / raw) To: 'Michael Snyder'; +Cc: 'Daniel Jacobowitz', gdb Hi >>However, the more serious error is that at this point, the "run" (or "step") command is aborted, returning to the gdb prompt, but without removing the breakpoints. The error handling code at this point ought to remove all of the breakpoints that have been inserted. I guess GDB does not have to remove the breakpoints at that point - as long as it will remember them later on. You simply have to compare the "DELETE BP1/BP2" section and the "DISABLE BP1/BP2" section in the log. _Deleting_ the breakpoints causes GDB to send the required "z0" (bp remove) packets for those breakpoints which have been inserted already. _Disabling_ the breakpoints does nothing. No "z0" packets were send to the stub. So I guess the fix is to make GDB send the required z0 packets for disabled breakpoints - just like it does for deleted breakpoints. Sascha ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Disabling breakpoints does not work if rejected from remotestub 2007-03-06 7:38 ` Disabling breakpoints does not work if rejected from remotestub Sascha @ 2007-03-06 19:44 ` Michael Snyder 0 siblings, 0 replies; 6+ messages in thread From: Michael Snyder @ 2007-03-06 19:44 UTC (permalink / raw) To: Sascha; +Cc: 'Daniel Jacobowitz', gdb On Tue, 2007-03-06 at 08:38 +0100, Sascha wrote: > Hi > > >>However, the more serious error is that at this point, the > "run" (or "step") command is aborted, returning to the gdb > prompt, but without removing the breakpoints. The error handling > code at this point ought to remove all of the breakpoints that > have been inserted. > > I guess GDB does not have to remove the breakpoints at that point - as long > as it will remember them later on. No, that's not how gdb works (unles there's a change that I don't know about). We don't leave 'em in, we always remove 'em. > You simply have to compare the "DELETE > BP1/BP2" section and the "DISABLE BP1/BP2" section in the log. > > _Deleting_ the breakpoints causes GDB to send the required "z0" (bp remove) > packets for those breakpoints which have been inserted already. > > _Disabling_ the breakpoints does nothing. No "z0" packets were send to the > stub. That's odd. Doesn't sound right. > > So I guess the fix is to make GDB send the required z0 packets for disabled > breakpoints - just like it does for deleted breakpoints. Could be. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-03-06 19:44 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-02-27 11:55 Disabling breakpoints does not work if rejected from remote stub Sascha 2007-02-27 12:52 ` Daniel Jacobowitz 2007-02-27 19:29 ` Sascha 2007-03-06 1:06 ` Michael Snyder 2007-03-06 7:38 ` Disabling breakpoints does not work if rejected from remotestub Sascha 2007-03-06 19:44 ` Michael Snyder
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox