Patrick Monnerat [Wed, 10 Nov 2021 14:05:35 +0000 (15:05 +0100)]
Better fix for initial source display
This properly fixes displaying 'main' upon insight startup and removes
the cygwin hack.
The reasons for the problem are:
- deprecated_file_changed_hook is not invoked anymore upon initial
executable file loading.
- Update events can be generated by gdb even if the target is not running.
Patrick Monnerat [Fri, 22 Oct 2021 16:51:03 +0000 (18:51 +0200)]
Workaround an auto_mkindex bug
Tcl auto_mkindex do indexes "public proc" declarations within classes.
As this command processes source files in alphabetic order, xxx.ith
comes after xxx.ith, resulting in a loss of the correct proc index by
overwriting the latter.
This tcl bug prevents rebuilding tclIndex properly.
As a workaround, declare such procedures inside a public block: they
wont be indexed.
Patrick Monnerat [Fri, 22 Oct 2021 11:04:13 +0000 (13:04 +0200)]
set_execution status: avoid translating a non-existent address
In some cases due to event handling order randomness, set_execution_status
may be called when target_has_execution() returns true although the target
thread has already terminated. When this occurs, the program counter is
unknown. Avoid translating it.
Patrick Monnerat [Fri, 22 Oct 2021 00:32:48 +0000 (02:32 +0200)]
Upgrade submodule, sync patch and code.
Some class member fields' type has changed from "char *" to
"gdb::unique_xmalloc_ptr<char>" in struct breakpoint and struct
watchpoint. Use get() method on them for referencing data.
Patrick Monnerat [Fri, 22 Oct 2021 00:00:35 +0000 (02:00 +0200)]
Rework itcl autoloading
Around version 4.0, Itcl stopped autoloading class methods. It however
still autoloads class constructors, providing they are implemented as
methods.
A solution would then consist in systematically declare constructors as
methods and implement them in the same file as all the other class
methods: as the constructor is always the first used class method, all
others will be already loaded when used.
This cannot be applied if a class constructor has an initialization
part: in that case, explicitly load the implementation file at the end
of the file declaring the class.
Patrick Monnerat [Tue, 19 Oct 2021 16:34:55 +0000 (18:34 +0200)]
Fix startup source window display on cygwin.
Cygwin provides a file name for the target program startup code (crt0.c),
letting to chance to display main function by default before starting the
debugging.
As a dirty hack, consider file basename set to "crt0" as if it was unset.
Function get_prompt in gdb now returns an std::string: use c_str() on
it.
Variable source_path of gdb is not a character pointer anymore, but an
std::string, so it is not possible to access it directly from a Tcl
variable. Tcl variable has thus been replaced with a getter function with
the same name.
Patrick Monnerat [Thu, 29 Jul 2021 18:00:59 +0000 (20:00 +0200)]
Upgrade submodule, sync code.
Functions get_inferior_args() and set_inferior_args(const char *) in gdb
have been replaced by inferior methods args and set_args(std::string).
Command callback function const_cfunc has been renamed into simple_func.
Command func signature has changed.
* gdbtk/generic/gdbtk-cmds.c (gdb_get_inferior_args): Use inferior
method args().
(gdb_set_inferior_args): Use inferior method set_args().
* gdbtk/generic/gdbtk-interp.c (gdbtk_do_const_cfunc): Renamed
gdbtk_do_simple_func().
Change function signature.
Calls new callback name (simple_func).
(gdbtk_interp::init): Use new names.
Patrick Monnerat [Sat, 10 Apr 2021 00:09:26 +0000 (02:09 +0200)]
Fix stop button response
Two fixes are needed:
- The merge of gdb and Tcl event loops via a notifier blocked the
handling of Tcl events while waiting for the running target to stop.
- Updates to gdb introduced the need to disable commit_resumed state
for the target while stopping it.
* gdbtk/generic/gdbtk-cmds.c (gdb_stop): temporary disable
commit_resumed while stopping target.
* gdbtk/generic/gdbtk-hooks.c (gdbtk_call_command): allow reentering
Tcl for event processing.
* gdbtk/generic/gdbtk.[ch] (gdbtk_reenter_tcl): new procedure.
Patrick Monnerat [Fri, 26 Mar 2021 07:57:35 +0000 (08:57 +0100)]
Upgrade submodule, sync patches and code.
Function current_top_target() is gone.
Rename static function fromhex() to hexdigit(), avoiding name clash.
* gdbtk/generic/gdbtk-cmds.c (gdb_entry_point): use current_inferior.
(gdb_update_mem): likewise.
(fromhex): renamed to hexdigit.
(hex2bin): use hexdigit.
* gdbtk/generic/gdbtk.c (gdbtk_start_timer): use current_inferior.
Patrick Monnerat [Fri, 30 Oct 2020 14:28:00 +0000 (15:28 +0100)]
Upgrade submodule, sync patches and code.
exec_close() and exec_bfd are now methods of program_space objects.
Function get_selected_frame_if_set() has been removed.
* gdbtk/generic/gdbtk-cmds.c (gdb_clear_file): use exec_close() method.
(gdb_loadfile): use exec_bfd() method.
* gdbtk/generic/gdbtk-stack.c (gdb_selected_frame_level):
use get_selected_frame().
Patrick Monnerat [Fri, 25 Sep 2020 16:18:31 +0000 (18:18 +0200)]
Upgrade submodule, sync patches and code + new gdb patch
Options of gdb function target_wait() are now passed as a target_wait_flags
object instead of an integer. Handling and definition of
deprecated_target_wait_hook have not been adapted accordingly (probably
because of a problematic file inclusion needed in gdb/defs.h.
The solution implemented here is to pass the object address as a void pointer
and getting the object via a pointer cast in insight's own code.
* gdbtk/generic/gdbtk-hooks.c (gdbtk_wait): options are now received as a void*.
* patches/binutils-gdb/012-target_wait_flags.patch: new gdb patch implementing
the deprecated_target_wait_hook signature described above.
Patrick Monnerat [Wed, 16 Sep 2020 17:02:48 +0000 (19:02 +0200)]
Upgrade submodule, sync patches. Add a new gdb patch.
As insight installs additional subdirectories levels into the gdb tree,
new m4 file inclusion fails for these cases. Fix this problem by using an m4
search include.
* patches/binutils-gdb/011-m4-relative-include.patch: new patch.
Patrick Monnerat [Fri, 24 Jul 2020 12:05:39 +0000 (14:05 +0200)]
Rename libgui tcl "debug" file, package, namespace and help to "debugger".
The introduction of a debug package in tcllib causes a clash with our
(older) definition. This renaming allows to run insight even if tcllib is
installed.
* gdbtk/library/debugwin.itb: rename namespace.
(DebugWin::build_win): update link to help file.
* gdbtk/library/help/debug.html: renamed as gdbtk/library/help/debugger.html
rename namespace.
* gdbtk/library/help/index.html: link to renamed file. Fix a typo.
* gdbtk/library/main.tcl: rename package and namespace.
* libgui/library/Makefile.am: rename tcl file.
* libgui/library/debug.tcl: renamed as libgui/library/debugger.tcl
rename package and namespace.
* libgui/library/pkgIndex.tcl: rename package and file.
* libgui/library/tclIndex: rename namespace and file.