binutils-gdb/gdb/mi
Simon Marchi 33b2fac610 Simplify ui-out level code
Now that we use a vector to store the levels, we don't have to keep a
separate level field in ui_out to keep track of the current level.  We
can efficiently derive it from the vector size.  That causes a little
change in the meaning of the level, as in they are now 1-based instead
of 0-based (the initial level has the "id" 1 now), but it shouldn't
change anything in the behavior.

Additionally, push_level and pop_level don't really need to return the
new level, making them return void simplifies the code a bit.

Finally, the ui_out_begin/ui_out_end callbacks in the ui_out_impl
interface don't need to be passed the level, it's never actually used.

New in v2:

 - Remove or update stale comments.

gdb/ChangeLog:

	* ui-out.h (ui_out_begin_ftype): Remove level parameter.
	(ui_out_end_ftype): Likewise.
	* ui-out.c (struct ui_out) <level>: Replace field with a method
	that dynamically computes the result.
	(current_level): Get vector's back item instead of using
	uiout->level.
	(push_level): Make return type void.
	(pop_level): Make return type void and update access to
	ui_out::level.
	(uo_begin): Remove level parameter.
	(uo_end): Likewise.
	(ui_out_table_begin): Update access to uiout::level.
	(ui_out_begin): Don't read return value from push_level, call
	uiout->level() instead, update call to uo_begin.
	(ui_out_end): Don't read return value from pop_level, update
	call to uo_end.
	(verify_field): Update access to uiout->level.
	(ui_out_new): Don't initialize ui_out::level, call push_level
	to push the initial level instead of doing it by hand.
	* cli-out.c (cli_begin): Remove level parameter.
	(cli_end): Likewise.
	* mi/mi-out.c (mi_begin): Likewise.
	(mi_end): Likewise.
2016-12-01 16:05:17 -05:00
..
ChangeLog-1999-2003
mi-cmd-break.c Enable/update legacy linespecs in MI. 2016-02-09 14:31:04 -08:00
mi-cmd-break.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-catch.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-disas.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-env.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-file.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-info.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-stack.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
mi-cmd-target.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-var.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
mi-cmds.c Emit inferior, thread and frame selection events to all UIs 2016-10-03 16:54:58 -04:00
mi-cmds.h Make raw_stdout be per MI instance 2016-06-21 01:11:50 +01:00
mi-common.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-common.h Make raw_stdout be per MI instance 2016-06-21 01:11:50 +01:00
mi-console.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-console.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-getopt.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-getopt.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-interp.c Remove make_cleanup_restore_current_ui 2016-10-21 14:17:34 -06:00
mi-main.c gdb: Use C++11 std::chrono 2016-11-23 15:36:26 +00:00
mi-main.h Emit inferior, thread and frame selection events to all UIs 2016-10-03 16:54:58 -04:00
mi-out.c Simplify ui-out level code 2016-12-01 16:05:17 -05:00
mi-out.h Remove unused functions and declarations 2016-11-26 22:03:18 -05:00
mi-parse.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-parse.h gdb: Use C++11 std::chrono 2016-11-23 15:36:26 +00:00
mi-symbol-cmds.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00