rogalmic / vscode-bash-debug

Bash shell debugger extension for VSCode (based on bashdb)
MIT License
217 stars 26 forks source link

How can I debug a called subscript? #148

Closed serbenet closed 3 years ago

serbenet commented 3 years ago

Hi,

"Step into" does not seem to work when another subscript is called. The subscript is simply simply ran and the debugger does not step into it. Is there a way to cause the second script to also run in the debugger?

Thanks in advance

Serbenet

rogalmic commented 3 years ago

Are you using bash "source" keyword? Dot (.) is also short for source...

serbenet commented 3 years ago

No I am not using the source keyword.

rogalmic commented 3 years ago

Step into works only for scripts called with source keyword. Calling script directly will start separate process.

serbenet commented 3 years ago

To me this is a major limitation since calling subscripts is a very common practice in bash scripts. And not being able to debug those subscripts is limiting the interest of this extension. If somehow, this could be addressed in a future version, this would be great.

Thanks

rogalmic commented 3 years ago

Like explained, the only way to debug subscript is to call it following way inside your script: "source ./subscript. sh"

There is no technical way to debug separate bash subprocess.