Converted to the new debugging interface (done with the help of the
[wine/multimedia.git] / server / trace.c
bloba51f954a6794978454c1d53df1ad981292b5d340
1 /* File generated automatically by tools/make_requests; DO NOT EDIT!! */
3 #include <stdio.h>
4 #include <sys/types.h>
5 #include <sys/uio.h>
6 #include "server.h"
7 #include "server/thread.h"
9 static int dump_new_process_request( struct new_process_request *req, int len )
11 fprintf( stderr, " inherit=%d,", req->inherit );
12 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
13 fprintf( stderr, " start_flags=%d,", req->start_flags );
14 fprintf( stderr, " hstdin=%d,", req->hstdin );
15 fprintf( stderr, " hstdout=%d,", req->hstdout );
16 fprintf( stderr, " hstderr=%d,", req->hstderr );
17 fprintf( stderr, " env_ptr=%p,", req->env_ptr );
18 fprintf( stderr, " cmd_line=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
19 return len;
22 static int dump_new_process_reply( struct new_process_reply *req, int len )
24 fprintf( stderr, " pid=%p,", req->pid );
25 fprintf( stderr, " handle=%d", req->handle );
26 return (int)sizeof(*req);
29 static int dump_new_thread_request( struct new_thread_request *req, int len )
31 fprintf( stderr, " pid=%p,", req->pid );
32 fprintf( stderr, " suspend=%d,", req->suspend );
33 fprintf( stderr, " inherit=%d", req->inherit );
34 return (int)sizeof(*req);
37 static int dump_new_thread_reply( struct new_thread_reply *req, int len )
39 fprintf( stderr, " tid=%p,", req->tid );
40 fprintf( stderr, " handle=%d", req->handle );
41 return (int)sizeof(*req);
44 static int dump_set_debug_request( struct set_debug_request *req, int len )
46 fprintf( stderr, " level=%d", req->level );
47 return (int)sizeof(*req);
50 static int dump_init_process_request( struct init_process_request *req, int len )
52 fprintf( stderr, " dummy=%d", req->dummy );
53 return (int)sizeof(*req);
56 static int dump_init_process_reply( struct init_process_reply *req, int len )
58 fprintf( stderr, " start_flags=%d,", req->start_flags );
59 fprintf( stderr, " hstdin=%d,", req->hstdin );
60 fprintf( stderr, " hstdout=%d,", req->hstdout );
61 fprintf( stderr, " hstderr=%d,", req->hstderr );
62 fprintf( stderr, " env_ptr=%p", req->env_ptr );
63 return (int)sizeof(*req);
66 static int dump_init_thread_request( struct init_thread_request *req, int len )
68 fprintf( stderr, " unix_pid=%d", req->unix_pid );
69 return (int)sizeof(*req);
72 static int dump_init_thread_reply( struct init_thread_reply *req, int len )
74 fprintf( stderr, " pid=%p,", req->pid );
75 fprintf( stderr, " tid=%p", req->tid );
76 return (int)sizeof(*req);
79 static int dump_terminate_process_request( struct terminate_process_request *req, int len )
81 fprintf( stderr, " handle=%d,", req->handle );
82 fprintf( stderr, " exit_code=%d", req->exit_code );
83 return (int)sizeof(*req);
86 static int dump_terminate_thread_request( struct terminate_thread_request *req, int len )
88 fprintf( stderr, " handle=%d,", req->handle );
89 fprintf( stderr, " exit_code=%d", req->exit_code );
90 return (int)sizeof(*req);
93 static int dump_get_process_info_request( struct get_process_info_request *req, int len )
95 fprintf( stderr, " handle=%d", req->handle );
96 return (int)sizeof(*req);
99 static int dump_get_process_info_reply( struct get_process_info_reply *req, int len )
101 fprintf( stderr, " pid=%p,", req->pid );
102 fprintf( stderr, " exit_code=%d,", req->exit_code );
103 fprintf( stderr, " priority=%d,", req->priority );
104 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
105 fprintf( stderr, " system_affinity=%d", req->system_affinity );
106 return (int)sizeof(*req);
109 static int dump_set_process_info_request( struct set_process_info_request *req, int len )
111 fprintf( stderr, " handle=%d,", req->handle );
112 fprintf( stderr, " mask=%d,", req->mask );
113 fprintf( stderr, " priority=%d,", req->priority );
114 fprintf( stderr, " affinity=%d", req->affinity );
115 return (int)sizeof(*req);
118 static int dump_get_thread_info_request( struct get_thread_info_request *req, int len )
120 fprintf( stderr, " handle=%d", req->handle );
121 return (int)sizeof(*req);
124 static int dump_get_thread_info_reply( struct get_thread_info_reply *req, int len )
126 fprintf( stderr, " tid=%p,", req->tid );
127 fprintf( stderr, " exit_code=%d,", req->exit_code );
128 fprintf( stderr, " priority=%d", req->priority );
129 return (int)sizeof(*req);
132 static int dump_set_thread_info_request( struct set_thread_info_request *req, int len )
134 fprintf( stderr, " handle=%d,", req->handle );
135 fprintf( stderr, " mask=%d,", req->mask );
136 fprintf( stderr, " priority=%d,", req->priority );
137 fprintf( stderr, " affinity=%d", req->affinity );
138 return (int)sizeof(*req);
141 static int dump_suspend_thread_request( struct suspend_thread_request *req, int len )
143 fprintf( stderr, " handle=%d", req->handle );
144 return (int)sizeof(*req);
147 static int dump_suspend_thread_reply( struct suspend_thread_reply *req, int len )
149 fprintf( stderr, " count=%d", req->count );
150 return (int)sizeof(*req);
153 static int dump_resume_thread_request( struct resume_thread_request *req, int len )
155 fprintf( stderr, " handle=%d", req->handle );
156 return (int)sizeof(*req);
159 static int dump_resume_thread_reply( struct resume_thread_reply *req, int len )
161 fprintf( stderr, " count=%d", req->count );
162 return (int)sizeof(*req);
165 static int dump_debugger_request( struct debugger_request *req, int len )
167 fprintf( stderr, " op=%d", req->op );
168 return (int)sizeof(*req);
171 static int dump_queue_apc_request( struct queue_apc_request *req, int len )
173 fprintf( stderr, " handle=%d,", req->handle );
174 fprintf( stderr, " func=%p,", req->func );
175 fprintf( stderr, " param=%p", req->param );
176 return (int)sizeof(*req);
179 static int dump_close_handle_request( struct close_handle_request *req, int len )
181 fprintf( stderr, " handle=%d", req->handle );
182 return (int)sizeof(*req);
185 static int dump_get_handle_info_request( struct get_handle_info_request *req, int len )
187 fprintf( stderr, " handle=%d", req->handle );
188 return (int)sizeof(*req);
191 static int dump_get_handle_info_reply( struct get_handle_info_reply *req, int len )
193 fprintf( stderr, " flags=%d", req->flags );
194 return (int)sizeof(*req);
197 static int dump_set_handle_info_request( struct set_handle_info_request *req, int len )
199 fprintf( stderr, " handle=%d,", req->handle );
200 fprintf( stderr, " flags=%d,", req->flags );
201 fprintf( stderr, " mask=%d", req->mask );
202 return (int)sizeof(*req);
205 static int dump_dup_handle_request( struct dup_handle_request *req, int len )
207 fprintf( stderr, " src_process=%d,", req->src_process );
208 fprintf( stderr, " src_handle=%d,", req->src_handle );
209 fprintf( stderr, " dst_process=%d,", req->dst_process );
210 fprintf( stderr, " access=%08x,", req->access );
211 fprintf( stderr, " inherit=%d,", req->inherit );
212 fprintf( stderr, " options=%d", req->options );
213 return (int)sizeof(*req);
216 static int dump_dup_handle_reply( struct dup_handle_reply *req, int len )
218 fprintf( stderr, " handle=%d", req->handle );
219 return (int)sizeof(*req);
222 static int dump_open_process_request( struct open_process_request *req, int len )
224 fprintf( stderr, " pid=%p,", req->pid );
225 fprintf( stderr, " access=%08x,", req->access );
226 fprintf( stderr, " inherit=%d", req->inherit );
227 return (int)sizeof(*req);
230 static int dump_open_process_reply( struct open_process_reply *req, int len )
232 fprintf( stderr, " handle=%d", req->handle );
233 return (int)sizeof(*req);
236 static int dump_select_request( struct select_request *req, int len )
238 fprintf( stderr, " count=%d,", req->count );
239 fprintf( stderr, " flags=%d,", req->flags );
240 fprintf( stderr, " timeout=%d", req->timeout );
241 return (int)sizeof(*req);
244 static int dump_select_reply( struct select_reply *req, int len )
246 fprintf( stderr, " signaled=%d", req->signaled );
247 return (int)sizeof(*req);
250 static int dump_create_event_request( struct create_event_request *req, int len )
252 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
253 fprintf( stderr, " initial_state=%d,", req->initial_state );
254 fprintf( stderr, " inherit=%d,", req->inherit );
255 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
256 return len;
259 static int dump_create_event_reply( struct create_event_reply *req, int len )
261 fprintf( stderr, " handle=%d", req->handle );
262 return (int)sizeof(*req);
265 static int dump_event_op_request( struct event_op_request *req, int len )
267 fprintf( stderr, " handle=%d,", req->handle );
268 fprintf( stderr, " op=%d", req->op );
269 return (int)sizeof(*req);
272 static int dump_create_mutex_request( struct create_mutex_request *req, int len )
274 fprintf( stderr, " owned=%d,", req->owned );
275 fprintf( stderr, " inherit=%d,", req->inherit );
276 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
277 return len;
280 static int dump_create_mutex_reply( struct create_mutex_reply *req, int len )
282 fprintf( stderr, " handle=%d", req->handle );
283 return (int)sizeof(*req);
286 static int dump_release_mutex_request( struct release_mutex_request *req, int len )
288 fprintf( stderr, " handle=%d", req->handle );
289 return (int)sizeof(*req);
292 static int dump_create_semaphore_request( struct create_semaphore_request *req, int len )
294 fprintf( stderr, " initial=%08x,", req->initial );
295 fprintf( stderr, " max=%08x,", req->max );
296 fprintf( stderr, " inherit=%d,", req->inherit );
297 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
298 return len;
301 static int dump_create_semaphore_reply( struct create_semaphore_reply *req, int len )
303 fprintf( stderr, " handle=%d", req->handle );
304 return (int)sizeof(*req);
307 static int dump_release_semaphore_request( struct release_semaphore_request *req, int len )
309 fprintf( stderr, " handle=%d,", req->handle );
310 fprintf( stderr, " count=%08x", req->count );
311 return (int)sizeof(*req);
314 static int dump_release_semaphore_reply( struct release_semaphore_reply *req, int len )
316 fprintf( stderr, " prev_count=%08x", req->prev_count );
317 return (int)sizeof(*req);
320 static int dump_open_named_obj_request( struct open_named_obj_request *req, int len )
322 fprintf( stderr, " type=%d,", req->type );
323 fprintf( stderr, " access=%08x,", req->access );
324 fprintf( stderr, " inherit=%d,", req->inherit );
325 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
326 return len;
329 static int dump_open_named_obj_reply( struct open_named_obj_reply *req, int len )
331 fprintf( stderr, " handle=%d", req->handle );
332 return (int)sizeof(*req);
335 static int dump_create_file_request( struct create_file_request *req, int len )
337 fprintf( stderr, " access=%08x,", req->access );
338 fprintf( stderr, " inherit=%d,", req->inherit );
339 fprintf( stderr, " sharing=%08x,", req->sharing );
340 fprintf( stderr, " create=%d,", req->create );
341 fprintf( stderr, " attrs=%08x,", req->attrs );
342 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
343 return len;
346 static int dump_create_file_reply( struct create_file_reply *req, int len )
348 fprintf( stderr, " handle=%d", req->handle );
349 return (int)sizeof(*req);
352 static int dump_get_read_fd_request( struct get_read_fd_request *req, int len )
354 fprintf( stderr, " handle=%d", req->handle );
355 return (int)sizeof(*req);
358 static int dump_get_write_fd_request( struct get_write_fd_request *req, int len )
360 fprintf( stderr, " handle=%d", req->handle );
361 return (int)sizeof(*req);
364 static int dump_set_file_pointer_request( struct set_file_pointer_request *req, int len )
366 fprintf( stderr, " handle=%d,", req->handle );
367 fprintf( stderr, " low=%d,", req->low );
368 fprintf( stderr, " high=%d,", req->high );
369 fprintf( stderr, " whence=%d", req->whence );
370 return (int)sizeof(*req);
373 static int dump_set_file_pointer_reply( struct set_file_pointer_reply *req, int len )
375 fprintf( stderr, " low=%d,", req->low );
376 fprintf( stderr, " high=%d", req->high );
377 return (int)sizeof(*req);
380 static int dump_truncate_file_request( struct truncate_file_request *req, int len )
382 fprintf( stderr, " handle=%d", req->handle );
383 return (int)sizeof(*req);
386 static int dump_set_file_time_request( struct set_file_time_request *req, int len )
388 fprintf( stderr, " handle=%d,", req->handle );
389 fprintf( stderr, " access_time=%ld,", req->access_time );
390 fprintf( stderr, " write_time=%ld", req->write_time );
391 return (int)sizeof(*req);
394 static int dump_flush_file_request( struct flush_file_request *req, int len )
396 fprintf( stderr, " handle=%d", req->handle );
397 return (int)sizeof(*req);
400 static int dump_get_file_info_request( struct get_file_info_request *req, int len )
402 fprintf( stderr, " handle=%d", req->handle );
403 return (int)sizeof(*req);
406 static int dump_get_file_info_reply( struct get_file_info_reply *req, int len )
408 fprintf( stderr, " type=%d,", req->type );
409 fprintf( stderr, " attr=%d,", req->attr );
410 fprintf( stderr, " access_time=%ld,", req->access_time );
411 fprintf( stderr, " write_time=%ld,", req->write_time );
412 fprintf( stderr, " size_high=%d,", req->size_high );
413 fprintf( stderr, " size_low=%d,", req->size_low );
414 fprintf( stderr, " links=%d,", req->links );
415 fprintf( stderr, " index_high=%d,", req->index_high );
416 fprintf( stderr, " index_low=%d,", req->index_low );
417 fprintf( stderr, " serial=%08x", req->serial );
418 return (int)sizeof(*req);
421 static int dump_lock_file_request( struct lock_file_request *req, int len )
423 fprintf( stderr, " handle=%d,", req->handle );
424 fprintf( stderr, " offset_low=%08x,", req->offset_low );
425 fprintf( stderr, " offset_high=%08x,", req->offset_high );
426 fprintf( stderr, " count_low=%08x,", req->count_low );
427 fprintf( stderr, " count_high=%08x", req->count_high );
428 return (int)sizeof(*req);
431 static int dump_unlock_file_request( struct unlock_file_request *req, int len )
433 fprintf( stderr, " handle=%d,", req->handle );
434 fprintf( stderr, " offset_low=%08x,", req->offset_low );
435 fprintf( stderr, " offset_high=%08x,", req->offset_high );
436 fprintf( stderr, " count_low=%08x,", req->count_low );
437 fprintf( stderr, " count_high=%08x", req->count_high );
438 return (int)sizeof(*req);
441 static int dump_create_pipe_request( struct create_pipe_request *req, int len )
443 fprintf( stderr, " inherit=%d", req->inherit );
444 return (int)sizeof(*req);
447 static int dump_create_pipe_reply( struct create_pipe_reply *req, int len )
449 fprintf( stderr, " handle_read=%d,", req->handle_read );
450 fprintf( stderr, " handle_write=%d", req->handle_write );
451 return (int)sizeof(*req);
454 static int dump_alloc_console_request( struct alloc_console_request *req, int len )
456 return (int)sizeof(*req);
459 static int dump_free_console_request( struct free_console_request *req, int len )
461 return (int)sizeof(*req);
464 static int dump_open_console_request( struct open_console_request *req, int len )
466 fprintf( stderr, " output=%d,", req->output );
467 fprintf( stderr, " access=%08x,", req->access );
468 fprintf( stderr, " inherit=%d", req->inherit );
469 return (int)sizeof(*req);
472 static int dump_open_console_reply( struct open_console_reply *req, int len )
474 fprintf( stderr, " handle=%d", req->handle );
475 return (int)sizeof(*req);
478 static int dump_set_console_fd_request( struct set_console_fd_request *req, int len )
480 fprintf( stderr, " handle=%d,", req->handle );
481 fprintf( stderr, " pid=%d", req->pid );
482 return (int)sizeof(*req);
485 static int dump_get_console_mode_request( struct get_console_mode_request *req, int len )
487 fprintf( stderr, " handle=%d", req->handle );
488 return (int)sizeof(*req);
491 static int dump_get_console_mode_reply( struct get_console_mode_reply *req, int len )
493 fprintf( stderr, " mode=%d", req->mode );
494 return (int)sizeof(*req);
497 static int dump_set_console_mode_request( struct set_console_mode_request *req, int len )
499 fprintf( stderr, " handle=%d,", req->handle );
500 fprintf( stderr, " mode=%d", req->mode );
501 return (int)sizeof(*req);
504 static int dump_set_console_info_request( struct set_console_info_request *req, int len )
506 fprintf( stderr, " handle=%d,", req->handle );
507 fprintf( stderr, " mask=%d,", req->mask );
508 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
509 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
510 fprintf( stderr, " title=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
511 return len;
514 static int dump_get_console_info_request( struct get_console_info_request *req, int len )
516 fprintf( stderr, " handle=%d", req->handle );
517 return (int)sizeof(*req);
520 static int dump_get_console_info_reply( struct get_console_info_reply *req, int len )
522 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
523 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
524 fprintf( stderr, " pid=%d", req->pid );
525 return (int)sizeof(*req);
528 static int dump_write_console_input_request( struct write_console_input_request *req, int len )
530 fprintf( stderr, " handle=%d,", req->handle );
531 fprintf( stderr, " count=%d", req->count );
532 return (int)sizeof(*req);
535 static int dump_write_console_input_reply( struct write_console_input_reply *req, int len )
537 fprintf( stderr, " written=%d", req->written );
538 return (int)sizeof(*req);
541 static int dump_read_console_input_request( struct read_console_input_request *req, int len )
543 fprintf( stderr, " handle=%d,", req->handle );
544 fprintf( stderr, " count=%d,", req->count );
545 fprintf( stderr, " flush=%d", req->flush );
546 return (int)sizeof(*req);
549 static int dump_read_console_input_reply( struct read_console_input_reply *req, int len )
551 return (int)sizeof(*req);
554 static int dump_create_change_notification_request( struct create_change_notification_request *req, int len )
556 fprintf( stderr, " subtree=%d,", req->subtree );
557 fprintf( stderr, " filter=%d", req->filter );
558 return (int)sizeof(*req);
561 static int dump_create_change_notification_reply( struct create_change_notification_reply *req, int len )
563 fprintf( stderr, " handle=%d", req->handle );
564 return (int)sizeof(*req);
567 static int dump_create_mapping_request( struct create_mapping_request *req, int len )
569 fprintf( stderr, " size_high=%d,", req->size_high );
570 fprintf( stderr, " size_low=%d,", req->size_low );
571 fprintf( stderr, " protect=%d,", req->protect );
572 fprintf( stderr, " inherit=%d,", req->inherit );
573 fprintf( stderr, " handle=%d,", req->handle );
574 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
575 return len;
578 static int dump_create_mapping_reply( struct create_mapping_reply *req, int len )
580 fprintf( stderr, " handle=%d", req->handle );
581 return (int)sizeof(*req);
584 static int dump_get_mapping_info_request( struct get_mapping_info_request *req, int len )
586 fprintf( stderr, " handle=%d", req->handle );
587 return (int)sizeof(*req);
590 static int dump_get_mapping_info_reply( struct get_mapping_info_reply *req, int len )
592 fprintf( stderr, " size_high=%d,", req->size_high );
593 fprintf( stderr, " size_low=%d,", req->size_low );
594 fprintf( stderr, " protect=%d", req->protect );
595 return (int)sizeof(*req);
598 static int dump_create_device_request( struct create_device_request *req, int len )
600 fprintf( stderr, " access=%08x,", req->access );
601 fprintf( stderr, " inherit=%d,", req->inherit );
602 fprintf( stderr, " id=%d", req->id );
603 return (int)sizeof(*req);
606 static int dump_create_device_reply( struct create_device_reply *req, int len )
608 fprintf( stderr, " handle=%d", req->handle );
609 return (int)sizeof(*req);
612 static int dump_create_snapshot_request( struct create_snapshot_request *req, int len )
614 fprintf( stderr, " inherit=%d,", req->inherit );
615 fprintf( stderr, " flags=%d", req->flags );
616 return (int)sizeof(*req);
619 static int dump_create_snapshot_reply( struct create_snapshot_reply *req, int len )
621 fprintf( stderr, " handle=%d", req->handle );
622 return (int)sizeof(*req);
625 static int dump_next_process_request( struct next_process_request *req, int len )
627 fprintf( stderr, " handle=%d,", req->handle );
628 fprintf( stderr, " reset=%d", req->reset );
629 return (int)sizeof(*req);
632 static int dump_next_process_reply( struct next_process_reply *req, int len )
634 fprintf( stderr, " pid=%p,", req->pid );
635 fprintf( stderr, " threads=%d,", req->threads );
636 fprintf( stderr, " priority=%d", req->priority );
637 return (int)sizeof(*req);
640 struct dumper
642 int (*dump_req)( void *data, int len );
643 void (*dump_reply)( void *data );
646 static const struct dumper dumpers[REQ_NB_REQUESTS] =
648 { (int(*)(void *,int))dump_new_process_request,
649 (void(*)())dump_new_process_reply },
650 { (int(*)(void *,int))dump_new_thread_request,
651 (void(*)())dump_new_thread_reply },
652 { (int(*)(void *,int))dump_set_debug_request,
653 (void(*)())0 },
654 { (int(*)(void *,int))dump_init_process_request,
655 (void(*)())dump_init_process_reply },
656 { (int(*)(void *,int))dump_init_thread_request,
657 (void(*)())dump_init_thread_reply },
658 { (int(*)(void *,int))dump_terminate_process_request,
659 (void(*)())0 },
660 { (int(*)(void *,int))dump_terminate_thread_request,
661 (void(*)())0 },
662 { (int(*)(void *,int))dump_get_process_info_request,
663 (void(*)())dump_get_process_info_reply },
664 { (int(*)(void *,int))dump_set_process_info_request,
665 (void(*)())0 },
666 { (int(*)(void *,int))dump_get_thread_info_request,
667 (void(*)())dump_get_thread_info_reply },
668 { (int(*)(void *,int))dump_set_thread_info_request,
669 (void(*)())0 },
670 { (int(*)(void *,int))dump_suspend_thread_request,
671 (void(*)())dump_suspend_thread_reply },
672 { (int(*)(void *,int))dump_resume_thread_request,
673 (void(*)())dump_resume_thread_reply },
674 { (int(*)(void *,int))dump_debugger_request,
675 (void(*)())0 },
676 { (int(*)(void *,int))dump_queue_apc_request,
677 (void(*)())0 },
678 { (int(*)(void *,int))dump_close_handle_request,
679 (void(*)())0 },
680 { (int(*)(void *,int))dump_get_handle_info_request,
681 (void(*)())dump_get_handle_info_reply },
682 { (int(*)(void *,int))dump_set_handle_info_request,
683 (void(*)())0 },
684 { (int(*)(void *,int))dump_dup_handle_request,
685 (void(*)())dump_dup_handle_reply },
686 { (int(*)(void *,int))dump_open_process_request,
687 (void(*)())dump_open_process_reply },
688 { (int(*)(void *,int))dump_select_request,
689 (void(*)())dump_select_reply },
690 { (int(*)(void *,int))dump_create_event_request,
691 (void(*)())dump_create_event_reply },
692 { (int(*)(void *,int))dump_event_op_request,
693 (void(*)())0 },
694 { (int(*)(void *,int))dump_create_mutex_request,
695 (void(*)())dump_create_mutex_reply },
696 { (int(*)(void *,int))dump_release_mutex_request,
697 (void(*)())0 },
698 { (int(*)(void *,int))dump_create_semaphore_request,
699 (void(*)())dump_create_semaphore_reply },
700 { (int(*)(void *,int))dump_release_semaphore_request,
701 (void(*)())dump_release_semaphore_reply },
702 { (int(*)(void *,int))dump_open_named_obj_request,
703 (void(*)())dump_open_named_obj_reply },
704 { (int(*)(void *,int))dump_create_file_request,
705 (void(*)())dump_create_file_reply },
706 { (int(*)(void *,int))dump_get_read_fd_request,
707 (void(*)())0 },
708 { (int(*)(void *,int))dump_get_write_fd_request,
709 (void(*)())0 },
710 { (int(*)(void *,int))dump_set_file_pointer_request,
711 (void(*)())dump_set_file_pointer_reply },
712 { (int(*)(void *,int))dump_truncate_file_request,
713 (void(*)())0 },
714 { (int(*)(void *,int))dump_set_file_time_request,
715 (void(*)())0 },
716 { (int(*)(void *,int))dump_flush_file_request,
717 (void(*)())0 },
718 { (int(*)(void *,int))dump_get_file_info_request,
719 (void(*)())dump_get_file_info_reply },
720 { (int(*)(void *,int))dump_lock_file_request,
721 (void(*)())0 },
722 { (int(*)(void *,int))dump_unlock_file_request,
723 (void(*)())0 },
724 { (int(*)(void *,int))dump_create_pipe_request,
725 (void(*)())dump_create_pipe_reply },
726 { (int(*)(void *,int))dump_alloc_console_request,
727 (void(*)())0 },
728 { (int(*)(void *,int))dump_free_console_request,
729 (void(*)())0 },
730 { (int(*)(void *,int))dump_open_console_request,
731 (void(*)())dump_open_console_reply },
732 { (int(*)(void *,int))dump_set_console_fd_request,
733 (void(*)())0 },
734 { (int(*)(void *,int))dump_get_console_mode_request,
735 (void(*)())dump_get_console_mode_reply },
736 { (int(*)(void *,int))dump_set_console_mode_request,
737 (void(*)())0 },
738 { (int(*)(void *,int))dump_set_console_info_request,
739 (void(*)())0 },
740 { (int(*)(void *,int))dump_get_console_info_request,
741 (void(*)())dump_get_console_info_reply },
742 { (int(*)(void *,int))dump_write_console_input_request,
743 (void(*)())dump_write_console_input_reply },
744 { (int(*)(void *,int))dump_read_console_input_request,
745 (void(*)())dump_read_console_input_reply },
746 { (int(*)(void *,int))dump_create_change_notification_request,
747 (void(*)())dump_create_change_notification_reply },
748 { (int(*)(void *,int))dump_create_mapping_request,
749 (void(*)())dump_create_mapping_reply },
750 { (int(*)(void *,int))dump_get_mapping_info_request,
751 (void(*)())dump_get_mapping_info_reply },
752 { (int(*)(void *,int))dump_create_device_request,
753 (void(*)())dump_create_device_reply },
754 { (int(*)(void *,int))dump_create_snapshot_request,
755 (void(*)())dump_create_snapshot_reply },
756 { (int(*)(void *,int))dump_next_process_request,
757 (void(*)())dump_next_process_reply },
760 static const char * const req_names[REQ_NB_REQUESTS] =
762 "new_process",
763 "new_thread",
764 "set_debug",
765 "init_process",
766 "init_thread",
767 "terminate_process",
768 "terminate_thread",
769 "get_process_info",
770 "set_process_info",
771 "get_thread_info",
772 "set_thread_info",
773 "suspend_thread",
774 "resume_thread",
775 "debugger",
776 "queue_apc",
777 "close_handle",
778 "get_handle_info",
779 "set_handle_info",
780 "dup_handle",
781 "open_process",
782 "select",
783 "create_event",
784 "event_op",
785 "create_mutex",
786 "release_mutex",
787 "create_semaphore",
788 "release_semaphore",
789 "open_named_obj",
790 "create_file",
791 "get_read_fd",
792 "get_write_fd",
793 "set_file_pointer",
794 "truncate_file",
795 "set_file_time",
796 "flush_file",
797 "get_file_info",
798 "lock_file",
799 "unlock_file",
800 "create_pipe",
801 "alloc_console",
802 "free_console",
803 "open_console",
804 "set_console_fd",
805 "get_console_mode",
806 "set_console_mode",
807 "set_console_info",
808 "get_console_info",
809 "write_console_input",
810 "read_console_input",
811 "create_change_notification",
812 "create_mapping",
813 "get_mapping_info",
814 "create_device",
815 "create_snapshot",
816 "next_process",
819 void trace_request( enum request req, void *data, int len, int fd )
821 int size;
822 current->last_req = req;
823 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
824 size = dumpers[req].dump_req( data, len );
825 if ((len -= size) > 0)
827 unsigned char *ptr = (unsigned char *)data + size;
828 while (len--) fprintf( stderr, ", %02x", *ptr++ );
830 if (fd != -1) fprintf( stderr, " ) fd=%d\n", fd );
831 else fprintf( stderr, " )\n" );
834 void trace_timeout(void)
836 fprintf( stderr, "%08x: *timeout*\n", (unsigned int)current );
839 void trace_kill( int exit_code )
841 fprintf( stderr,"%08x: *killed* exit_code=%d\n",
842 (unsigned int)current, exit_code );
845 void trace_reply( struct thread *thread, int type, int pass_fd,
846 struct iovec *vec, int veclen )
848 if (!thread) return;
849 fprintf( stderr, "%08x: %s() = %d",
850 (unsigned int)thread, req_names[thread->last_req], type );
851 if (veclen)
853 fprintf( stderr, " {" );
854 if (dumpers[thread->last_req].dump_reply)
856 dumpers[thread->last_req].dump_reply( vec->iov_base );
857 vec++;
858 veclen--;
860 for (; veclen; veclen--, vec++)
862 unsigned char *ptr = vec->iov_base;
863 int len = vec->iov_len;
864 while (len--) fprintf( stderr, ", %02x", *ptr++ );
866 fprintf( stderr, " }" );
868 if (pass_fd != -1) fprintf( stderr, " fd=%d\n", pass_fd );
869 else fprintf( stderr, "\n" );