Trepan-Debuggers / zshdb

gdb-like "trepan" debugger for zsh
GNU General Public License v3.0
295 stars 23 forks source link

Improve handling of info subcommands and fix support for `info stack` #51

Closed jansorg closed 11 months ago

jansorg commented 11 months ago

This PR improves the info command and handling of its subcommands.

The original code passed a $label arg to the sub command, it was set to typeset label=$2 and the sub commands were then invoked with ${_Dbg_debugger_info_commands[$info_cmd]} $label "$@". If I understand the code correctly, then this turned info variables integer into ${_Dbg_debugger_info_commands["variables"]} "integer" "variables" "integer". With this PR info sub commands are invoked without the name of the subcommand. Several sub command source files were adjusted to use the new argument values.

To Do:

info stack before this PR:

zshdb<2> info stack
->0 in file `/home/jansorg/test.zsh' at line 4

info stack with this PR:

zshdb<2> info stack
->0 in file `/home/jansorg/test.zsh' at line 4
##1 inner called from file `/home/jansorg/test.zsh' at line 8
##2 outer called from file `/home/jansorg/test.zsh' at line 11
##3 /home/jansorg/test.zsh called from file `./zshdb' at line 141
rocky commented 11 months ago

@jansorg I am okay with merging this as is and doing the todo as another PR or waiting for everything to be done and then merging. Your choice.

As for things being out of sync, yes, that has been a persistent problem. There could have been one repository with different branches that don't get merged which is what I do in some other projects. Given though the history of this where one started on sourceforge in SVN before git was around, things ended up this way.

With branches there is always the problem of an inadvertent merge.

I may have said this before, but if you want to be able to commit directly to this repository let me know.

jansorg commented 11 months ago

If possible, I'd like this to be merged. There are a few open pull requests now and merging them would help to work on follow-up changes. If you don't mind, write-access would be great -- I'll be careful with my commits :)

rocky commented 11 months ago

You should have an invitation to join the repository now.