summaryrefslogtreecommitdiff
path: root/utils/rpctrace.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-07-18 01:39:14 +0000
committerRoland McGrath <roland@gnu.org>1999-07-18 01:39:14 +0000
commitee6ee92148cc5624077ed711f642c5e95e0285a6 (patch)
tree8840a95d99399c5d2d05bf01bf5b42e08ba1c721 /utils/rpctrace.c
parent56a7b9779fed04f598a1ba814780df1299edde0f (diff)
(trace_and_forward): rehack special cases for mach_port_insert_right and vm_map
Diffstat (limited to 'utils/rpctrace.c')
-rw-r--r--utils/rpctrace.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index 316e5cce..5fc82181 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -409,13 +409,6 @@ trace_and_forward (mach_msg_header_t *inp, mach_msg_header_t *outp)
inp->msgh_bits = complex | MACH_MSGH_BITS (this_type, reply_type);
}
- if (inp->msgh_id == 3215) /* mach_port_insert_right */
- {
- /* XXX
- */
- msg_buf_ptr = (void *) inp + inp->msgh_size;
- }
-
/* Process the message data, wrapping ports and printing data. */
while (msg_buf_ptr < (void *) inp + inp->msgh_size)
{
@@ -475,7 +468,41 @@ trace_and_forward (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
mach_port_t o=portnames[i];
newtypes[i] = name;
+
+ if (inp->msgh_id == 3215) /* mach_port_insert_right */
+ {
+ /* XXX
+ */
+ fprintf (ostream,
+ "\t\t[%d] = pass through port %d, type %d\n",
+ i, portnames[i], name);
+ continue;
+ }
+ else if (inp->msgh_id == 2089) /* vm_map */
+ {
+ /* XXX
+ */
+ struct traced_info *p = ports_lookup_port (traced_bucket,
+ portnames[i], 0);
+ if (p == 0)
+ fprintf (ostream,
+ "\t\t[%d] = pass through port %d, type %d\n",
+ i, portnames[i], name);
+ else
+ {
+ fprintf (ostream,
+ "\t\t[%d] = traced port %d, type %d -> original port %d\n",
+ i, portnames[i], name, p->forward);
+ mach_port_deallocate (mach_task_self (), portnames[i]);
+ portnames[i] = p->forward;
+ newtypes[i] = MACH_MSG_TYPE_COPY_SEND;
+ ports_port_deref (p);
+ continue;
+ }
+ }
+
err = rewrite_right (&portnames[i], &newtypes[i]);
+ assert_perror (err);
if (portnames[i] == MACH_PORT_NULL)
fprintf (ostream, "\t\t[%d] = null\n", i);