|
From: Alex S. <ai...@co...> - 2010-07-29 14:35:10
|
I'm looking to create a self-contained function or macro that will allow me to read the values of some or all of valgrind's simulated registers at any point during the program's execution. It doesn't really matter how- putting them in a data structure, just dumping them haphazardly onto the stack, or even outputting them to stdout or the log file are all acceptable to varying degrees. It's clear that (assuming it's even possible), I need to use libvex to accomplish this, but even after spending some time reading the libvex source I'm still pretty fuzzy about it all; the source is fine for details but I'm a little lost w/o the "big picture", I'm still not totally clear what libvex even is and what it's for. Would someone mind helping out a newb with a few questions? Namely, - Does "big picture" documentation for libvex even exist, or is the source about all I'm going to get? - Is what I'm thinking about even possible, or is libvex only allowed when developing valgrind tools? - Can I just call LibVEX_GuestAMD64_initialize() at any point during execution (the platform is always amd64-linux), then get the register values from the now-initialized VexGuestAMD64State object, or do I need to run some IR code? - If I do need IR code, how does that work? I appreciate it. Alex |
|
From: WAROQUIERS P. <phi...@eu...> - 2010-07-29 16:01:00
|
I am working on a patch that makes a valgrind process "fully debuggable" (so, you can put breaks, look variables or registers, continue, next, step, query leaks interactively, etc ...). So, to obtain the below, you could just start your executable under the "patched" valgrind, put breaks at the places where you want to look at valgrind simulated registers, and then either manually (or as part of "break command") do: info reg continue The patch is attached to bugzilla 214909. It is however something like 2 months old now. I am currently working on it (some cleanup, use GPLv2+ code rather than GPL3, fixing some bugs, ...). If you are interested, I can provide the last version. (NB: patch is currently only done for linux + x86 or amd64). Philippe >-----Original Message----- >From: Alex Slover [mailto:ai...@co...] >Sent: Thursday 29 July 2010 16:35 >To: val...@li... >Subject: [Valgrind-users] Accessing contents of registers > >I'm looking to create a self-contained function or macro that will >allow me to read the values of some or all of valgrind's simulated >registers at any point during the program's execution. It doesn't >really matter how- putting them in a data structure, just dumping them >haphazardly onto the stack, or even outputting them to stdout or the >log file are all acceptable to varying degrees. It's clear that >(assuming it's even possible), I need to use libvex to accomplish >this, but even after spending some time reading the libvex source I'm >still pretty fuzzy about it all; the source is fine for details but >I'm a little lost w/o the "big picture", I'm still not totally clear >what libvex even is and what it's for. Would someone mind helping out >a newb with a few questions? Namely, > >- Does "big picture" documentation for libvex even exist, or is the >source about all I'm going to get? >- Is what I'm thinking about even possible, or is libvex only allowed >when developing valgrind tools? >- Can I just call LibVEX_GuestAMD64_initialize() at any point during >execution (the platform is always amd64-linux), then get the register >values from the now-initialized VexGuestAMD64State object, or do I >need to run some IR code? >- If I do need IR code, how does that work? > > I appreciate it. > >Alex > >--------------------------------------------------------------- >--------------- >The Palm PDK Hot Apps Program offers developers who use the >Plug-In Development Kit to bring their C/C++ apps to Palm for a share >of $1 Million in cash or HP Products. Visit us here for more details: >http://p.sf.net/sfu/dev2dev-palm >_______________________________________________ >Valgrind-users mailing list >Val...@li... >https://lists.sourceforge.net/lists/listinfo/valgrind-users > ____ This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. |
|
From: Alex S. <ai...@co...> - 2010-07-29 17:15:07
|
If you think it's stable enough for basic day-to-day use, please do. Alex On Thu, Jul 29, 2010 at 11:41 AM, WAROQUIERS Philippe <phi...@eu...> wrote: > I am working on a patch that makes a valgrind process "fully debuggable" > (so, you can put breaks, look variables or registers, continue, next, > step, query leaks interactively, etc ...). > > So, to obtain the below, you could just start your executable > under the "patched" valgrind, put breaks at the places > where you want to look at valgrind simulated registers, > and then either manually (or as part of "break command") do: > info reg > continue > > The patch is attached to bugzilla 214909. > It is however something like 2 months old now. I am currently working > on it (some cleanup, use GPLv2+ code rather than GPL3, fixing some bugs, > ...). > > If you are interested, I can provide the last version. > > (NB: patch is currently only done for linux + x86 or amd64). > > Philippe > > >>-----Original Message----- >>From: Alex Slover [mailto:ai...@co...] >>Sent: Thursday 29 July 2010 16:35 >>To: val...@li... >>Subject: [Valgrind-users] Accessing contents of registers >> >>I'm looking to create a self-contained function or macro that will >>allow me to read the values of some or all of valgrind's simulated >>registers at any point during the program's execution. It doesn't >>really matter how- putting them in a data structure, just dumping them >>haphazardly onto the stack, or even outputting them to stdout or the >>log file are all acceptable to varying degrees. It's clear that >>(assuming it's even possible), I need to use libvex to accomplish >>this, but even after spending some time reading the libvex source I'm >>still pretty fuzzy about it all; the source is fine for details but >>I'm a little lost w/o the "big picture", I'm still not totally clear >>what libvex even is and what it's for. Would someone mind helping out >>a newb with a few questions? Namely, >> >>- Does "big picture" documentation for libvex even exist, or is the >>source about all I'm going to get? >>- Is what I'm thinking about even possible, or is libvex only allowed >>when developing valgrind tools? >>- Can I just call LibVEX_GuestAMD64_initialize() at any point during >>execution (the platform is always amd64-linux), then get the register >>values from the now-initialized VexGuestAMD64State object, or do I >>need to run some IR code? >>- If I do need IR code, how does that work? >> >> I appreciate it. >> >>Alex >> >>--------------------------------------------------------------- >>--------------- >>The Palm PDK Hot Apps Program offers developers who use the >>Plug-In Development Kit to bring their C/C++ apps to Palm for a share >>of $1 Million in cash or HP Products. Visit us here for more details: >>http://p.sf.net/sfu/dev2dev-palm >>_______________________________________________ >>Valgrind-users mailing list >>Val...@li... >>https://lists.sourceforge.net/lists/listinfo/valgrind-users >> > > ____ > > This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. > > Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. > > Any views expressed in this message are those of the sender. > |