Lafontaine
2007-Jun-01 09:38 UTC
[dtrace-discuss] find the address of a variable with its name
Hi! I have another problem with Dtrace: I want to get the address of a global variable used by a process if I just know the name. It''s possible with dbx with a print &name_of_the_variable but with Dtrace? trace(`name_of_the_variable) doesn''t work... Thank you very much! Fabien -- This message posted from opensolaris.org
Jon Haslam
2007-Jun-01 13:56 UTC
[dtrace-discuss] find the address of a variable with its name
Hi Fabien,> I have another problem with Dtrace: I want to get the address of a global variable used by a process if I just know the name. > It''s possible with dbx with a print &name_of_the_variable but with Dtrace? trace(`name_of_the_variable) doesn''t work... >Unfortunately, there isn''t the user-land equivalent of the kernel scoping operator (`) and you currently need to go through a bit of a dance to do this. Basically, for a global variable, you need to find the address of the variable in question using your favourite debugger (i.e. mdb(1)) and then use the copyin subroutine to get at the data in question. A previous discussion of this with a bit more detail can be found at: http://www.opensolaris.org/jive/message.jspa?messageID=80703 Jon.