int a2_shutdown(struct annotate_two *a2) { int i; cgdb_close(a2->debugger_stdin); a2->debugger_stdin = -1; state_machine_shutdown(a2->sm); commands_shutdown(a2->c); a2_delete_responses(a2); sbfree(a2->responses); a2->responses = NULL; for (i = 0; i < sbcount(a2->client_commands); i++) { struct tgdb_command *tc = a2->client_commands[i]; free(tc->gdb_command); free(tc); } sbfree(a2->client_commands); a2->client_commands = NULL; return 0; }
int pty_pair_destroy(pty_pair_ptr pty_pair) { if (!pty_pair) return -1; cgdb_close(pty_pair->masterfd); cgdb_close(pty_pair->slavefd); if (pty_release(pty_pair->slavename) == -1) { logger_write_pos(logger, __FILE__, __LINE__, "pty_release error"); return -1; } free(pty_pair); return 0; }
/* TODO: Implement shutdown properly */ int a2_shutdown ( void *ctx ) { struct annotate_two *a2 = (struct annotate_two *)ctx; cgdb_close(a2->debugger_stdin); data_shutdown ( a2->data ); state_machine_shutdown ( a2->sm ); commands_shutdown ( a2->c ); globals_shutdown ( a2->g ); return 0; }
int pty_free_process(int *masterfd, char *sname) { cgdb_close(*masterfd); if ( pty_release(sname) == -1 ) { logger_write_pos ( logger, __FILE__, __LINE__, "pty_release error"); return -1; } return 0; }
/* TODO: Implement shutdown properly */ int a2_shutdown(struct annotate_two *a2) { cgdb_close(a2->debugger_stdin); data_shutdown(a2->data); state_machine_shutdown(a2->sm); commands_shutdown(a2->c); tgdb_list_free(a2->client_command_list, tgdb_command_destroy_list_item); tgdb_list_destroy(a2->client_command_list); tgdb_list_free(a2->cur_response_list, tgdb_types_free_command); tgdb_list_destroy(a2->cur_response_list); globals_shutdown(a2->g); return 0; }
int tgdb_shutdown(struct tgdb *tgdb) { tgdb_request_ptr_list::iterator iter = tgdb->command_requests->begin(); for (; iter != tgdb->command_requests->end(); ++iter) { tgdb_request_destroy(*iter); } delete tgdb->command_requests; tgdb->command_requests = 0; annotations_parser_shutdown(tgdb->parser); cgdb_close(tgdb->debugger_stdin); tgdb->debugger_stdin = -1; commands_shutdown(tgdb->c); return 0; }