2 * Server request tracing
4 * Copyright (C) 1999 Alexandre Julliard
14 /* utility functions */
16 static void dump_ints( const int *ptr, int len )
21 fprintf( stderr, "%d", *ptr++ );
22 if (--len) fputc( ',', stderr );
27 static void dump_bytes( const unsigned char *ptr, int len )
32 fprintf( stderr, "%02x", *ptr++ );
33 if (--len) fputc( ',', stderr );
38 /* dumping for functions for requests that have a variable part */
40 static void dump_varargs_select( struct select_request *req )
42 dump_ints( req->handles, req->count );
45 static void dump_varargs_get_apcs( struct get_apcs_request *req )
48 for (i = 0; i < 2 * req->count; i++)
49 fprintf( stderr, "%c%p", i ? ',' : '{', req->apcs[i] );
50 fprintf( stderr, "}" );
53 static void dump_varargs_get_socket_event( struct get_socket_event_request *req )
55 dump_ints( req->errors, FD_MAX_EVENTS );
58 static void dump_varargs_read_process_memory( struct read_process_memory_request *req )
60 int count = MIN( req->len, get_req_size( req->data, sizeof(int) ) );
61 dump_bytes( (unsigned char *)req->data, count * sizeof(int) );
65 typedef void (*dump_func)( const void *req );
67 /* Everything below this line is generated automatically by tools/make_requests */
68 /* ### make_requests begin ### */
70 static void dump_new_process_request( struct new_process_request *req )
72 fprintf( stderr, " inherit=%d,", req->inherit );
73 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
74 fprintf( stderr, " create_flags=%d,", req->create_flags );
75 fprintf( stderr, " start_flags=%d,", req->start_flags );
76 fprintf( stderr, " hstdin=%d,", req->hstdin );
77 fprintf( stderr, " hstdout=%d,", req->hstdout );
78 fprintf( stderr, " hstderr=%d,", req->hstderr );
79 fprintf( stderr, " event=%d,", req->event );
80 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
81 fprintf( stderr, " env_ptr=%p,", req->env_ptr );
82 fprintf( stderr, " cmdline=\"%s\"", req->cmdline );
85 static void dump_new_process_reply( struct new_process_request *req )
87 fprintf( stderr, " pid=%p,", req->pid );
88 fprintf( stderr, " handle=%d", req->handle );
91 static void dump_new_thread_request( struct new_thread_request *req )
93 fprintf( stderr, " pid=%p,", req->pid );
94 fprintf( stderr, " suspend=%d,", req->suspend );
95 fprintf( stderr, " inherit=%d", req->inherit );
98 static void dump_new_thread_reply( struct new_thread_request *req )
100 fprintf( stderr, " tid=%p,", req->tid );
101 fprintf( stderr, " handle=%d", req->handle );
104 static void dump_set_debug_request( struct set_debug_request *req )
106 fprintf( stderr, " level=%d", req->level );
109 static void dump_init_process_request( struct init_process_request *req )
113 static void dump_init_process_reply( struct init_process_request *req )
115 fprintf( stderr, " start_flags=%d,", req->start_flags );
116 fprintf( stderr, " hstdin=%d,", req->hstdin );
117 fprintf( stderr, " hstdout=%d,", req->hstdout );
118 fprintf( stderr, " hstderr=%d,", req->hstderr );
119 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
120 fprintf( stderr, " env_ptr=%p,", req->env_ptr );
121 fprintf( stderr, " cmdline=\"%s\"", req->cmdline );
124 static void dump_init_process_done_request( struct init_process_done_request *req )
126 fprintf( stderr, " dummy=%d", req->dummy );
129 static void dump_init_thread_request( struct init_thread_request *req )
131 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
132 fprintf( stderr, " teb=%p", req->teb );
135 static void dump_init_thread_reply( struct init_thread_request *req )
137 fprintf( stderr, " pid=%p,", req->pid );
138 fprintf( stderr, " tid=%p", req->tid );
141 static void dump_get_thread_buffer_request( struct get_thread_buffer_request *req )
143 fprintf( stderr, " dummy=%d", req->dummy );
146 static void dump_terminate_process_request( struct terminate_process_request *req )
148 fprintf( stderr, " handle=%d,", req->handle );
149 fprintf( stderr, " exit_code=%d", req->exit_code );
152 static void dump_terminate_thread_request( struct terminate_thread_request *req )
154 fprintf( stderr, " handle=%d,", req->handle );
155 fprintf( stderr, " exit_code=%d", req->exit_code );
158 static void dump_get_process_info_request( struct get_process_info_request *req )
160 fprintf( stderr, " handle=%d", req->handle );
163 static void dump_get_process_info_reply( struct get_process_info_request *req )
165 fprintf( stderr, " pid=%p,", req->pid );
166 fprintf( stderr, " exit_code=%d,", req->exit_code );
167 fprintf( stderr, " priority=%d,", req->priority );
168 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
169 fprintf( stderr, " system_affinity=%d", req->system_affinity );
172 static void dump_set_process_info_request( struct set_process_info_request *req )
174 fprintf( stderr, " handle=%d,", req->handle );
175 fprintf( stderr, " mask=%d,", req->mask );
176 fprintf( stderr, " priority=%d,", req->priority );
177 fprintf( stderr, " affinity=%d", req->affinity );
180 static void dump_get_thread_info_request( struct get_thread_info_request *req )
182 fprintf( stderr, " handle=%d", req->handle );
185 static void dump_get_thread_info_reply( struct get_thread_info_request *req )
187 fprintf( stderr, " tid=%p,", req->tid );
188 fprintf( stderr, " exit_code=%d,", req->exit_code );
189 fprintf( stderr, " priority=%d", req->priority );
192 static void dump_set_thread_info_request( struct set_thread_info_request *req )
194 fprintf( stderr, " handle=%d,", req->handle );
195 fprintf( stderr, " mask=%d,", req->mask );
196 fprintf( stderr, " priority=%d,", req->priority );
197 fprintf( stderr, " affinity=%d", req->affinity );
200 static void dump_suspend_thread_request( struct suspend_thread_request *req )
202 fprintf( stderr, " handle=%d", req->handle );
205 static void dump_suspend_thread_reply( struct suspend_thread_request *req )
207 fprintf( stderr, " count=%d", req->count );
210 static void dump_resume_thread_request( struct resume_thread_request *req )
212 fprintf( stderr, " handle=%d", req->handle );
215 static void dump_resume_thread_reply( struct resume_thread_request *req )
217 fprintf( stderr, " count=%d", req->count );
220 static void dump_debugger_request( struct debugger_request *req )
222 fprintf( stderr, " op=%d", req->op );
225 static void dump_queue_apc_request( struct queue_apc_request *req )
227 fprintf( stderr, " handle=%d,", req->handle );
228 fprintf( stderr, " func=%p,", req->func );
229 fprintf( stderr, " param=%p", req->param );
232 static void dump_get_apcs_request( struct get_apcs_request *req )
236 static void dump_get_apcs_reply( struct get_apcs_request *req )
238 fprintf( stderr, " count=%d,", req->count );
239 fprintf( stderr, " apcs=" );
240 dump_varargs_get_apcs( req );
243 static void dump_close_handle_request( struct close_handle_request *req )
245 fprintf( stderr, " handle=%d", req->handle );
248 static void dump_get_handle_info_request( struct get_handle_info_request *req )
250 fprintf( stderr, " handle=%d", req->handle );
253 static void dump_get_handle_info_reply( struct get_handle_info_request *req )
255 fprintf( stderr, " flags=%d", req->flags );
258 static void dump_set_handle_info_request( struct set_handle_info_request *req )
260 fprintf( stderr, " handle=%d,", req->handle );
261 fprintf( stderr, " flags=%d,", req->flags );
262 fprintf( stderr, " mask=%d", req->mask );
265 static void dump_dup_handle_request( struct dup_handle_request *req )
267 fprintf( stderr, " src_process=%d,", req->src_process );
268 fprintf( stderr, " src_handle=%d,", req->src_handle );
269 fprintf( stderr, " dst_process=%d,", req->dst_process );
270 fprintf( stderr, " access=%08x,", req->access );
271 fprintf( stderr, " inherit=%d,", req->inherit );
272 fprintf( stderr, " options=%d", req->options );
275 static void dump_dup_handle_reply( struct dup_handle_request *req )
277 fprintf( stderr, " handle=%d", req->handle );
280 static void dump_open_process_request( struct open_process_request *req )
282 fprintf( stderr, " pid=%p,", req->pid );
283 fprintf( stderr, " access=%08x,", req->access );
284 fprintf( stderr, " inherit=%d", req->inherit );
287 static void dump_open_process_reply( struct open_process_request *req )
289 fprintf( stderr, " handle=%d", req->handle );
292 static void dump_select_request( struct select_request *req )
294 fprintf( stderr, " count=%d,", req->count );
295 fprintf( stderr, " flags=%d,", req->flags );
296 fprintf( stderr, " timeout=%d,", req->timeout );
297 fprintf( stderr, " handles=" );
298 dump_varargs_select( req );
301 static void dump_select_reply( struct select_request *req )
303 fprintf( stderr, " signaled=%d", req->signaled );
306 static void dump_create_event_request( struct create_event_request *req )
308 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
309 fprintf( stderr, " initial_state=%d,", req->initial_state );
310 fprintf( stderr, " inherit=%d,", req->inherit );
311 fprintf( stderr, " name=\"%s\"", req->name );
314 static void dump_create_event_reply( struct create_event_request *req )
316 fprintf( stderr, " handle=%d", req->handle );
319 static void dump_event_op_request( struct event_op_request *req )
321 fprintf( stderr, " handle=%d,", req->handle );
322 fprintf( stderr, " op=%d", req->op );
325 static void dump_open_event_request( struct open_event_request *req )
327 fprintf( stderr, " access=%08x,", req->access );
328 fprintf( stderr, " inherit=%d,", req->inherit );
329 fprintf( stderr, " name=\"%s\"", req->name );
332 static void dump_open_event_reply( struct open_event_request *req )
334 fprintf( stderr, " handle=%d", req->handle );
337 static void dump_create_mutex_request( struct create_mutex_request *req )
339 fprintf( stderr, " owned=%d,", req->owned );
340 fprintf( stderr, " inherit=%d,", req->inherit );
341 fprintf( stderr, " name=\"%s\"", req->name );
344 static void dump_create_mutex_reply( struct create_mutex_request *req )
346 fprintf( stderr, " handle=%d", req->handle );
349 static void dump_release_mutex_request( struct release_mutex_request *req )
351 fprintf( stderr, " handle=%d", req->handle );
354 static void dump_open_mutex_request( struct open_mutex_request *req )
356 fprintf( stderr, " access=%08x,", req->access );
357 fprintf( stderr, " inherit=%d,", req->inherit );
358 fprintf( stderr, " name=\"%s\"", req->name );
361 static void dump_open_mutex_reply( struct open_mutex_request *req )
363 fprintf( stderr, " handle=%d", req->handle );
366 static void dump_create_semaphore_request( struct create_semaphore_request *req )
368 fprintf( stderr, " initial=%08x,", req->initial );
369 fprintf( stderr, " max=%08x,", req->max );
370 fprintf( stderr, " inherit=%d,", req->inherit );
371 fprintf( stderr, " name=\"%s\"", req->name );
374 static void dump_create_semaphore_reply( struct create_semaphore_request *req )
376 fprintf( stderr, " handle=%d", req->handle );
379 static void dump_release_semaphore_request( struct release_semaphore_request *req )
381 fprintf( stderr, " handle=%d,", req->handle );
382 fprintf( stderr, " count=%08x", req->count );
385 static void dump_release_semaphore_reply( struct release_semaphore_request *req )
387 fprintf( stderr, " prev_count=%08x", req->prev_count );
390 static void dump_open_semaphore_request( struct open_semaphore_request *req )
392 fprintf( stderr, " access=%08x,", req->access );
393 fprintf( stderr, " inherit=%d,", req->inherit );
394 fprintf( stderr, " name=\"%s\"", req->name );
397 static void dump_open_semaphore_reply( struct open_semaphore_request *req )
399 fprintf( stderr, " handle=%d", req->handle );
402 static void dump_create_file_request( struct create_file_request *req )
404 fprintf( stderr, " access=%08x,", req->access );
405 fprintf( stderr, " inherit=%d,", req->inherit );
406 fprintf( stderr, " sharing=%08x,", req->sharing );
407 fprintf( stderr, " create=%d,", req->create );
408 fprintf( stderr, " attrs=%08x,", req->attrs );
409 fprintf( stderr, " name=\"%s\"", req->name );
412 static void dump_create_file_reply( struct create_file_request *req )
414 fprintf( stderr, " handle=%d", req->handle );
417 static void dump_alloc_file_handle_request( struct alloc_file_handle_request *req )
419 fprintf( stderr, " access=%08x", req->access );
422 static void dump_alloc_file_handle_reply( struct alloc_file_handle_request *req )
424 fprintf( stderr, " handle=%d", req->handle );
427 static void dump_get_read_fd_request( struct get_read_fd_request *req )
429 fprintf( stderr, " handle=%d", req->handle );
432 static void dump_get_write_fd_request( struct get_write_fd_request *req )
434 fprintf( stderr, " handle=%d", req->handle );
437 static void dump_set_file_pointer_request( struct set_file_pointer_request *req )
439 fprintf( stderr, " handle=%d,", req->handle );
440 fprintf( stderr, " low=%d,", req->low );
441 fprintf( stderr, " high=%d,", req->high );
442 fprintf( stderr, " whence=%d", req->whence );
445 static void dump_set_file_pointer_reply( struct set_file_pointer_request *req )
447 fprintf( stderr, " new_low=%d,", req->new_low );
448 fprintf( stderr, " new_high=%d", req->new_high );
451 static void dump_truncate_file_request( struct truncate_file_request *req )
453 fprintf( stderr, " handle=%d", req->handle );
456 static void dump_set_file_time_request( struct set_file_time_request *req )
458 fprintf( stderr, " handle=%d,", req->handle );
459 fprintf( stderr, " access_time=%ld,", req->access_time );
460 fprintf( stderr, " write_time=%ld", req->write_time );
463 static void dump_flush_file_request( struct flush_file_request *req )
465 fprintf( stderr, " handle=%d", req->handle );
468 static void dump_get_file_info_request( struct get_file_info_request *req )
470 fprintf( stderr, " handle=%d", req->handle );
473 static void dump_get_file_info_reply( struct get_file_info_request *req )
475 fprintf( stderr, " type=%d,", req->type );
476 fprintf( stderr, " attr=%d,", req->attr );
477 fprintf( stderr, " access_time=%ld,", req->access_time );
478 fprintf( stderr, " write_time=%ld,", req->write_time );
479 fprintf( stderr, " size_high=%d,", req->size_high );
480 fprintf( stderr, " size_low=%d,", req->size_low );
481 fprintf( stderr, " links=%d,", req->links );
482 fprintf( stderr, " index_high=%d,", req->index_high );
483 fprintf( stderr, " index_low=%d,", req->index_low );
484 fprintf( stderr, " serial=%08x", req->serial );
487 static void dump_lock_file_request( struct lock_file_request *req )
489 fprintf( stderr, " handle=%d,", req->handle );
490 fprintf( stderr, " offset_low=%08x,", req->offset_low );
491 fprintf( stderr, " offset_high=%08x,", req->offset_high );
492 fprintf( stderr, " count_low=%08x,", req->count_low );
493 fprintf( stderr, " count_high=%08x", req->count_high );
496 static void dump_unlock_file_request( struct unlock_file_request *req )
498 fprintf( stderr, " handle=%d,", req->handle );
499 fprintf( stderr, " offset_low=%08x,", req->offset_low );
500 fprintf( stderr, " offset_high=%08x,", req->offset_high );
501 fprintf( stderr, " count_low=%08x,", req->count_low );
502 fprintf( stderr, " count_high=%08x", req->count_high );
505 static void dump_create_pipe_request( struct create_pipe_request *req )
507 fprintf( stderr, " inherit=%d", req->inherit );
510 static void dump_create_pipe_reply( struct create_pipe_request *req )
512 fprintf( stderr, " handle_read=%d,", req->handle_read );
513 fprintf( stderr, " handle_write=%d", req->handle_write );
516 static void dump_create_socket_request( struct create_socket_request *req )
518 fprintf( stderr, " access=%08x,", req->access );
519 fprintf( stderr, " inherit=%d,", req->inherit );
520 fprintf( stderr, " family=%d,", req->family );
521 fprintf( stderr, " type=%d,", req->type );
522 fprintf( stderr, " protocol=%d", req->protocol );
525 static void dump_create_socket_reply( struct create_socket_request *req )
527 fprintf( stderr, " handle=%d", req->handle );
530 static void dump_accept_socket_request( struct accept_socket_request *req )
532 fprintf( stderr, " lhandle=%d,", req->lhandle );
533 fprintf( stderr, " access=%08x,", req->access );
534 fprintf( stderr, " inherit=%d", req->inherit );
537 static void dump_accept_socket_reply( struct accept_socket_request *req )
539 fprintf( stderr, " handle=%d", req->handle );
542 static void dump_set_socket_event_request( struct set_socket_event_request *req )
544 fprintf( stderr, " handle=%d,", req->handle );
545 fprintf( stderr, " mask=%08x,", req->mask );
546 fprintf( stderr, " event=%d", req->event );
549 static void dump_get_socket_event_request( struct get_socket_event_request *req )
551 fprintf( stderr, " handle=%d,", req->handle );
552 fprintf( stderr, " service=%d,", req->service );
553 fprintf( stderr, " s_event=%d", req->s_event );
556 static void dump_get_socket_event_reply( struct get_socket_event_request *req )
558 fprintf( stderr, " mask=%08x,", req->mask );
559 fprintf( stderr, " pmask=%08x,", req->pmask );
560 fprintf( stderr, " state=%08x,", req->state );
561 fprintf( stderr, " errors=" );
562 dump_varargs_get_socket_event( req );
565 static void dump_enable_socket_event_request( struct enable_socket_event_request *req )
567 fprintf( stderr, " handle=%d,", req->handle );
568 fprintf( stderr, " mask=%08x,", req->mask );
569 fprintf( stderr, " sstate=%08x,", req->sstate );
570 fprintf( stderr, " cstate=%08x", req->cstate );
573 static void dump_alloc_console_request( struct alloc_console_request *req )
575 fprintf( stderr, " access=%08x,", req->access );
576 fprintf( stderr, " inherit=%d", req->inherit );
579 static void dump_alloc_console_reply( struct alloc_console_request *req )
581 fprintf( stderr, " handle_in=%d,", req->handle_in );
582 fprintf( stderr, " handle_out=%d", req->handle_out );
585 static void dump_free_console_request( struct free_console_request *req )
587 fprintf( stderr, " dummy=%d", req->dummy );
590 static void dump_open_console_request( struct open_console_request *req )
592 fprintf( stderr, " output=%d,", req->output );
593 fprintf( stderr, " access=%08x,", req->access );
594 fprintf( stderr, " inherit=%d", req->inherit );
597 static void dump_open_console_reply( struct open_console_request *req )
599 fprintf( stderr, " handle=%d", req->handle );
602 static void dump_set_console_fd_request( struct set_console_fd_request *req )
604 fprintf( stderr, " handle=%d,", req->handle );
605 fprintf( stderr, " file_handle=%d,", req->file_handle );
606 fprintf( stderr, " pid=%d", req->pid );
609 static void dump_get_console_mode_request( struct get_console_mode_request *req )
611 fprintf( stderr, " handle=%d", req->handle );
614 static void dump_get_console_mode_reply( struct get_console_mode_request *req )
616 fprintf( stderr, " mode=%d", req->mode );
619 static void dump_set_console_mode_request( struct set_console_mode_request *req )
621 fprintf( stderr, " handle=%d,", req->handle );
622 fprintf( stderr, " mode=%d", req->mode );
625 static void dump_set_console_info_request( struct set_console_info_request *req )
627 fprintf( stderr, " handle=%d,", req->handle );
628 fprintf( stderr, " mask=%d,", req->mask );
629 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
630 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
631 fprintf( stderr, " title=\"%s\"", req->title );
634 static void dump_get_console_info_request( struct get_console_info_request *req )
636 fprintf( stderr, " handle=%d", req->handle );
639 static void dump_get_console_info_reply( struct get_console_info_request *req )
641 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
642 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
643 fprintf( stderr, " pid=%d,", req->pid );
644 fprintf( stderr, " title=\"%s\"", req->title );
647 static void dump_write_console_input_request( struct write_console_input_request *req )
649 fprintf( stderr, " handle=%d,", req->handle );
650 fprintf( stderr, " count=%d", req->count );
653 static void dump_write_console_input_reply( struct write_console_input_request *req )
655 fprintf( stderr, " written=%d", req->written );
658 static void dump_read_console_input_request( struct read_console_input_request *req )
660 fprintf( stderr, " handle=%d,", req->handle );
661 fprintf( stderr, " count=%d,", req->count );
662 fprintf( stderr, " flush=%d", req->flush );
665 static void dump_read_console_input_reply( struct read_console_input_request *req )
667 fprintf( stderr, " read=%d", req->read );
670 static void dump_create_change_notification_request( struct create_change_notification_request *req )
672 fprintf( stderr, " subtree=%d,", req->subtree );
673 fprintf( stderr, " filter=%d", req->filter );
676 static void dump_create_change_notification_reply( struct create_change_notification_request *req )
678 fprintf( stderr, " handle=%d", req->handle );
681 static void dump_create_mapping_request( struct create_mapping_request *req )
683 fprintf( stderr, " size_high=%d,", req->size_high );
684 fprintf( stderr, " size_low=%d,", req->size_low );
685 fprintf( stderr, " protect=%d,", req->protect );
686 fprintf( stderr, " inherit=%d,", req->inherit );
687 fprintf( stderr, " file_handle=%d,", req->file_handle );
688 fprintf( stderr, " name=\"%s\"", req->name );
691 static void dump_create_mapping_reply( struct create_mapping_request *req )
693 fprintf( stderr, " handle=%d", req->handle );
696 static void dump_open_mapping_request( struct open_mapping_request *req )
698 fprintf( stderr, " access=%08x,", req->access );
699 fprintf( stderr, " inherit=%d,", req->inherit );
700 fprintf( stderr, " name=\"%s\"", req->name );
703 static void dump_open_mapping_reply( struct open_mapping_request *req )
705 fprintf( stderr, " handle=%d", req->handle );
708 static void dump_get_mapping_info_request( struct get_mapping_info_request *req )
710 fprintf( stderr, " handle=%d", req->handle );
713 static void dump_get_mapping_info_reply( struct get_mapping_info_request *req )
715 fprintf( stderr, " size_high=%d,", req->size_high );
716 fprintf( stderr, " size_low=%d,", req->size_low );
717 fprintf( stderr, " protect=%d", req->protect );
720 static void dump_create_device_request( struct create_device_request *req )
722 fprintf( stderr, " access=%08x,", req->access );
723 fprintf( stderr, " inherit=%d,", req->inherit );
724 fprintf( stderr, " id=%d", req->id );
727 static void dump_create_device_reply( struct create_device_request *req )
729 fprintf( stderr, " handle=%d", req->handle );
732 static void dump_create_snapshot_request( struct create_snapshot_request *req )
734 fprintf( stderr, " inherit=%d,", req->inherit );
735 fprintf( stderr, " flags=%d", req->flags );
738 static void dump_create_snapshot_reply( struct create_snapshot_request *req )
740 fprintf( stderr, " handle=%d", req->handle );
743 static void dump_next_process_request( struct next_process_request *req )
745 fprintf( stderr, " handle=%d,", req->handle );
746 fprintf( stderr, " reset=%d", req->reset );
749 static void dump_next_process_reply( struct next_process_request *req )
751 fprintf( stderr, " pid=%p,", req->pid );
752 fprintf( stderr, " threads=%d,", req->threads );
753 fprintf( stderr, " priority=%d", req->priority );
756 static void dump_wait_debug_event_request( struct wait_debug_event_request *req )
758 fprintf( stderr, " timeout=%d", req->timeout );
761 static void dump_wait_debug_event_reply( struct wait_debug_event_request *req )
763 fprintf( stderr, " code=%d,", req->code );
764 fprintf( stderr, " pid=%p,", req->pid );
765 fprintf( stderr, " tid=%p", req->tid );
768 static void dump_send_debug_event_request( struct send_debug_event_request *req )
770 fprintf( stderr, " code=%d", req->code );
773 static void dump_send_debug_event_reply( struct send_debug_event_request *req )
775 fprintf( stderr, " status=%d", req->status );
778 static void dump_continue_debug_event_request( struct continue_debug_event_request *req )
780 fprintf( stderr, " pid=%p,", req->pid );
781 fprintf( stderr, " tid=%p,", req->tid );
782 fprintf( stderr, " status=%d", req->status );
785 static void dump_debug_process_request( struct debug_process_request *req )
787 fprintf( stderr, " pid=%p", req->pid );
790 static void dump_read_process_memory_request( struct read_process_memory_request *req )
792 fprintf( stderr, " handle=%d,", req->handle );
793 fprintf( stderr, " addr=%p,", req->addr );
794 fprintf( stderr, " len=%d", req->len );
797 static void dump_read_process_memory_reply( struct read_process_memory_request *req )
799 fprintf( stderr, " data=" );
800 dump_varargs_read_process_memory( req );
803 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
804 (dump_func)dump_new_process_request,
805 (dump_func)dump_new_thread_request,
806 (dump_func)dump_set_debug_request,
807 (dump_func)dump_init_process_request,
808 (dump_func)dump_init_process_done_request,
809 (dump_func)dump_init_thread_request,
810 (dump_func)dump_get_thread_buffer_request,
811 (dump_func)dump_terminate_process_request,
812 (dump_func)dump_terminate_thread_request,
813 (dump_func)dump_get_process_info_request,
814 (dump_func)dump_set_process_info_request,
815 (dump_func)dump_get_thread_info_request,
816 (dump_func)dump_set_thread_info_request,
817 (dump_func)dump_suspend_thread_request,
818 (dump_func)dump_resume_thread_request,
819 (dump_func)dump_debugger_request,
820 (dump_func)dump_queue_apc_request,
821 (dump_func)dump_get_apcs_request,
822 (dump_func)dump_close_handle_request,
823 (dump_func)dump_get_handle_info_request,
824 (dump_func)dump_set_handle_info_request,
825 (dump_func)dump_dup_handle_request,
826 (dump_func)dump_open_process_request,
827 (dump_func)dump_select_request,
828 (dump_func)dump_create_event_request,
829 (dump_func)dump_event_op_request,
830 (dump_func)dump_open_event_request,
831 (dump_func)dump_create_mutex_request,
832 (dump_func)dump_release_mutex_request,
833 (dump_func)dump_open_mutex_request,
834 (dump_func)dump_create_semaphore_request,
835 (dump_func)dump_release_semaphore_request,
836 (dump_func)dump_open_semaphore_request,
837 (dump_func)dump_create_file_request,
838 (dump_func)dump_alloc_file_handle_request,
839 (dump_func)dump_get_read_fd_request,
840 (dump_func)dump_get_write_fd_request,
841 (dump_func)dump_set_file_pointer_request,
842 (dump_func)dump_truncate_file_request,
843 (dump_func)dump_set_file_time_request,
844 (dump_func)dump_flush_file_request,
845 (dump_func)dump_get_file_info_request,
846 (dump_func)dump_lock_file_request,
847 (dump_func)dump_unlock_file_request,
848 (dump_func)dump_create_pipe_request,
849 (dump_func)dump_create_socket_request,
850 (dump_func)dump_accept_socket_request,
851 (dump_func)dump_set_socket_event_request,
852 (dump_func)dump_get_socket_event_request,
853 (dump_func)dump_enable_socket_event_request,
854 (dump_func)dump_alloc_console_request,
855 (dump_func)dump_free_console_request,
856 (dump_func)dump_open_console_request,
857 (dump_func)dump_set_console_fd_request,
858 (dump_func)dump_get_console_mode_request,
859 (dump_func)dump_set_console_mode_request,
860 (dump_func)dump_set_console_info_request,
861 (dump_func)dump_get_console_info_request,
862 (dump_func)dump_write_console_input_request,
863 (dump_func)dump_read_console_input_request,
864 (dump_func)dump_create_change_notification_request,
865 (dump_func)dump_create_mapping_request,
866 (dump_func)dump_open_mapping_request,
867 (dump_func)dump_get_mapping_info_request,
868 (dump_func)dump_create_device_request,
869 (dump_func)dump_create_snapshot_request,
870 (dump_func)dump_next_process_request,
871 (dump_func)dump_wait_debug_event_request,
872 (dump_func)dump_send_debug_event_request,
873 (dump_func)dump_continue_debug_event_request,
874 (dump_func)dump_debug_process_request,
875 (dump_func)dump_read_process_memory_request,
878 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
879 (dump_func)dump_new_process_reply,
880 (dump_func)dump_new_thread_reply,
882 (dump_func)dump_init_process_reply,
884 (dump_func)dump_init_thread_reply,
888 (dump_func)dump_get_process_info_reply,
890 (dump_func)dump_get_thread_info_reply,
892 (dump_func)dump_suspend_thread_reply,
893 (dump_func)dump_resume_thread_reply,
896 (dump_func)dump_get_apcs_reply,
898 (dump_func)dump_get_handle_info_reply,
900 (dump_func)dump_dup_handle_reply,
901 (dump_func)dump_open_process_reply,
902 (dump_func)dump_select_reply,
903 (dump_func)dump_create_event_reply,
905 (dump_func)dump_open_event_reply,
906 (dump_func)dump_create_mutex_reply,
908 (dump_func)dump_open_mutex_reply,
909 (dump_func)dump_create_semaphore_reply,
910 (dump_func)dump_release_semaphore_reply,
911 (dump_func)dump_open_semaphore_reply,
912 (dump_func)dump_create_file_reply,
913 (dump_func)dump_alloc_file_handle_reply,
916 (dump_func)dump_set_file_pointer_reply,
920 (dump_func)dump_get_file_info_reply,
923 (dump_func)dump_create_pipe_reply,
924 (dump_func)dump_create_socket_reply,
925 (dump_func)dump_accept_socket_reply,
927 (dump_func)dump_get_socket_event_reply,
929 (dump_func)dump_alloc_console_reply,
931 (dump_func)dump_open_console_reply,
933 (dump_func)dump_get_console_mode_reply,
936 (dump_func)dump_get_console_info_reply,
937 (dump_func)dump_write_console_input_reply,
938 (dump_func)dump_read_console_input_reply,
939 (dump_func)dump_create_change_notification_reply,
940 (dump_func)dump_create_mapping_reply,
941 (dump_func)dump_open_mapping_reply,
942 (dump_func)dump_get_mapping_info_reply,
943 (dump_func)dump_create_device_reply,
944 (dump_func)dump_create_snapshot_reply,
945 (dump_func)dump_next_process_reply,
946 (dump_func)dump_wait_debug_event_reply,
947 (dump_func)dump_send_debug_event_reply,
950 (dump_func)dump_read_process_memory_reply,
953 static const char * const req_names[REQ_NB_REQUESTS] = {
1003 "enable_socket_event",
1012 "write_console_input",
1013 "read_console_input",
1014 "create_change_notification",
1023 "continue_debug_event",
1025 "read_process_memory",
1028 /* ### make_requests end ### */
1029 /* Everything above this line is generated automatically by tools/make_requests */
1031 void trace_request( enum request req, int fd )
1033 current->last_req = req;
1034 if (req < REQ_NB_REQUESTS)
1036 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
1037 req_dumpers[req]( current->buffer );
1040 fprintf( stderr, "%08x: %d(", (unsigned int)current, req );
1041 if (fd != -1) fprintf( stderr, " ) fd=%d\n", fd );
1042 else fprintf( stderr, " )\n" );
1045 void trace_timeout(void)
1047 fprintf( stderr, "%08x: *timeout*\n", (unsigned int)current );
1050 void trace_kill( int exit_code )
1052 fprintf( stderr,"%08x: *killed* exit_code=%d\n",
1053 (unsigned int)current, exit_code );
1056 void trace_reply( struct thread *thread, unsigned int res, int pass_fd )
1058 fprintf( stderr, "%08x: %s() = %d",
1059 (unsigned int)thread, req_names[thread->last_req], res );
1060 if (reply_dumpers[thread->last_req])
1062 fprintf( stderr, " {" );
1063 reply_dumpers[thread->last_req]( thread->buffer );
1064 fprintf( stderr, " }" );
1066 if (pass_fd != -1) fprintf( stderr, " fd=%d\n", pass_fd );
1067 else fprintf( stderr, "\n" );