From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15755 invoked by alias); 17 Mar 2004 23:47:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15742 invoked from network); 17 Mar 2004 23:47:20 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sources.redhat.com with SMTP; 17 Mar 2004 23:47:20 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id i2HNlKiS000280 for ; Wed, 17 Mar 2004 15:47:20 -0800 (PST) Received: from relay2.apple.com (relay2.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.6) with ESMTP id ; Wed, 17 Mar 2004 15:47:20 -0800 Received: from [17.201.22.21] (moleja.apple.com [17.201.22.21]) by relay2.apple.com (8.12.11/8.12.11) with ESMTP id i2HNlIVB019495; Wed, 17 Mar 2004 23:47:19 GMT Mime-Version: 1.0 (Apple Message framework v613) To: Andrew Cagney Message-ID: <6994FFF8-786D-11D8-9229-000393D457E2@apple.com> Content-Type: multipart/mixed; boundary=Apple-Mail-2-328301148 Cc: gdb-patches@sources.redhat.com Subject: RFC patch mi-cmds.c table format (pedantic) From: Jason Molenda Date: Wed, 17 Mar 2004 23:47:00 -0000 X-SW-Source: 2004-03.o/txt/msg00417.txt Message-ID: <20040317234700.Ethq2tFdqOwguobWpYq1Q_0qrCeuTC6Om1EWKzlLUcM@z> --Apple-Mail-2-328301148 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Content-length: 1218 Hi Andrew, in this change: http://sources.redhat.com/ml/gdb-patches/2003-08/msg00052.html the mi-cmds table changed from this format: {"break-info", "info break %s", 0}, {"break-insert", 0, 0, mi_cmd_break_insert}, to this format: { "break-info", { "info break", 1 }, NULL, NULL }, { "break-insert", { NULL, 0 }, 0, mi_cmd_break_insert}, As you can see here, the use of 0 vs NULL is inconsistent, and the spacing on the close parens on the last arg is inconsistent. The implied initialization of 0 is also used in many places. All of this is valid, but it could be a bit more consistent. So instead of - { "break-insert", { NULL, 0 }, 0, mi_cmd_break_insert}, + { "break-insert", { NULL, 0 }, NULL, mi_cmd_break_insert}, - { "exec-step", { NULL, 0 }, mi_cmd_exec_step}, + { "exec-step", { NULL, 0 }, mi_cmd_exec_step, NULL}, - { NULL, } + { NULL, { NULL, 0 }, NULL, NULL} I didn't address the space before the closing } on each line because that would have bloated this pointless patch even more :-), but I thought I'd mention it. Andrew, if you think this is worth of submitting for real I'll run it through the testsuite to be sure it's OK. It compiles without warnings. J --Apple-Mail-2-328301148 Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0644; name="pa.txt" Content-Disposition: attachment; filename=pa.txt Content-length: 10390 Index: mi-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v retrieving revision 1.14 diff -u -p -r1.14 mi-cmds.c --- mi-cmds.c 4 Aug 2003 23:18:50 -0000 1.14 +++ mi-cmds.c 17 Mar 2004 23:42:00 -0000 @@ -42,56 +42,56 @@ struct mi_cmd mi_cmds[] = { "break-disable", { "disable breakpoint", 1 }, NULL, NULL }, { "break-enable", { "enable breakpoint", 1 }, NULL, NULL }, { "break-info", { "info break", 1 }, NULL, NULL }, - { "break-insert", { NULL, 0 }, 0, mi_cmd_break_insert}, + { "break-insert", { NULL, 0 }, NULL, mi_cmd_break_insert}, { "break-list", { "info break", }, NULL, NULL }, - { "break-watch", { NULL, 0 }, 0, mi_cmd_break_watch}, - { "data-disassemble", { NULL, 0 }, 0, mi_cmd_disassemble}, - { "data-evaluate-expression", { NULL, 0 }, 0, mi_cmd_data_evaluate_expression}, - { "data-list-changed-registers", { NULL, 0 }, 0, mi_cmd_data_list_changed_registers}, - { "data-list-register-names", { NULL, 0 }, 0, mi_cmd_data_list_register_names}, - { "data-list-register-values", { NULL, 0 }, 0, mi_cmd_data_list_register_values}, - { "data-read-memory", { NULL, 0 }, 0, mi_cmd_data_read_memory}, - { "data-write-memory", { NULL, 0 }, 0, mi_cmd_data_write_memory}, - { "data-write-register-values", { NULL, 0 }, 0, mi_cmd_data_write_register_values}, + { "break-watch", { NULL, 0 }, NULL, mi_cmd_break_watch}, + { "data-disassemble", { NULL, 0 }, NULL, mi_cmd_disassemble}, + { "data-evaluate-expression", { NULL, 0 }, NULL, mi_cmd_data_evaluate_expression}, + { "data-list-changed-registers", { NULL, 0 }, NULL, mi_cmd_data_list_changed_registers}, + { "data-list-register-names", { NULL, 0 }, NULL, mi_cmd_data_list_register_names}, + { "data-list-register-values", { NULL, 0 }, NULL, mi_cmd_data_list_register_values}, + { "data-read-memory", { NULL, 0 }, NULL, mi_cmd_data_read_memory}, + { "data-write-memory", { NULL, 0 }, NULL, mi_cmd_data_write_memory}, + { "data-write-register-values", { NULL, 0 }, NULL, mi_cmd_data_write_register_values}, { "display-delete", { NULL, 0 }, NULL, NULL }, { "display-disable", { NULL, 0 }, NULL, NULL }, { "display-enable", { NULL, 0 }, NULL, NULL }, { "display-insert", { NULL, 0 }, NULL, NULL }, { "display-list", { NULL, 0 }, NULL, NULL }, - { "environment-cd", { NULL, 0 }, 0, mi_cmd_env_cd}, - { "environment-directory", { NULL, 0 }, 0, mi_cmd_env_dir}, - { "environment-path", { NULL, 0 }, 0, mi_cmd_env_path}, - { "environment-pwd", { NULL, 0 }, 0, mi_cmd_env_pwd}, + { "environment-cd", { NULL, 0 }, NULL, mi_cmd_env_cd}, + { "environment-directory", { NULL, 0 }, NULL, mi_cmd_env_dir}, + { "environment-path", { NULL, 0 }, NULL, mi_cmd_env_path}, + { "environment-pwd", { NULL, 0 }, NULL, mi_cmd_env_pwd}, { "exec-abort", { NULL, 0 }, NULL, NULL }, { "exec-arguments", { "set args", 1 }, NULL, NULL }, - { "exec-continue", { NULL, 0 }, mi_cmd_exec_continue}, - { "exec-finish", { NULL, 0 }, mi_cmd_exec_finish}, - { "exec-interrupt", { NULL, 0 }, mi_cmd_exec_interrupt}, - { "exec-next", { NULL, 0 }, mi_cmd_exec_next}, - { "exec-next-instruction", { NULL, 0 }, mi_cmd_exec_next_instruction}, - { "exec-return", { NULL, 0 }, mi_cmd_exec_return}, - { "exec-run", { NULL, 0 }, mi_cmd_exec_run}, + { "exec-continue", { NULL, 0 }, mi_cmd_exec_continue, NULL}, + { "exec-finish", { NULL, 0 }, mi_cmd_exec_finish, NULL}, + { "exec-interrupt", { NULL, 0 }, mi_cmd_exec_interrupt, NULL}, + { "exec-next", { NULL, 0 }, mi_cmd_exec_next, NULL}, + { "exec-next-instruction", { NULL, 0 }, mi_cmd_exec_next_instruction, NULL}, + { "exec-return", { NULL, 0 }, mi_cmd_exec_return, NULL}, + { "exec-run", { NULL, 0 }, mi_cmd_exec_run, NULL}, { "exec-show-arguments", { NULL, 0 }, NULL, NULL }, { "exec-signal", { NULL, 0 }, NULL, NULL }, - { "exec-step", { NULL, 0 }, mi_cmd_exec_step}, - { "exec-step-instruction", { NULL, 0 }, mi_cmd_exec_step_instruction}, - { "exec-until", { NULL, 0 }, mi_cmd_exec_until}, + { "exec-step", { NULL, 0 }, mi_cmd_exec_step, NULL}, + { "exec-step-instruction", { NULL, 0 }, mi_cmd_exec_step_instruction, NULL}, + { "exec-until", { NULL, 0 }, mi_cmd_exec_until, NULL}, { "file-clear", { NULL, 0 }, NULL, NULL }, { "file-exec-and-symbols", { "file", 1 }, NULL, NULL }, { "file-exec-file", { "exec-file", 1 }, NULL, NULL }, { "file-list-exec-sections", { NULL, 0 }, NULL, NULL }, - { "file-list-exec-source-file", { NULL, 0 }, 0, mi_cmd_file_list_exec_source_file}, + { "file-list-exec-source-file", { NULL, 0 }, NULL, mi_cmd_file_list_exec_source_file}, { "file-list-exec-source-files", { NULL, 0 }, NULL, NULL }, { "file-list-shared-libraries", { NULL, 0 }, NULL, NULL }, { "file-list-symbol-files", { NULL, 0 }, NULL, NULL }, { "file-symbol-file", { "symbol-file", 1 }, NULL, NULL }, { "gdb-complete", { NULL, 0 }, NULL, NULL }, - { "gdb-exit", { NULL, 0 }, 0, mi_cmd_gdb_exit}, + { "gdb-exit", { NULL, 0 }, NULL, mi_cmd_gdb_exit}, { "gdb-set", { "set", 1 }, NULL, NULL }, { "gdb-show", { "show", 1 }, NULL, NULL }, { "gdb-source", { NULL, 0 }, NULL, NULL }, - { "gdb-version", { "show version", 0 }, 0 }, - { "interpreter-exec", { NULL, 0 }, 0, mi_cmd_interpreter_exec}, + { "gdb-version", { "show version", 0 }, NULL, NULL }, + { "interpreter-exec", { NULL, 0 }, NULL, mi_cmd_interpreter_exec}, { "kod-info", { NULL, 0 }, NULL, NULL }, { "kod-list", { NULL, 0 }, NULL, NULL }, { "kod-list-object-types", { NULL, 0 }, NULL, NULL }, @@ -106,38 +106,38 @@ struct mi_cmd mi_cmds[] = { "signal-handle", { NULL, 0 }, NULL, NULL }, { "signal-list-handle-actions", { NULL, 0 }, NULL, NULL }, { "signal-list-signal-types", { NULL, 0 }, NULL, NULL }, - { "stack-info-depth", { NULL, 0 }, 0, mi_cmd_stack_info_depth}, + { "stack-info-depth", { NULL, 0 }, NULL, mi_cmd_stack_info_depth}, { "stack-info-frame", { NULL, 0 }, NULL, NULL }, - { "stack-list-arguments", { NULL, 0 }, 0, mi_cmd_stack_list_args}, + { "stack-list-arguments", { NULL, 0 }, NULL, mi_cmd_stack_list_args}, { "stack-list-exception-handlers", { NULL, 0 }, NULL, NULL }, - { "stack-list-frames", { NULL, 0 }, 0, mi_cmd_stack_list_frames}, - { "stack-list-locals", { NULL, 0 }, 0, mi_cmd_stack_list_locals}, - { "stack-select-frame", { NULL, 0 }, 0, mi_cmd_stack_select_frame}, + { "stack-list-frames", { NULL, 0 }, NULL, mi_cmd_stack_list_frames}, + { "stack-list-locals", { NULL, 0 }, NULL, mi_cmd_stack_list_locals}, + { "stack-select-frame", { NULL, 0 }, NULL, mi_cmd_stack_select_frame}, { "symbol-info-address", { NULL, 0 }, NULL, NULL }, { "symbol-info-file", { NULL, 0 }, NULL, NULL }, { "symbol-info-function", { NULL, 0 }, NULL, NULL }, { "symbol-info-line", { NULL, 0 }, NULL, NULL }, { "symbol-info-symbol", { NULL, 0 }, NULL, NULL }, { "symbol-list-functions", { NULL, 0 }, NULL, NULL }, - { "symbol-list-lines", { NULL, 0 }, 0, mi_cmd_symbol_list_lines}, + { "symbol-list-lines", { NULL, 0 }, NULL, mi_cmd_symbol_list_lines}, { "symbol-list-types", { NULL, 0 }, NULL, NULL }, { "symbol-list-variables", { NULL, 0 }, NULL, NULL }, { "symbol-locate", { NULL, 0 }, NULL, NULL }, { "symbol-type", { NULL, 0 }, NULL, NULL }, { "target-attach", { NULL, 0 }, NULL, NULL }, { "target-compare-sections", { NULL, 0 }, NULL, NULL }, - { "target-detach", { "detach", 0 }, 0 }, - { "target-disconnect", { "disconnect", 0 }, 0 }, - { "target-download", { NULL, 0 }, mi_cmd_target_download}, + { "target-detach", { "detach", 0 }, NULL, NULL }, + { "target-disconnect", { "disconnect", 0 }, NULL, NULL }, + { "target-download", { NULL, 0 }, mi_cmd_target_download, NULL}, { "target-exec-status", { NULL, 0 }, NULL, NULL }, { "target-list-available-targets", { NULL, 0 }, NULL, NULL }, { "target-list-current-targets", { NULL, 0 }, NULL, NULL }, { "target-list-parameters", { NULL, 0 }, NULL, NULL }, - { "target-select", { NULL, 0 }, mi_cmd_target_select}, + { "target-select", { NULL, 0 }, mi_cmd_target_select, NULL}, { "thread-info", { NULL, 0 }, NULL, NULL }, { "thread-list-all-threads", { NULL, 0 }, NULL, NULL }, - { "thread-list-ids", { NULL, 0 }, 0, mi_cmd_thread_list_ids}, - { "thread-select", { NULL, 0 }, 0, mi_cmd_thread_select}, + { "thread-list-ids", { NULL, 0 }, NULL, mi_cmd_thread_list_ids}, + { "thread-select", { NULL, 0 }, NULL, mi_cmd_thread_select}, { "trace-actions", { NULL, 0 }, NULL, NULL }, { "trace-delete", { NULL, 0 }, NULL, NULL }, { "trace-disable", { NULL, 0 }, NULL, NULL }, @@ -153,19 +153,19 @@ struct mi_cmd mi_cmds[] = { "trace-save", { NULL, 0 }, NULL, NULL }, { "trace-start", { NULL, 0 }, NULL, NULL }, { "trace-stop", { NULL, 0 }, NULL, NULL }, - { "var-assign", { NULL, 0 }, 0, mi_cmd_var_assign}, - { "var-create", { NULL, 0 }, 0, mi_cmd_var_create}, - { "var-delete", { NULL, 0 }, 0, mi_cmd_var_delete}, - { "var-evaluate-expression", { NULL, 0 }, 0, mi_cmd_var_evaluate_expression}, - { "var-info-expression", { NULL, 0 }, 0, mi_cmd_var_info_expression}, - { "var-info-num-children", { NULL, 0 }, 0, mi_cmd_var_info_num_children}, + { "var-assign", { NULL, 0 }, NULL, mi_cmd_var_assign}, + { "var-create", { NULL, 0 }, NULL, mi_cmd_var_create}, + { "var-delete", { NULL, 0 }, NULL, mi_cmd_var_delete}, + { "var-evaluate-expression", { NULL, 0 }, NULL, mi_cmd_var_evaluate_expression}, + { "var-info-expression", { NULL, 0 }, NULL, mi_cmd_var_info_expression}, + { "var-info-num-children", { NULL, 0 }, NULL, mi_cmd_var_info_num_children}, { "var-info-type", { NULL, 0 }, 0, mi_cmd_var_info_type}, - { "var-list-children", { NULL, 0 }, 0, mi_cmd_var_list_children}, - { "var-set-format", { NULL, 0 }, 0, mi_cmd_var_set_format}, - { "var-show-attributes", { NULL, 0 }, 0, mi_cmd_var_show_attributes}, - { "var-show-format", { NULL, 0 }, 0, mi_cmd_var_show_format}, - { "var-update", { NULL, 0 }, 0, mi_cmd_var_update}, - { NULL, } + { "var-list-children", { NULL, 0 }, NULL, mi_cmd_var_list_children}, + { "var-set-format", { NULL, 0 }, NULL, mi_cmd_var_set_format}, + { "var-show-attributes", { NULL, 0 }, NULL, mi_cmd_var_show_attributes}, + { "var-show-format", { NULL, 0 }, NULL, mi_cmd_var_show_format}, + { "var-update", { NULL, 0 }, NULL, mi_cmd_var_update}, + { NULL, { NULL, 0 }, NULL, NULL} }; /* Pointer to the mi command table (built at run time) */ --Apple-Mail-2-328301148--