Re:Re: Why are these two methods default_memory_insert_breakpoint() and default_memory_remove_breakpoint() called multiple times
hilbert via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
@John Baldwin Thank you very much for your answer; I have another question, very confused.I don't understand the mechanism of register caching. The register cache is initialized at the very beginning, when will it be updated later? Will it be automatically updated later? In the infrun.c/displaced_step_prepare() , it can accurately read the original_pc, which is the pc at the breakpoint position. The instruction replaced by the breakpoint can be obtained through this original_pc; Thank you very much. At 2023-05-31 23:57:52, "John Baldwin" <[email protected]> wrote: >On 5/31/23 2:12 AM, hilbert via Gdb wrote: >> Hi, >> >> I just inserted a breakpoint, shouldn't the two methods default_memory_insert_breakpoint() and default_memory_remove_breakpoint() be used only once? >> >> There is only one breakpoint, why both functions default_memory_insert_breakpoint() and default_memory_remove_breakpoint() are called before stopping and after stopping (after the continue command), why? > >GDB inserts some of its own internal breakpoints. For example, >in the runtime linker/loader there is a special symbol GDB sets >a breakpoint on so it can be notified about shared libraries being >loaded or unloaded. If you are using libthread_db on a target it >may install internal breakpoints to detect thread creation and >thread exit as well. > >-- >John Baldwin