From: Mark Kettenis Date: Sat, 27 Jan 2001 17:57:53 +0000 (+0000) Subject: * ui-out.c (do_list_end): New function. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=e6e0bfabf47cb6ac3f5df9f87ee9d9940e3078d8;p=deliverable%2Fbinutils-gdb.git * ui-out.c (do_list_end): New function. (make_cleanup_ui_out_list_end): New function. * ui-out.h: Provide prototype for make_cleanup_ui_out_list_end. * stack.c (print_frame) [UI_OUT]: Call make_cleanup_ui_out_list_end to make sure we mark the end of the list if we do a non-local exit. At the end of the function, instead of calling ui_out_list_end directly, let do_cleanups handle it. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e8afaf5fd3..b4aae025a8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2001-01-27 Mark Kettenis + + * ui-out.c (do_list_end): New function. + (make_cleanup_ui_out_list_end): New function. + * ui-out.h: Provide prototype for make_cleanup_ui_out_list_end. + * stack.c (print_frame) [UI_OUT]: Call + make_cleanup_ui_out_list_end to make sure we mark the end of the + list if we do a non-local exit. At the end of the function, + instead of calling ui_out_list_end directly, let do_cleanups + handle it. + 2001-01-26 Fernando Nasser Fix double parsing of filenames passed as command line arguments diff --git a/gdb/stack.c b/gdb/stack.c index 85f37d88d0..5bc044f262 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1,5 +1,6 @@ /* Print and select stack frames for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991-1996, 1998-2000 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, + 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -448,6 +449,7 @@ print_frame (struct frame_info *fi, #ifdef UI_OUT struct ui_stream *stb; struct cleanup *old_chain; + struct cleanup *list_chain; stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); @@ -532,6 +534,7 @@ print_frame (struct frame_info *fi, #ifdef UI_OUT ui_out_list_begin (uiout, "frame"); + list_chain = make_cleanup_ui_out_list_end (uiout); #endif if (level >= 0) @@ -661,7 +664,8 @@ print_frame (struct frame_info *fi, #endif /* PC_SOLIB */ #ifdef UI_OUT - ui_out_list_end (uiout); + /* do_cleanups will call ui_out_list_end() for us. */ + do_cleanups (list_chain); ui_out_text (uiout, "\n"); do_cleanups (old_chain); #else diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 79533267ed..0d36639dd4 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -281,6 +281,18 @@ ui_out_list_end (struct ui_out *uiout) uiout->list_flag--; } +static void +do_list_end (void *uiout) +{ + ui_out_list_end (uiout); +} + +struct cleanup * +make_cleanup_ui_out_list_end (struct ui_out *uiout) +{ + return make_cleanup (do_list_end, uiout); +} + void ui_out_field_int (struct ui_out *uiout, char *fldname, int value) { diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 4a45dc85a4..17454d2032 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -81,6 +81,8 @@ extern void ui_out_list_begin (struct ui_out *uiout, char *lstid); extern void ui_out_list_end (struct ui_out *uiout); +extern struct cleanup *make_cleanup_ui_out_list_end (struct ui_out *uiout); + extern void ui_out_field_int (struct ui_out *uiout, char *fldname, int value); extern void ui_out_field_core_addr (struct ui_out *uiout, char *fldname,