This is a patch that is a little weird, plus has a portability/usability issue to resolve, so I'm fishing for a little feedback. Our tracing target, among its other complexities, has a JIT, and we're told that it's useful to set tracepoints in JIT code. However, the JIT can unload the tracepointed code and reload other code in its place without telling anybody, so if you start the trace run after that has happened, perhaps in a nonstop mode, the tracepoints get inserted in the middle of instructions, and badness ensues. So the idea of this patch is to record, at definition time, the bytes that the tracepoint expects to overwrite when it is downloaded for the trace run. The agent then compares with what is currently at that address, and refuses to start the run if there is any discrepancy. (In theory this could be a problem for breakpoints also, but breakpoints insert and remove as part of stopping and resuming, so one can catch JIT changes more easily.) Assuming the whole idea has merit, one of the open issues has been to decide how many bytes to record. The patch as it stands has an x64-specific hack that assumes 1 for slow tracepoints, and 5 for fast. In theory this could be a gdbarch property, although the fast tracpoint sal check comes back with a number of instructions being replaced, and that could be used, at least for fast tracepoints. But one of the things that has troubled me is that for 1-byte tracepoints, there is a 1/256 chance of a mistaken acceptance, and perhaps the user/GDB should have the option to check more bytes. But then you get into the possibility of pulling bytes from a different area and problems associated with that. So before getting mired in still more idiosyncrasy, it seems like a good idea to check whether this is of interest for FSF GDB, and to get ideas on how to handle it. Stan 2010-04-23 Stan Shebs * breakpoint.h (struct bp_location): New fields orig_contents and orig_len. * breakpoint.c (check_original_contents): New global. (set_raw_breakpoint): Record original contents. (add_location_to_breakpoint): Ditto. * tracepoint.h (check_original_contents): Declare. * remote.c (PACKET_CheckOriginalContents): New feature enum. (remote_start_remote): Test it. (remote_protocol_features): Add CheckOriginalContents feature. (_initialize_remote): Add it as a config command. (remote_download_tracepoint): Add contents field to tracepoints. * gdb.texinfo (Tracepoint Packets): Describe optional fields. (General Query Packets): Describe CheckOriginalContents.