I am having issue with properly setting breakpoint using full path, see following outputs from build 91.
** Expecting one filename parameter, Got 3.
bashdb<24> load "/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh"
** Expecting one filename parameter, Got 3.
bashdb<25> load '/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh'
** Expecting one filename parameter, Got 3.
bashdb<26> load `/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh`
** Expecting one filename parameter, Got 3.
bashdb<27> load `/mnt/c/Users/[aaa]/Documents/src/vscode-bash\ debug/tes-t\ me/test.sh`
** Expecting one filename parameter, Got 3.
bashdb<28> load (/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh)
** Expecting one filename parameter, Got 3.
bashdb<13> load "/mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/aaa.sh"
File loaded.
bashdb<14> info files
Source files which we have recorded info about:
/mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/test.sh: /mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/test.sh, 1 lines
bashdb<15> break /mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/aaa.sh:3
** File "" not found in read-in files.
** See 'info files' for a list of known files and
** 'load' to read in a file.
The space handling issue is present in build 94 as well, while I am not sure about "-" in path.
Seems to be related to load command argument parsing.
Debugger parsing of any sort of text that has an implied space in it has problems in bashdb.
I don't have a good solution for it and can't spend the time to work on this. If you or others want to work on this I'll try make time to try to help.
Last edit: Rocky Bernstein 2018-08-22
I would assume the issue comes from processor.sh line 149:
The info about separate arguments is lost in single string + it seems that there is no simple fix for that, since the "Dbg_input_desc" would require some better interpretation then just separating via IFS.
Maybe allownig octal character codes via escape character \ would serve as proper workaround? ("\000")
I think you are correct that the
readloses the string boundaries.If you want to see if you can work op a solution around using an escape character, go for it and put in a patch or whatever the sourceforge equivalant of a github pull request is.
Last edit: Rocky Bernstein 2018-08-22
Created initial changes, please take a look at newest commit:
https://sourceforge.net/u/rogalmic/bashdb/commit_browser
I have no idea how to create proper merge request here...
Thanks. I will try to check that code, test it and merge it if it is fine.
In commit 91e8afa , I took the changes from filecache.sh and load.sh, however we can't use the processor.sh changes as is: sometimes we want the string interpolation and sometimes we don't.
What I've done in other debuggers is keep two copies of the read-in line: one that is "raw" and one that isn't. Then in those commands where there could be a raw string needed, such as break or load, the passed in command arguments are ignored and special parsing is done on the raw string.
You'll know if you succeed if you can run
make checkand all of the tests succeed.Last edit: Rocky Bernstein 2018-08-22
I am wondering how to do that. When i checked with original code, the "\" was beeing removed without the "-r" option in read.
Do you propose to have a "if" only for break and load during read? It cannot be done lower in stack, because of the missing "\" after read.
Perhaps there could be some mode in debugger that enables the raw operation ? Or is the "-r" breaking the core functionality?
I was suggesting
$_Dbg_cmd_raw_Dbg_cmdandargs.command/load.shfind the end of where the string "load" and trailing space end. And then use the part of$_Dbg_cmd_rawafter the space for the file name.I should also mention that if bahsdb-supplied builtin
readc(a readline completing read) is used, things might get more compilcated.After quick test maybe we do not need more changes - double "\\040" seems to do the trick (first for read, then for actual octal char code).
I will verify this tomorrow.
Last edit: Michał Rogaliński 2018-08-22
Seems to be working with double backslash + octal char code, i see no need to preceed with "-r" option in read.
Ok. I would be grateful if you would update the documentation in the code to suggest how to do what you just figured out. For example perhaps extending the documentation in "load.sh" line 25 might do it for load.
In other debuggers I have created a "help" directory in the commands folder and have category information like syntax used in command in general. See for example https://github.com/rocky/python3-trepan/tree/master/trepan/processor/command/help
But this would mean extending the code in help.sh and I don't have the time or need to do this.
Please take a look at my new commit:
https://sourceforge.net/u/rogalmic/bashdb/commit_browser
This should be enough to explain this "almost accidental" feature :).
Looks great! Would you do the same for the "breakpoint" command?
If this repo is clean of things outside of this, I'll clone it and merge it
sometime over the weekend.
On Thu, Aug 23, 2018 at 7:47 AM, "Michał Rogaliński" rogalmic@users.sourceforge.net wrote:
Related
Bugs:
#54Did the same for break.sh:
https://sourceforge.net/u/rogalmic/bashdb/commit_browser
Great - thanks! I'll pick up the changes from the repo over the weekend.
On Thu, Aug 23, 2018 at 9:00 AM, "Michał Rogaliński" rogalmic@users.sourceforge.net wrote:
Related
Bugs:
#54Found additional small issue when showing bactrace and path has multiple spaces in bath:
https://sourceforge.net/u/rogalmic/bashdb/ci/bdb0836764b24d783de564470b2604e52760fd37/
I think this fix is trivial and could also be taken.
Merge now done. However note that your branch was not clean and it is now
out of date.
Specifically see
https://sourceforge.net/u/rogalmic/bashdb/ci/master/tree/lib/processor.sh#l154
So either remove that, or refresh it, or I won't pull from that in the
future.
On Fri, Aug 24, 2018 at 11:47 AM, "Michał Rogaliński" rogalmic@users.sourceforge.net wrote:
Related
Bugs:
#54Great, thank you for your help. I will reset my git fork...