RE: [patch v8 17/24] record-btrace: provide xfer_partial target method

Metzger, Markus T
2013-12-18T09:26:28Z

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Pedro Alves

> > I have something to temporarily disable the xfer checks during
> > to_insert_breakpoint and to_remove_breakpoint.
> >
> > Not sure whether this is considered too hacky or what else I'm missing.
>
> It's hacky as the breakpoints in memory will never actually
> trigger/execute. If you want to assume that the inferior's current
> read only sections match exactly the read only sections the program
> had when the trace was taken, I won't insist. The assumption will
> fail across tracing e.g., dlopen/dlclose/mmap/unmmap, as breakpoints
> will fail to insert on unmapped sections.

Right. I might as well just ignore insert and remove breakpoints.

When I do that, however, I might leak breakpoint instructions for
breakpoints that have been deleted while replaying. Or I might end
up with breakpoints that have not been properly inserted.

The easiest choice seems to be to actually insert and remove breakpoint
instructions into the target memory.

This will fail if the current process image does not match the process
image at the time of the recorded execution. This is currently not
supported and will fail for various other reasons, as well. For one,
I won't be able to disassemble instructions that are no longer there
or might have been replaced meanwhile.

Regards,
Markus.

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052