Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for tilde to be present on the cwd through untildify #288

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vyeevani
Copy link

@vyeevani vyeevani commented Sep 6, 2021

Closes #287

@vyeevani vyeevani mentioned this pull request Sep 6, 2021
@vyeevani
Copy link
Author

vyeevani commented Sep 6, 2021

I’ve tested this with tilde in the cwd. Previously I’d see ‘lldb-mi’ not found errors when running the child process spawn for the debugger due to the tilde in the cwd. With this fix I no longer see that errror

package.json Outdated Show resolved Hide resolved
@GitMensch
Copy link
Collaborator

untildify is MIT-licensed as other dependencies (most important the vscode parts) are, so I assume this is fine.
As noted in the issue it would be good to either support tildes in general or not - can you please check if the calls to GDB/LMDB, the executables to debug need that (I guess the easiest option is to create a link to these in your home directory, then setup the paths using the tilde) and if the cwd arguments already internally resolves the tilde already?
If not then we should use untildify also in these places.

Note: untildify currently only works for plain ~ (on all environments including Windows), but the ~user syntax is currently not supported: sindresorhus/untildify#1 (no show stopper, just something to keep in mind)

@vyeevani
Copy link
Author

vyeevani commented Sep 6, 2021

Looks like they don’t need that. At least it seemed to work on my machine but my setup is a bit weird. I’m running this through a dap adapter in emacs. I’ve verified the name in emacs is using a relative path for the executable under debug for lldb it seems to be fine.

@@ -97,7 +98,7 @@ class GDBDebugSession extends MI2DebugSession {
this.sendErrorResponse(response, 102, `Failed to SSH: ${err.toString()}`);
});
} else {
this.miDebugger.load(args.cwd, args.target, args.arguments, args.terminal).then(() => {
this.miDebugger.load(untildify(args.cwd), args.target, args.arguments, args.terminal).then(() => {
Copy link
Owner

@WebFreak001 WebFreak001 Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this really be done in gdb/lldb.ts instead of in the mi engine? You also changed the indentation on most lines by accident.

Additionally this should probably be done on target as well for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CWD Tilde handling
3 participants