|
From: Nicholas N. <nj...@cs...> - 2007-06-08 20:00:50
|
On Fri, 8 Jun 2007, Vince Weaver wrote: >> Is the guest state accessible inside a instrumentation function? > > I don't know if this is the right way to do it, but one of the plugins I > have for x86 that does some detailed instruction trace dumping does > something like this: > > > int tid,cs_reg; > > tid=VG_(get_running_tid)(); > cs_reg=VG_(threads)[tid].arch.vex.guest_CS; > > for example, to get the guest CS segment register. I don't know if > there's an "official" way to do things like this. I think I might have > had to pull in some questionable header files to get access to the guest > state. I think VG_(get_shadow_regs_area) is a more official way of doing it. See include/pub_tool_machine.h, and VEX/pub/libvex_gues_ppc32.h for the offsets. Nick |