Patrick Monnerat [Sat, 25 Nov 2017 00:25:53 +0000 (01:25 +0100)]
Upgrade submodule, sync patch and code, reorder functions, drop value_ptr.
* gdbtk/generic/gdbtk-cmds.c (gdb_eval): drop value_ptr type, remove unused
variable dummy.
(gdb_update_mem); remove unused variable dummy.
* gdbtk/generic/gdbtk-varobj.c (variable_delete_tcl): children field is
now a std::vector.
(variable_children): varobj_list_children() now returns a std::vector&.
(variable_update): use a std::vector& as GDB_varobj_update() argument.
* gdbtk/generic/gdbtk-wrapper.[ch]: drop value_ptr_type, reorder functions
alphabetically, remove redundant prototypes.
(GDB_varobj_update): argument `changes' is now a std::vector& to accomodate
varobj_update() new result type.
Patrick Monnerat [Thu, 21 Sep 2017 12:28:16 +0000 (13:28 +0100)]
Delete all gdb breakpoint with a private API
* gdbtk/generic/gdbtk-bp.c (gdbtk_delete_all_breakpoints): new function.
* gdbtk/generic/gdbtk-cmds.c (gdb_clear_file): Use
gdbtk_delete_all_breakpoints() instead of delete_command().
Patrick Monnerat [Sat, 15 Apr 2017 00:24:51 +0000 (01:24 +0100)]
Upgrade submodule, sync patch and code.
Several gdb function arguments and structure members are now unique pointer
types event_location_up and command_line_up instead of struct event_location *
and struct command_line * respectively.
Code changes in this commit adapt the insight-specfic code to this situation.
* gdbtk/generic/gdbtk-bp.c (gdb_get_breakpoint_info): convert breakpoint
location to a regular pointer.
(gdb_set_bp): use an event_location_up local variable.
No more cleanup needed.
(gdb_actions_command): use a command_line_up local variable.
(tracepoint_exists): use an event_location_up local variable.
No more cleanup needed.
* gdbtk/generic/gdbtk-cmds.c (gdb_get_line_command): likewise.
(gdb_get_file_command): likewise.
(gdb_get_function_command): likewise.
* gdbtk/generic/gdbtk-stack.c (gdb_get_vars_command): likewise.
Upgrade submodule, sync patch and code.
gdb makefiles now enforces ISO C++ that forbids to assign a string constant to
a non-const char pointer. All changes in this commit fixes those kind of
assignments.
* gdbtk/generic/gdbtk-bp.c (bptypes, bpdisp): change type to const char *[].
* gdbtk/generic/gdbtk-cmds.c (struct disassembly_client_data): change map_arr
type to const char *.
* gdbtk/generic/gdbtk-hooks.c (gdbtk_readline_begin): change format argument
type to const char *.
(gdbtk_two_elem_cmd): change cmd_name argument type to const char *.
(gdbtk_pre_add_symbol): remove unneeded cast.
* gdbtk/generic/gdbtk-varobj.c (format_string): change type to const char *[].
* gdbtk/generic/gdbtk.c (TclDebug): change priority type to const char *.
(gdbtk_init): for non-CygWin code, change srcdir type to const char *.
(gdbtk_source_start_file): change s type to const char *.
* libgui/src/guitcl.h, libgui/src/paths.c (ide_initialize_paths): change
ide_appname argument type to const char *.
Code changes are motivated by:
- gdb struct interp is now a C++ class.
- ui_file is now a C++ class.
- memory ui_file is replaced by new class string_file.
* gdbtk/generic/gdbtk.h: gdbtk_interp renamed to gdbtk_ctl_interp.
(gdbtk_fputs), (gdbtk_fileopenin): deleted.
gdbtk_disable_fputs: renamed to gdbtk_disable_write, set to bool.
* gdbtk/generic/gdbtk-bp.c (breakpoint_notify): gdbtk_interp renamed.
* gdbtk/generic/gdbtk-cmds.c (gdbtk_restore_fputs):
renamed to gdbtk_restore_write.
(Gdbtk_init): gdbtk_restore_fputs and gdbtk_interp renamed.
(gdb_eval), (gdb_update_mem):
use stack-based string file. cleanup chain no longer needed.
* gdbtk/generic/gdbtk-hooks.c: gdbtk_in_fputs renamed.
Subclass gdbtk_file of ui_file to support console I/O.
(gdbtk_read): replaced by gdbtk_file::read.
(gdbtk_fputs): replaced by gdbtk_file::write.
(gdbtk_two_elem_cmd), (gdbtk_getpid), (report_error),
(gdbtk_ignorable_warning), (gdbtk_memory_change), (gdbtk_readline_end),
(gdbtk_call_command), (gdbtk_param_changed), (gdbtk_load_hash),
(gdbtk_post_add_symbol), (gdbtk_query), (gdbtk_trace_find),
(gdbtk_trace_start_stop), (gdbtk_annotate_signal), (gdbtk_attach),
(gdbtk_detach), (gdbtk_architecture_changed): gdbtk_interp renamed.
(gdbtk_fileopenin): deleted.
(gdbtk_fileopen): use gdbtk_file subclass object.
(gdbtk_warning): use ui_file class object for gdb_stderr.
(x_event): in_fputs renamed. gdbtk_interp renamed.
(gdbtk_readline): gdbtk_interp renamed. Use gdb_stdout puts method.
* gdbtk/generic/gdbtk-interp.c: New subclass gdbtk_interp of interp.
Move struct gdbtk_interp_data fields to gdbtk_interp.
(gdbtk_interpreter_init): replaced by gdbtk_interp::init.
(gdbtk_interpreter_resume): replaced by gdbtk_interp::resume.
(gdbtk_interpreter_suspend): replaced by gdbtk_interp::suspend.
(gdbtk_interpreter_exec): replaced by gdbtk_interp::exec.
(gdbtk_supports_command_editing): deleted.
(gdbtk_pre_command_loop): replaced by gdbtk_interp::pre_command_loop.
gdbtk_interp renamed to gdbtk_tcl_interp.
(gdbtk_interpreter_ui_out): replaced by gdbtk_interp::interp_ui_out.
(gdbtk_interp_factory): use new interp class.
* gdbtk/generic/gdbtk-register.c (get_register_size),
(get_register_collectable), (get_register_types): gdbtk_interp renamed.
(get_register): gdbtk_interp renamed. Use stack-based memory file.
Drop obsolete cleanup chain.
* gdbtk/generic/gdbtk-varobj.c (variable_print): Use stack-based memory file.
* gdbtk/generic/gdbtk.c: gdbtk_interp renamed to gdbtk_tcl_interp.
gdbtk_disable_fputs replaced by gdbtk_disable_write.
(TclDebug), (cleanup_init), (gdbtk_cleanup), (tk_command), (view_command):
gdbtk_interp renamed.
)gdbtk_init): gdbtk_interp and gdbtk_disable_fputs renamed.
* gdbtk/library/interface.tcl (gdbtk_idle), (gdbtk_tcl_fputs):
gdb_restore_fputs renamed to gdb_restore_write.
Patrick Monnerat [Fri, 11 Nov 2016 15:28:24 +0000 (16:28 +0100)]
Upgrade submodule. Update patches and code accordingly.
Latest gdb changes introduce C++-only function types. Thus the current
insight code updates make it not compilable with C.
* gdbtk/generic/gdbtk-cmds.c (gdb_eval): expr is now an expression_up class
instance. New cleanup head is thus the memory file deletion.
* gdbtk/generic/gdbtk-register.c (get_register): Remove the obsolete second
parameter.
* gdbtk/generic/gdbtk-varobj.c (install_variable, uninstall_variable):
Set the variable name parameter as const.
(variable_obj_command): called procedure varobj_get_expression () now returns
a std::string.
(variable_delete_tcl): varobj_p member obj_name is now a std::string.
(variable_children): set childname as const.
(variable_type): varobj_get_type () now returns a std::string. Replace
tcl regexp processing by std::string methods call.
(variable_value): varobj_get_value () now returns a std::string.
* gdbtk/generic/gdbtk-wrapper.[ch] (GDB_val_print, wrap_val_print): no
longer used: deleted.
Patrick Monnerat [Sat, 30 Jul 2016 15:36:42 +0000 (16:36 +0100)]
Tcl 8.6 compatibility.
Version 8.6 of Tcl changes some procedure parameters to const. Hopefully,
a CONST86 macro is defined by Tcl for this purpose. Use it where necessary.
* gdbtk/generic/gdbtk.c: define CONST84 and CONST86 macros as empty by default.
(gdbtk_notifier_set_timer): define parameter with CONST86.
(gdbtk_notifier_wait_for_event): likewise.
(gdbtk_notifier_procs): cast initializers.
Patrick Monnerat [Wed, 29 Jun 2016 15:08:50 +0000 (17:08 +0200)]
Upgrade submodule. Modify patches and code accordingly.
The upgrade introduces a new interpreter API. The main loop is now under
gdb control.
The input stream handling has also changed: everything goes through a
struct ui. To support it, a new gdb patch has been introduced.
* patches/binutils-gdb/007-Avoid-creating-a-file-handler-for-a-negative-fd.patch
New patch.
* gdbtk/generic/gdbtk-hooks.c (gdbtk_warning): add new parameter to
stderr_fileopen.
* gdbtk/generic/gdbtk-interp.c (gdbtk_command_loop): deleted.
(gdbtk_supports_command_editing): new dummy procedure.
(gdbtk_pre_command_loop): new procedure. Sets input fd to -1 to disable
gdb commands from standard input.
(gdbtk_interp_factory): new procedure.
(_initialize_gdbtk_interp): use new interpreter API.
Patrick Monnerat [Tue, 28 Jun 2016 15:48:59 +0000 (17:48 +0200)]
Insert Tcl event loop into gdb event loop. Use gdb event loop.
This is done via a new Tcl notifier and a gdb asynchronous event to call
Tcl_DoOneEvent when needed.
Gdb event handler needs some updates to support the Tcl notifier: they are
currently implemented by patches.
* patches/binutils-gdb/005-gdb_do_one_event-add-an-expiration-parameter.patch:
New patch.
* patches/binutils-gdb/006-add_file_handler-implement-a-mask-parameter.patch
New patch.
* gdbtk/generic/gdbtk.c (gdbtk_notifier_schedule_proc): New procedure.
(gdbtk_notifier_reschedule_tcl): New procedure.
(gdbtk_notifier_get_file_data): New procedure.
(gdbtk_notifier_file_handler_event_proc): New procedure.
(gdbtk_notifier_file_proc): New procedure.
(gdbtk_notifier_timeout): New procedure.
(gdbtk_notifier_set_timer): New procedure.
(gdbtk_notifier_wait_for_event): New procedure.
(gdbtk_notifier_delete_file_handler): New procedure.
(gdbtk_notifier_create_file_handler): New procedure.
(gdbtk_notifier_initialize): New procedure.
(gdbtk_notifier_finalize): New procedure.
(gdbtk_notifier_alert): New procedure.
(gdbtk_notifier_service_mode_hook): New procedure.
(gdbtk_install_notifier): New procedure.
(gdbtk_uninstall_notifier): New procedure.
(cleanup_init): Uninstall notifier.
(gdbtk_init): Install notifier.
* gdbtk/generic/gdbtk-hooks.c (gdbtk_call_command): Add timeout parameter to
gdb_do_one_event.
* gdbtk/generic/gdbtk-interp.c (gdbtk_command_loop): Use gdb start_event_loop
instead of Tk_MainLoop.
Patrick Monnerat [Fri, 22 Apr 2016 13:13:13 +0000 (15:13 +0200)]
Adjust C code for C++ syntax compatibility.
Gdb will soon be compiled as C++ code, thus our source code must match
this requirement.
* gdbtk/generic/gdbtk-bp.c (Gdbtk_Breakpoint_Init): Explicit casts to
ClientData in Tcl_CreateObjCommand() calls.
(tracepoint_exists): Explicit cast xmalloc() result.
* gdbtk/generic/gdbtk-cmds.c (Gdbtk_Init): Explicit casts to ClientData in
Tcl_CreateObjCommand() calls.
(wrapped_call): Explicit cast to ClientData of first callback call argument.
(do_listfiles): Explicit cast for initial info assignment.
Explicit cast of xrealloc() result.
(gdb_search): `space' is an enum search_domain, not a domain_enum.
(gdb_loadfile): Explicit cast 2nd catch_errors() argument to void *.
(perror_with_name_wrapper): Explicit cast of perror_with_name() argument.
* gdbtk/generic/gdbtk-hooks.c (gdbtk_two_elem_cmd): Explicit cast of
malloc() result.
(gdbtk_ignorable_warning): Rename formal argument 'class', as it is a
C++ reserved word.
* gdbtk/generic/gdbtk-interp.c (gdbtk_interpreter_ui_out): Explicit cast
initializer value of `data'.
* gdbtk/generic/gdbtk-register.c (Gdbtk_Register_Init): Explicit casts to
ClientData in Tcl_CreateObjCommand() calls.
(setup_architecture_data): Explicit cast of xcalloc() result.
* gdbtk/generic/gdbtk-stack.c (Gdbtk_Stack_Init): Explicit casts to ClientData
in Tcl_CreateObjCommand() calls.
* gdbtk/generic/gdbtk-varobj.c (variable_create): Variable `how_specified' is
an enum varobj_type, not an int.
* gdbtk/generic/gdbtk-wrapper.c (GDB_varobj_update): Rename argument
`explicit', as this is a C++ reserved word.
Properly cast `*changes' assignment value.
(wrap_type_print): Explicit cast of varstring initializer.
(wrap_varobj_update): Rename variable `explicit', as this is a C++ reserved
word.
* gdbtk/generic/gdbtk-wrapper.h (GDB_varobj_update): Rename argument
`explicit', as this is a C++ reserved word.
* gdbtk/generic/gdbtk.c: Unconditionally declare external Tktable_Init() as C
procedure.
* gdbtk/generic/gdbtk.h: Do not (wrongly) redeclare ptid_t.
* libgui/src/tkTable.h: Allow inclusion from a C++ source.
* libgui/src/tkTableCmd.h: Likewise.
* libgui/src/tkTableInitScript.h: Likewise.
Upgrade submodule, update code accordingly.
The gdb procedure varobj_delete() has dropped the "returned variable list"
feature, thus we can no longer use it to remove our tcl alias variables.
A new procedure variable_delete_tcl() is thus implemented to perform this
task before removing the gdb variable.
* gdbtk/generic/gdbtk_varobj.c: new procedure variable_delete_tcl().
(variable_delete): remove tcl alias variable using variable_delete_tcl().