get the value of a global variable

Hello,I'd like to obtain the value of a global variable used by a process (pid known). Is there a way to get the value of the variable if I know its address in the memory? Can Dtrace do that? Do you have an example of script? Thank you for your help.Fabien.
[293 byte] By [fablafa] at [2007-11-27 2:01:27]
# 1

I read this:

http://www.opensolaris.org/jive/message.jspa?messageID=80703#80703

pid$target:libpkcs11:sftk_handleObject:entry

{

self->object = arg0;

}

pid$target:libpkcs11:sftk_handleObject:return

/self->ob ject != NULL/

{

self->handle = *(int *)

copyin(self->object + 0x80, sizeof (int));

printf("object %p handle is %d\n", self->object, self->handle);

self->object = NULL;

}

the problem is that I want the value of a global variable so I can't use arg0.

I tried to obtain the value of a global value like that:

1) to obtain an address of a global variable I used mdb and ::nm

-> I copy the address of GLOB OBJT 0x4 0xfeb3aa38 for example

2)and then my Dtrace script:

dtrace::BEGIN

{trace(*(int *) copyin(0xfeb3aa38,sizeof(int) );

}

it returns me an "invalid address"...

Any idea?

thank you, say me if it isn't clear enough

Fabien.

fablafa at 2007-7-12 1:41:33 > top of Java-index,Solaris Operating System,Solaris 10 Features...