I am running a 32-bit user program on a 64-bit kernel.
I need to read in a pointer from user space and then
use this pointer to access a string in user space.
The copyin of the initial pointer works fine but then
I can''t find anyway to get dtrace to use that as a 32-bit
pointer.
Is there a 32-bit version of dtrace (and if so where)?
Is there some other way to overcome this problem?
Any help appreciated.
Diane
pid$target::match_fixed_name:entry
{
trace("enter match_fixed_name");
mydisk = arg0;
self->match_dname = (char *)arg1;
}
pid$target::match_fixed_name:return
{
trace("return");
printf("\ndevice name: %s",
copyinstr((uintptr_t)self->match_dname));
self->devid = (char *)copyin((intptr_t)mydisk, 4);
printf("\ndevice_id at %x, string: s",
(uint_t)self->devid);
/* copyinstr((intptr_t)mydiskp)); */
printf("\nreturn value: %u", (uint64_t)arg1);
}
Ouput for the probe at it stands above.
0 -> match_fixed_name enter match_fixed_name
0 <- match_fixed_name return
device name: /dev/dsk/c2t0d0s0
device_id at ad65fa60, string: s
return value: 0
Output for the probe for when I uncomment the copyinstr:
0 -> match_fixed_name enter match_fixed_name
dtrace: error on enabled probe ID 2 (ID 94557:
pid9078:libdiskmgt.so.1:match_fixed_name:return): invalid address
(0xffffffffac3e4520) in action #5 at DIF offset 40
--
Diane Fallier RPE
Phone: 781/442-1214 (x21214)
diane.fallier at sun.com
Hi, [...]> Is there a 32-bit version of dtrace (and if so where)? > Is there some other way to overcome this problem?look at dtrace man, option -32> pid$target::match_fixed_name:entry > { > trace("enter match_fixed_name"); > mydisk = arg0; > self->match_dname = (char *)arg1; > } > > pid$target::match_fixed_name:return > { > trace("return"); > printf("\ndevice name: %s", > copyinstr((uintptr_t)self->match_dname)); > self->devid = (char *)copyin((intptr_t)mydisk, 4); > printf("\ndevice_id at %x, string: s", (uint_t)self->devid); > /* copyinstr((intptr_t)mydiskp)); */ > printf("\nreturn value: %u", (uint64_t)arg1); > }You should also use self->mydisk instead of mydisk. Also you should set all the self->xxx variables to 0, when you no longer need them. Hope this helps -- Vlad -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 193 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20080710/991842e4/attachment.bin>