* Fwd: disabling NMI rendering breakpoints non-functional? [not found] <CAKs98dH7TShpfKe4cctTfbonDOkbS1m5rVZv0_WiXwqhTsW8ug@mail.gmail.com> @ 2013-04-12 15:44 ` Kent Tong 2013-04-15 14:38 ` Pedro Alves 0 siblings, 1 reply; 5+ messages in thread From: Kent Tong @ 2013-04-12 15:44 UTC (permalink / raw) To: gdb Hi, It seems that after the code being traced disables NMI, gdb will not stop at the next instruction (si) or at breakpoints. Is this a bug or am I missing something? The code is seabios running in qemu i386. Thanks! -- Kent Tong IT author and consultant, child education coach ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: disabling NMI rendering breakpoints non-functional? 2013-04-12 15:44 ` Fwd: disabling NMI rendering breakpoints non-functional? Kent Tong @ 2013-04-15 14:38 ` Pedro Alves 2013-04-16 2:09 ` Kent Tong 0 siblings, 1 reply; 5+ messages in thread From: Pedro Alves @ 2013-04-15 14:38 UTC (permalink / raw) To: Kent Tong; +Cc: gdb On 04/12/2013 04:44 PM, Kent Tong wrote: > Hi, > > It seems that after the code being traced disables NMI, gdb will not > stop at the next instruction (si) or at breakpoints. Is this a bug or > am I missing something? > > The code is seabios running in qemu i386. GDB has no clue of NMI, it just tells the target to set a breakpoint at some address, or to single-step. How qemu implements those things behind the scenes is up to qemu. -- Pedro Alves ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: disabling NMI rendering breakpoints non-functional? 2013-04-15 14:38 ` Pedro Alves @ 2013-04-16 2:09 ` Kent Tong 2013-04-17 9:36 ` Pedro Alves 0 siblings, 1 reply; 5+ messages in thread From: Kent Tong @ 2013-04-16 2:09 UTC (permalink / raw) To: gdb > GDB has no clue of NMI, it just tells the target to set a breakpoint at > some address, or to single-step. How qemu implements those things > behind the scenes is up to qemu. Thanks for the reply! I also figured that. But does the breakpoint if it is set to a memory address whose content will be overwritten (e.g., loading instructions into there)? In the past it worked, but now somehow it has stopped working. -- Kent Tong IT author and consultant, child education coach ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: disabling NMI rendering breakpoints non-functional? 2013-04-16 2:09 ` Kent Tong @ 2013-04-17 9:36 ` Pedro Alves 2013-04-17 9:40 ` Kent Tong 0 siblings, 1 reply; 5+ messages in thread From: Pedro Alves @ 2013-04-17 9:36 UTC (permalink / raw) To: Kent Tong; +Cc: gdb On 04/16/2013 03:09 AM, Kent Tong wrote: >> GDB has no clue of NMI, it just tells the target to set a breakpoint at >> some address, or to single-step. How qemu implements those things >> behind the scenes is up to qemu. > > Thanks for the reply! I also figured that. But does the breakpoint if it is > set to a memory address whose content will be overwritten (e.g., loading > instructions into there)? In the past it worked, but now somehow it has > stopped working. Depends on how qemu implements breakpoints. By default, if the target doesn't support z0 remote protocol packets, then GDB fallsback to implementing breakpoints by planting architecture-defined breakpoint instructions (on x86 that's trap3/0xcc), and then handling the resulting trap. Naturally it won't work if the instruction is overwritten. The emulator is free to implement the z0/Z0 packets to handle setting breakpoints itself as it sees fit. It could still be by planting 0xcc instructions or by watching the address that is about to be executed, or through whatever other means it comes up with to make that scenario work. GDB doesn't care. -- Pedro Alves ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: disabling NMI rendering breakpoints non-functional? 2013-04-17 9:36 ` Pedro Alves @ 2013-04-17 9:40 ` Kent Tong 0 siblings, 0 replies; 5+ messages in thread From: Kent Tong @ 2013-04-17 9:40 UTC (permalink / raw) To: gdb > ...The emulator is free to > implement the z0/Z0 packets to handle setting breakpoints itself as it > sees fit. It could still be by planting 0xcc instructions or by watching > the address that is about to be executed, or through whatever other means > it comes up with to make that scenario work. GDB doesn't care. Thanks for the info! I guess that nailed the issue. -- Kent Tong IT author and consultant, child education coach ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-17 9:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAKs98dH7TShpfKe4cctTfbonDOkbS1m5rVZv0_WiXwqhTsW8ug@mail.gmail.com>
2013-04-12 15:44 ` Fwd: disabling NMI rendering breakpoints non-functional? Kent Tong
2013-04-15 14:38 ` Pedro Alves
2013-04-16 2:09 ` Kent Tong
2013-04-17 9:36 ` Pedro Alves
2013-04-17 9:40 ` Kent Tong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox