* RFC patch mi-cmds.c table format (pedantic)
@ 2004-03-19 0:09 Jason Molenda
2004-03-17 23:47 ` Jason Molenda
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Jason Molenda @ 2004-03-19 0:09 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]
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
[-- Attachment #2: pa.txt --]
[-- Type: text/plain, Size: 10390 bytes --]
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) */
^ permalink raw reply [flat|nested] 10+ messages in thread* RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 RFC patch mi-cmds.c table format (pedantic) Jason Molenda @ 2004-03-17 23:47 ` Jason Molenda 2004-03-19 0:09 ` Andrew Cagney 2004-03-19 0:09 ` Eli Zaretskii 2 siblings, 0 replies; 10+ messages in thread From: Jason Molenda @ 2004-03-17 23:47 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches [-- Attachment #1: Type: text/plain, Size: 1218 bytes --] 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 [-- Attachment #2: pa.txt --] [-- Type: text/plain, Size: 10390 bytes --] 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) */ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 RFC patch mi-cmds.c table format (pedantic) Jason Molenda 2004-03-17 23:47 ` Jason Molenda @ 2004-03-19 0:09 ` Andrew Cagney 2004-03-19 0:34 ` Jason Molenda 2004-03-19 0:09 ` Eli Zaretskii 2 siblings, 1 reply; 10+ messages in thread From: Andrew Cagney @ 2004-03-19 0:09 UTC (permalink / raw) To: Jason Molenda; +Cc: gdb-patches First, have a look at: http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=496 > 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, That's cos it was converted using an emacs macro. > 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} ok, but perhaps don't bother with the trailing initializers. Should I ask what motived this? Andrew ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 ` Andrew Cagney @ 2004-03-19 0:34 ` Jason Molenda 2004-03-19 15:12 ` Andrew Cagney 0 siblings, 1 reply; 10+ messages in thread From: Jason Molenda @ 2004-03-19 0:34 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches On Mar 18, 2004, at 11:55 AM, Andrew Cagney wrote: > First, have a look at: > http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit- > trail&database=gdb&pr=496 Ah, I hadn't seen that. How do you envision the cli-mapped mi commands working (e.g. -gdb-set), where files in the gdb/ directory are registering the commands? >> 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, > > That's cos it was converted using an emacs macro. Emacs? Ah, well, I think we can all see the problem right there. :-) >> ok, but perhaps don't bother with the trailing initializers. OK I'll come up with a real/tested patch. The trailing initializers -- you don't mean this kind of change, do you? >> - { "exec-step", { NULL, 0 }, mi_cmd_exec_step}, >> + { "exec-step", { NULL, 0 }, mi_cmd_exec_step, NULL}, I think you were talking about the final NULL entry. > Should I ask what motived this? Our GUI guys asked for -exec-abort to be implemented so I had cause to look at our tasty-fresh-mid-merge sources for the first time, where we're just picking up FSF gdb changes from the last year or so. J ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:34 ` Jason Molenda @ 2004-03-19 15:12 ` Andrew Cagney 0 siblings, 0 replies; 10+ messages in thread From: Andrew Cagney @ 2004-03-19 15:12 UTC (permalink / raw) To: Jason Molenda; +Cc: gdb-patches > > On Mar 18, 2004, at 11:55 AM, Andrew Cagney wrote: > >> First, have a look at: >> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit- trail&database=gdb&pr=496 > > > Ah, I hadn't seen that. > > How do you envision the cli-mapped mi commands working (e.g. -gdb-set), where files in the gdb/ directory are registering the commands? There shouldn't be cli-mapped mi commands. Both the MI and CLI should share a common framework. However, in the mean time, I guess such a table should be pump-primed with all the cli-mapped mi entries. > OK I'll come up with a real/tested patch. The trailing initializers -- you don't mean this kind of change, do you? > >>> - { "exec-step", { NULL, 0 }, mi_cmd_exec_step}, >>> + { "exec-step", { NULL, 0 }, mi_cmd_exec_step, NULL}, > > > I think you were talking about the final NULL entry. Skip them as well, I don't see the benefit. Andrew ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 RFC patch mi-cmds.c table format (pedantic) Jason Molenda 2004-03-17 23:47 ` Jason Molenda 2004-03-19 0:09 ` Andrew Cagney @ 2004-03-19 0:09 ` Eli Zaretskii 2004-03-18 5:53 ` Eli Zaretskii 2004-03-19 0:09 ` Jason Molenda 2 siblings, 2 replies; 10+ messages in thread From: Eli Zaretskii @ 2004-03-19 0:09 UTC (permalink / raw) To: Jason Molenda; +Cc: cagney, gdb-patches > From: Jason Molenda <jmolenda@apple.com> > Date: Wed, 17 Mar 2004 15:47:12 -0800 > > As you can see here, the use of 0 vs NULL is inconsistent, and the=20 > spacing on the close parens on the last arg is inconsistent. The=20 > implied initialization of 0 is also used in many places. All of this=20 > 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} Don't these changes require changes to the GDB/MI documentation in gdb.texinfo? IIRC, there are examples there to what each command outputs. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 ` Eli Zaretskii @ 2004-03-18 5:53 ` Eli Zaretskii 2004-03-19 0:09 ` Jason Molenda 1 sibling, 0 replies; 10+ messages in thread From: Eli Zaretskii @ 2004-03-18 5:53 UTC (permalink / raw) To: Jason Molenda; +Cc: cagney, gdb-patches > From: Jason Molenda <jmolenda@apple.com> > Date: Wed, 17 Mar 2004 15:47:12 -0800 > > As you can see here, the use of 0 vs NULL is inconsistent, and the=20 > spacing on the close parens on the last arg is inconsistent. The=20 > implied initialization of 0 is also used in many places. All of this=20 > 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} Don't these changes require changes to the GDB/MI documentation in gdb.texinfo? IIRC, there are examples there to what each command outputs. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 ` Eli Zaretskii 2004-03-18 5:53 ` Eli Zaretskii @ 2004-03-19 0:09 ` Jason Molenda 2004-03-18 19:26 ` Jason Molenda 2004-03-19 14:36 ` Eli Zaretskii 1 sibling, 2 replies; 10+ messages in thread From: Jason Molenda @ 2004-03-19 0:09 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches Hi Eli, On Mar 17, 2004, at 9:54 PM, Eli Zaretskii wrote: >> - { "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} > > Don't these changes require changes to the GDB/MI documentation in > gdb.texinfo? IIRC, there are examples there to what each command > outputs. No, with each of these changes the same code is generated by the compiler. J ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 ` Jason Molenda @ 2004-03-18 19:26 ` Jason Molenda 2004-03-19 14:36 ` Eli Zaretskii 1 sibling, 0 replies; 10+ messages in thread From: Jason Molenda @ 2004-03-18 19:26 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches Hi Eli, On Mar 17, 2004, at 9:54 PM, Eli Zaretskii wrote: >> - { "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} > > Don't these changes require changes to the GDB/MI documentation in > gdb.texinfo? IIRC, there are examples there to what each command > outputs. No, with each of these changes the same code is generated by the compiler. J ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC patch mi-cmds.c table format (pedantic) 2004-03-19 0:09 ` Jason Molenda 2004-03-18 19:26 ` Jason Molenda @ 2004-03-19 14:36 ` Eli Zaretskii 1 sibling, 0 replies; 10+ messages in thread From: Eli Zaretskii @ 2004-03-19 14:36 UTC (permalink / raw) To: Jason Molenda; +Cc: gdb-patches > From: Jason Molenda <jmolenda@apple.com> > Date: Thu, 18 Mar 2004 11:26:17 -0800 > > >> - { NULL, } > >> + { NULL, { NULL, 0 }, NULL, NULL} > > > > Don't these changes require changes to the GDB/MI documentation in > > gdb.texinfo? IIRC, there are examples there to what each command > > outputs. > > No, with each of these changes the same code is generated by the > compiler. What compiler? I thought we were talking about the output generated by the MI interpreter. ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2004-03-19 15:12 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-03-19 0:09 RFC patch mi-cmds.c table format (pedantic) Jason Molenda 2004-03-17 23:47 ` Jason Molenda 2004-03-19 0:09 ` Andrew Cagney 2004-03-19 0:34 ` Jason Molenda 2004-03-19 15:12 ` Andrew Cagney 2004-03-19 0:09 ` Eli Zaretskii 2004-03-18 5:53 ` Eli Zaretskii 2004-03-19 0:09 ` Jason Molenda 2004-03-18 19:26 ` Jason Molenda 2004-03-19 14:36 ` Eli Zaretskii
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox