diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-05-12 04:08:24 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-05-12 04:08:24 +0000 |
commit | 666547aa9ebfac79a2f7607e0621f6a55c8c6f30 (patch) | |
tree | 9dbf9e34710e03caaccc11bedddbf124c5f2448c | |
parent | 30c98d84cd2c82265d56de5e3bc6a25b291ff65c (diff) | |
download | gdb-666547aa9ebfac79a2f7607e0621f6a55c8c6f30.zip gdb-666547aa9ebfac79a2f7607e0621f6a55c8c6f30.tar.gz gdb-666547aa9ebfac79a2f7607e0621f6a55c8c6f30.tar.bz2 |
s/ui_out_list/ui_out_tupple/
-rw-r--r-- | gdb/ChangeLog | 22 | ||||
-rw-r--r-- | gdb/breakpoint.c | 38 | ||||
-rw-r--r-- | gdb/cli/cli-setshow.c | 12 | ||||
-rw-r--r-- | gdb/mi/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/mi/mi-cmd-disas.c | 36 | ||||
-rw-r--r-- | gdb/mi/mi-cmd-stack.c | 20 | ||||
-rw-r--r-- | gdb/mi/mi-cmd-var.c | 18 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 40 | ||||
-rw-r--r-- | gdb/mi/mi-out.c | 8 | ||||
-rw-r--r-- | gdb/printcmd.c | 5 | ||||
-rw-r--r-- | gdb/stack.c | 10 | ||||
-rw-r--r-- | gdb/ui-out.c | 27 | ||||
-rw-r--r-- | gdb/ui-out.h | 17 |
13 files changed, 158 insertions, 104 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7fe4257..09c4788 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,25 @@ +Fri May 11 13:32:50 2001 Andrew Cagney <cagney@b1.cygnus.com> + + * breakpoint.c: Replace ui_out_list_begin, ui_out_list_end and + make_cleanup_ui_out_list_end with ui_out_tuple_begin, + ui_out_tuple_end and make_cleanup_ui_out_tuple_begin_end. + * cli/cli-setshow.c: Ditto. + * printcmd.c: Ditto. + * stack.c: Ditto. + + * ui-out.h (enum ui_out_type): Fix tipo - tupple -> tuple. + * ui-out.c (ui_out_list_begin): Delete ``lstid'' parameter. + (ui_out_tuple_begin): New function. + (ui_out_tuple_end): New function. + (ui_out_tuple_begin_end): New function. + (make_cleanup_ui_out_list_begin_end): Replace + make_cleanup_ui_out_list_end function. + * ui-out.h (ui_out_list_begin): Update declaration. + (make_cleanup_ui_out_list_begin_end): Replace + make_cleanup_ui_out_list_end declaration. + (ui_out_tuple_begin, ui_out_tuple_end): Declare. + (ui_out_tuple_begin_end): Declare. + 2001-05-11 Jim Blandy <jimb@redhat.com> * gnu-v2-abi.c: Don't #include "gdb_regex.h". We don't use it. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 177b192..e706f1a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2030,14 +2030,14 @@ print_it_typical (bpstat bs) if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "watchpoint-trigger"); mention (bs->breakpoint_at); - ui_out_list_begin (uiout, "value"); + ui_out_tuple_begin (uiout, "value"); ui_out_text (uiout, "\nOld value = "); value_print (bs->old_val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "old", stb); ui_out_text (uiout, "\nNew value = "); value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "new", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); ui_out_text (uiout, "\n"); #else mention (bs->breakpoint_at); @@ -2060,11 +2060,11 @@ print_it_typical (bpstat bs) if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "read-watchpoint-trigger"); mention (bs->breakpoint_at); - ui_out_list_begin (uiout, "value"); + ui_out_tuple_begin (uiout, "value"); ui_out_text (uiout, "\nValue = "); value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "value", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); ui_out_text (uiout, "\n"); #else mention (bs->breakpoint_at); @@ -2084,7 +2084,7 @@ print_it_typical (bpstat bs) if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "access-watchpoint-trigger"); mention (bs->breakpoint_at); - ui_out_list_begin (uiout, "value"); + ui_out_tuple_begin (uiout, "value"); ui_out_text (uiout, "\nOld value = "); value_print (bs->old_val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "old", stb); @@ -2097,12 +2097,12 @@ print_it_typical (bpstat bs) mention (bs->breakpoint_at); if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "access-watchpoint-trigger"); - ui_out_list_begin (uiout, "value"); + ui_out_tuple_begin (uiout, "value"); ui_out_text (uiout, "\nValue = "); } value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default); ui_out_field_stream (uiout, "new", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); ui_out_text (uiout, "\n"); #else if (bs->old_val != NULL) @@ -3126,7 +3126,7 @@ print_one_breakpoint (struct breakpoint *b, annotate_record (); #ifdef UI_OUT - ui_out_list_begin (uiout, "bkpt"); + ui_out_tuple_begin (uiout, "bkpt"); #endif /* 1 */ @@ -3490,9 +3490,9 @@ print_one_breakpoint (struct breakpoint *b, { annotate_field (9); #ifdef UI_OUT - ui_out_list_begin (uiout, "script"); + ui_out_tuple_begin (uiout, "script"); print_command_lines (uiout, l, 4); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); #else while (l) { @@ -3502,7 +3502,7 @@ print_one_breakpoint (struct breakpoint *b, #endif } #ifdef UI_OUT - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); do_cleanups (old_chain); #endif } @@ -4379,21 +4379,21 @@ mention (struct breakpoint *b) #ifdef UI_OUT case bp_watchpoint: ui_out_text (uiout, "Watchpoint "); - ui_out_list_begin (uiout, "wpt"); + ui_out_tuple_begin (uiout, "wpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); break; case bp_hardware_watchpoint: ui_out_text (uiout, "Hardware watchpoint "); - ui_out_list_begin (uiout, "wpt"); + ui_out_tuple_begin (uiout, "wpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); break; #else case bp_watchpoint: @@ -4408,21 +4408,21 @@ mention (struct breakpoint *b) #ifdef UI_OUT case bp_read_watchpoint: ui_out_text (uiout, "Hardware read watchpoint "); - ui_out_list_begin (uiout, "hw-rwpt"); + ui_out_tuple_begin (uiout, "hw-rwpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); break; case bp_access_watchpoint: ui_out_text (uiout, "Hardware access (read/write) watchpoint "); - ui_out_list_begin (uiout, "hw-awpt"); + ui_out_tuple_begin (uiout, "hw-awpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); break; #else case bp_read_watchpoint: diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 47ad244..bd3dd1a 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -422,7 +422,7 @@ void cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) { #ifdef UI_OUT - ui_out_list_begin (uiout, "showlist"); + ui_out_tuple_begin (uiout, "showlist"); #endif for (; list != NULL; list = list->next) { @@ -431,19 +431,19 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) #ifdef UI_OUT if (list->prefixlist && !list->abbrev_flag) { - ui_out_list_begin (uiout, "optionlist"); + ui_out_tuple_begin (uiout, "optionlist"); ui_out_field_string (uiout, "prefix", list->prefixname + 5); cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } if (list->type == show_cmd) { - ui_out_list_begin (uiout, "option"); + ui_out_tuple_begin (uiout, "option"); ui_out_text (uiout, prefix); ui_out_field_string (uiout, "name", list->name); ui_out_text (uiout, ": "); do_setshow_command ((char *) NULL, from_tty, list); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } #else if (list->prefixlist && !list->abbrev_flag) @@ -458,7 +458,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) #endif } #ifdef UI_OUT - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); #endif } diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 229dd3d..617e0cd 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,12 @@ +Fri May 11 13:55:07 2001 Andrew Cagney <cagney@b1.cygnus.com> + + * mi-cmd-var.c: Replace ui_out_list_begin, ui_out_list_end and + make_cleanup_ui_out_list_end with ui_out_tupple_begin, + ui_out_tupple_end and make_cleanup_ui_out_tupple_begin_end. + * mi-cmd-stack.c: Ditto. + * mi-cmd-disas.c: Ditto. + * mi-main.c: Ditto. + 2001-05-10 Andrew Cagney <ac131313@redhat.com> * mi-out.c (mi_open, mi_close): Replace list_open and list_close. diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c index 1937eb0..021ee5e 100644 --- a/gdb/mi/mi-cmd-disas.c +++ b/gdb/mi/mi-cmd-disas.c @@ -364,7 +364,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) for that line. */ next_line = 0; /* Force out first line */ - ui_out_list_begin (uiout, "asm_insns"); + ui_out_tuple_begin (uiout, "asm_insns"); num_displayed = 0; for (i = 0; i < newlines; i++) { @@ -377,7 +377,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) /* Just one line to print. */ if (next_line == mle[i].line) { - ui_out_list_begin (uiout, "src_and_asm_line"); + ui_out_tuple_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); } else @@ -385,26 +385,26 @@ mi_cmd_disassemble (char *command, char **argv, int argc) /* Several source lines w/o asm instructions associated. */ for (; next_line < mle[i].line; next_line++) { - ui_out_list_begin (uiout, "src_and_asm_line"); + ui_out_tuple_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); - ui_out_list_begin (uiout, "line_asm_insn"); - ui_out_list_end (uiout); - ui_out_list_end (uiout); + ui_out_tuple_begin (uiout, "line_asm_insn"); + ui_out_tuple_end (uiout); + ui_out_tuple_end (uiout); } /* Print the last line and leave list open for asm instructions to be added. */ - ui_out_list_begin (uiout, "src_and_asm_line"); + ui_out_tuple_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); } } else { - ui_out_list_begin (uiout, "src_and_asm_line"); + ui_out_tuple_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, mle[i].line, mle[i].line + 1, 0); } next_line = mle[i].line + 1; - ui_out_list_begin (uiout, "line_asm_insn"); + ui_out_tuple_begin (uiout, "line_asm_insn"); if (i + 1 < newlines && mle[i + 1].line <= mle[i].line) close_list = 0; } @@ -418,7 +418,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) else num_displayed++; } - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_core_addr (uiout, "address", pc); if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped)) @@ -437,24 +437,24 @@ mi_cmd_disassemble (char *command, char **argv, int argc) pc += (*tm_print_insn) (pc, &di); ui_out_field_stream (uiout, "inst", stb); ui_file_rewind (stb->stream); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } if (close_list) { - ui_out_list_end (uiout); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); + ui_out_tuple_end (uiout); close_list = 0; } if (how_many >= 0) if (num_displayed >= how_many) break; } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } else { assembly_only: - ui_out_list_begin (uiout, "asm_insns"); + ui_out_tuple_begin (uiout, "asm_insns"); num_displayed = 0; for (pc = low; pc < high;) { @@ -466,7 +466,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) else num_displayed++; } - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_core_addr (uiout, "address", pc); if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped)) @@ -485,9 +485,9 @@ mi_cmd_disassemble (char *command, char **argv, int argc) pc += (*tm_print_insn) (pc, &di); ui_out_field_stream (uiout, "inst", stb); ui_file_rewind (stb->stream); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } gdb_flush (gdb_stdout); diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 2d80be7..7d0ed7c 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -77,7 +77,7 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc) if (fi == NULL) error ("mi_cmd_stack_list_frames: Not enough frames in stack."); - ui_out_list_begin (uiout, "stack"); + ui_out_tuple_begin (uiout, "stack"); /* Now let;s print the frames up to frame_high, or until there are frames in the stack. */ @@ -96,7 +96,7 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc) 0 /* args */ ); } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); if (i < frame_high) error ("mi_cmd_stack_list_frames: Not enough frames in stack."); @@ -183,7 +183,7 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc) if (fi == NULL) error ("mi_cmd_stack_list_args: Not enough frames in stack."); - ui_out_list_begin (uiout, "stack-args"); + ui_out_tuple_begin (uiout, "stack-args"); /* Now let's print the frames up to frame_high, or until there are frames in the stack. */ @@ -192,13 +192,13 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc) i++, fi = get_prev_frame (fi)) { QUIT; - ui_out_list_begin (uiout, "frame"); + ui_out_tuple_begin (uiout, "frame"); ui_out_field_int (uiout, "level", i); list_args_or_locals (0, atoi (argv[0]), fi); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); if (i < frame_high) error ("mi_cmd_stack_list_args: Not enough frames in stack."); @@ -222,7 +222,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) block = get_frame_block (fi); - ui_out_list_begin (uiout, locals ? "locals" : "args"); + ui_out_tuple_begin (uiout, locals ? "locals" : "args"); while (block != 0) { @@ -265,7 +265,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) if (print_me) { if (values) - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_string (uiout, "name", SYMBOL_NAME (sym)); if (values) @@ -280,7 +280,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) sym2 = sym; print_variable_value (sym2, fi, stb->stream); ui_out_field_stream (uiout, "value", stb); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } } } @@ -289,7 +289,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) else block = BLOCK_SUPERBLOCK (block); } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); ui_out_stream_delete (stb); } diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index dfdc4a6..3ad9673 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -273,11 +273,11 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) if (numchild <= 0) return MI_CMD_DONE; - ui_out_list_begin (uiout, "children"); + ui_out_tuple_begin (uiout, "children"); cc = childlist; while (*cc != NULL) { - ui_out_list_begin (uiout, "child"); + ui_out_tuple_begin (uiout, "child"); ui_out_field_string (uiout, "name", varobj_get_objname (*cc)); ui_out_field_string (uiout, "exp", varobj_get_expression (*cc)); ui_out_field_int (uiout, "numchild", varobj_get_num_children (*cc)); @@ -285,10 +285,10 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) /* C++ pseudo-variables (public, private, protected) do not have a type */ if (type) ui_out_field_string (uiout, "type", varobj_get_type (*cc)); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); cc++; } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); xfree (childlist); return MI_CMD_DONE; } @@ -421,10 +421,10 @@ mi_cmd_var_update (char *command, char **argv, int argc) if ((*name == '*') && (*(name + 1) == '\0')) { nv = varobj_list (&rootlist); - ui_out_list_begin (uiout, "changelist"); + ui_out_tuple_begin (uiout, "changelist"); if (nv <= 0) { - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); return MI_CMD_DONE; } cr = rootlist; @@ -434,7 +434,7 @@ mi_cmd_var_update (char *command, char **argv, int argc) cr++; } xfree (rootlist); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } else { @@ -443,9 +443,9 @@ mi_cmd_var_update (char *command, char **argv, int argc) if (var == NULL) error ("mi_cmd_var_update: Variable object not found"); - ui_out_list_begin (uiout, "changelist"); + ui_out_tuple_begin (uiout, "changelist"); varobj_update_one (var); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } return MI_CMD_DONE; } diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index f0d7e10..c7476cd 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -273,7 +273,7 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc) numregs = NUM_REGS; - ui_out_list_begin (uiout, "register-names"); + ui_out_tuple_begin (uiout, "register-names"); if (argc == 0) /* No args, just do all the regs */ { @@ -305,7 +305,7 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc) return MI_CMD_ERROR; } } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); return MI_CMD_DONE; } @@ -323,7 +323,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc) numregs = NUM_REGS; - ui_out_list_begin (uiout, "changed-registers"); + ui_out_tuple_begin (uiout, "changed-registers"); if (argc == 0) /* No args, just do all the regs */ { @@ -372,7 +372,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc) return MI_CMD_ERROR; } } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); return MI_CMD_DONE; } @@ -433,7 +433,7 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) return MI_CMD_ERROR; } - ui_out_list_begin (uiout, "register-values"); + ui_out_tuple_begin (uiout, "register-values"); if (argc == 1) /* No args, beside the format: do all the regs */ { @@ -444,12 +444,12 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) if (REGISTER_NAME (regnum) == NULL || *(REGISTER_NAME (regnum)) == '\0') continue; - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_int (uiout, "number", regnum); result = get_register (regnum, format); if (result == -1) return MI_CMD_ERROR; - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } } @@ -463,12 +463,12 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) && REGISTER_NAME (regnum) != NULL && *REGISTER_NAME (regnum) != '\000') { - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_int (uiout, "number", regnum); result = get_register (regnum, format); if (result == -1) return MI_CMD_ERROR; - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } else { @@ -476,7 +476,7 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) return MI_CMD_ERROR; } } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); return MI_CMD_DONE; } @@ -893,17 +893,17 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) struct ui_stream *stream = ui_out_stream_new (uiout); int row; int row_byte; - ui_out_list_begin (uiout, "memory"); + ui_out_tuple_begin (uiout, "memory"); for (row = 0, row_byte = 0; row < nr_rows; row++, row_byte += nr_cols * word_size) { int col; int col_byte; - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_core_addr (uiout, "addr", addr + row_byte); /* ui_out_field_core_addr_symbolic (uiout, "saddr", addr + row_byte); */ - ui_out_list_begin (uiout, "data"); + ui_out_tuple_begin (uiout, "data"); for (col = 0, col_byte = row_byte; col < nr_cols; col++, col_byte += word_size) @@ -920,7 +920,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) ui_out_field_stream (uiout, NULL, stream); } } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); if (aschar) { int byte; @@ -940,10 +940,10 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) } ui_out_field_stream (uiout, "ascii", stream); } - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } ui_out_stream_delete (stream); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); } do_cleanups (cleanups); return MI_CMD_DONE; @@ -1377,11 +1377,11 @@ mi_load_progress (const char *section_name, if (last_async_command) fputs_unfiltered (last_async_command, raw_stdout); fputs_unfiltered ("+download", raw_stdout); - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_string (uiout, "section", section_name); ui_out_field_int (uiout, "section-size", total_section); ui_out_field_int (uiout, "total-size", grand_total); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); mi_out_put (uiout, raw_stdout); fputs_unfiltered ("\n", raw_stdout); gdb_flush (raw_stdout); @@ -1395,13 +1395,13 @@ mi_load_progress (const char *section_name, if (last_async_command) fputs_unfiltered (last_async_command, raw_stdout); fputs_unfiltered ("+download", raw_stdout); - ui_out_list_begin (uiout, NULL); + ui_out_tuple_begin (uiout, NULL); ui_out_field_string (uiout, "section", section_name); ui_out_field_int (uiout, "section-sent", sent_so_far); ui_out_field_int (uiout, "section-size", total_section); ui_out_field_int (uiout, "total-sent", total_sent); ui_out_field_int (uiout, "total-size", grand_total); - ui_out_list_end (uiout); + ui_out_tuple_end (uiout); mi_out_put (uiout, raw_stdout); fputs_unfiltered ("\n", raw_stdout); gdb_flush (raw_stdout); diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index a25c890..e920812 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -106,7 +106,7 @@ mi_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) field_separator (uiout); if (tblid) fprintf_unfiltered (data->buffer, "%s=", tblid); - mi_open (uiout, ui_out_type_tupple); + mi_open (uiout, ui_out_type_tuple); data->first_header = 0; data->supress_field_separator = 1; } @@ -119,7 +119,7 @@ mi_table_body (struct ui_out *uiout) struct ui_out_data *data = ui_out_data (uiout); /* close the table header line if there were any headers */ if (data->first_header) - mi_close (uiout, ui_out_type_tupple); + mi_close (uiout, ui_out_type_tuple); } /* Mark end of a table */ @@ -128,7 +128,7 @@ void mi_table_end (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); - mi_close (uiout, ui_out_type_tupple); + mi_close (uiout, ui_out_type_tuple); /* If table was empty this flag did not get reset yet */ data->supress_field_separator = 0; } @@ -142,7 +142,7 @@ mi_table_header (struct ui_out *uiout, int width, int alignment, char *colhdr) if (!data->first_header++) { fputs_unfiltered ("hdr=", data->buffer); - mi_open (uiout, ui_out_type_tupple); + mi_open (uiout, ui_out_type_tuple); } mi_field_string (uiout, 0, width, alignment, 0, colhdr); } diff --git a/gdb/printcmd.c b/gdb/printcmd.c index c49f51b..66dc512 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1908,8 +1908,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, annotate_arg_begin (); - ui_out_list_begin (uiout, NULL); - list_chain = make_cleanup_ui_out_list_end (uiout); + list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); fprintf_symbol_filtered (stb->stream, SYMBOL_SOURCE_NAME (sym), SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI); ui_out_field_stream (uiout, "name", stb); @@ -1952,7 +1951,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, else ui_out_text (uiout, "???"); - /* Invoke ui_out_list_end. */ + /* Invoke ui_out_tuple_end. */ do_cleanups (list_chain); #else val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, diff --git a/gdb/stack.c b/gdb/stack.c index 07bea73..a5aff4b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -531,8 +531,7 @@ print_frame (struct frame_info *fi, annotate_frame_begin (level == -1 ? 0 : level, fi->pc); #ifdef UI_OUT - ui_out_list_begin (uiout, "frame"); - list_chain = make_cleanup_ui_out_list_end (uiout); + list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); #endif if (level >= 0) @@ -587,12 +586,11 @@ print_frame (struct frame_info *fi, args.func = func; args.stream = gdb_stdout; #ifdef UI_OUT - ui_out_list_begin (uiout, "args"); - args_list_chain = make_cleanup_ui_out_list_end (uiout); + args_list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "args"); catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL); /* FIXME: args must be a list. If one argument is a string it will have " that will not be properly escaped. */ - /* Invoke ui_out_list_end. */ + /* Invoke ui_out_tuple_end. */ do_cleanups (args_list_chain); #else catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL); @@ -649,7 +647,7 @@ print_frame (struct frame_info *fi, #endif /* PC_SOLIB */ #ifdef UI_OUT - /* do_cleanups will call ui_out_list_end() for us. */ + /* do_cleanups will call ui_out_tuple_end() for us. */ do_cleanups (list_chain); ui_out_text (uiout, "\n"); do_cleanups (old_chain); diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 3e0f55c..b5c1006 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -332,10 +332,15 @@ specified after table_body."); } void -ui_out_list_begin (struct ui_out *uiout, - char *id) +ui_out_list_begin (struct ui_out *uiout) { - ui_out_begin (uiout, ui_out_type_list, id); + ui_out_begin (uiout, ui_out_type_list, NULL); +} + +void +ui_out_tuple_begin (struct ui_out *uiout, const char *id) +{ + ui_out_begin (uiout, ui_out_type_tuple, id); } void @@ -352,6 +357,12 @@ ui_out_list_end (struct ui_out *uiout) ui_out_end (uiout, ui_out_type_list); } +void +ui_out_tuple_end (struct ui_out *uiout) +{ + ui_out_end (uiout, ui_out_type_tuple); +} + struct ui_out_end_cleanup_data { struct ui_out *uiout; @@ -387,7 +398,15 @@ make_cleanup_ui_out_begin_end (struct ui_out *uiout, } struct cleanup * -make_cleanup_ui_out_list_end (struct ui_out *uiout) +make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, + const char *id) +{ + ui_out_tuple_begin (uiout, id); + return make_cleanup_ui_out_end (uiout, ui_out_type_tuple); +} + +struct cleanup * +make_cleanup_ui_out_list_begin_end (struct ui_out *uiout) { return make_cleanup_ui_out_end (uiout, ui_out_type_list); } diff --git a/gdb/ui-out.h b/gdb/ui-out.h index ed2a289..9fe0be7 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -66,11 +66,11 @@ struct ui_stream /* Prototypes for ui-out API. */ /* A result is a recursive data structure consisting of lists and - tupples. */ + tuples. */ enum ui_out_type { - ui_out_type_tupple, + ui_out_type_tuple, ui_out_type_list }; @@ -84,7 +84,7 @@ extern struct cleanup *ui_out_begin_cleanup_end (struct ui_out *uiout, enum ui_out_type level_type, const char *id); -/* A table can be considered a special tupple/list combination with +/* A table can be considered a special tuple/list combination with the implied structure: ``table = { hdr = { header, ... } , body = [ { field, ... }, ... ] }'' */ @@ -101,11 +101,18 @@ extern void ui_out_table_end (struct ui_out *uiout); /* Compatibility wrappers, new code should use ui_out_begin() and ui_out_end(). */ -extern void ui_out_list_begin (struct ui_out *uiout, char *lstid); +extern void ui_out_list_begin (struct ui_out *uiout); extern void ui_out_list_end (struct ui_out *uiout); -extern struct cleanup *make_cleanup_ui_out_list_end (struct ui_out *uiout); +extern struct cleanup *make_cleanup_ui_out_list_begin_end (struct ui_out *uiout); + +extern void ui_out_tuple_begin (struct ui_out *uiout, const char *id); + +extern void ui_out_tuple_end (struct ui_out *uiout); + +extern struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, + const char *id); extern void ui_out_field_int (struct ui_out *uiout, char *fldname, int value); |