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

Debugger can't debug a file whose folder path includes a parenthesis #4030

Closed
ghost opened this issue Aug 7, 2019 · 5 comments · Fixed by microsoft/MIEngine#920
Closed
Assignees
Labels
bug debugger fixed Check the Milestone for the release in which the fix is or will be available.
Milestone

Comments

@ghost
Copy link

ghost commented Aug 7, 2019

Type: Debugger

  • OS and Version: Linux (Debian 8)
  • VS Code Version: 1.36.1
  • C/C++ Extension Version: Not sure.
  • Other extensions you installed (and if the issue persists after disabling them): Skipping this.
  • A clear and concise description of what the bug is.

The debugger can't debug a file whose folder path includes a parenthesis.

  1. Find a folder that contains C code that you want to debug.

  2. Put that folder inside another folder, and name the enclosing folder something that includes parentheses.

  3. Open the folder that contains C code that you want to debug.

  4. Configure the debugger.

  5. Set a breakpoint.

  6. Run the debugger.

In the terminal, you will get a message like the following:

$ env sh /tmp/Microsoft-MIEngine-Cmd-aceiyk8q.6a5 /tmp/Microsoft-MIEngine-Cmd-aceiyk8q.6a5: 1: /tmp/Microsoft-MIEngine-Cmd-aceiyk8q.6a5: Syntax error: "(" unexpected

If you open the file "/tmp/Microsoft-MIEngine-Cmd-aceiyk8q.6a5", you'll find:

echo $$ > /tmp/Microsoft-MIEngine-Pid-u4bxhtup.4nc ; cd <PATH_TO_PROJECT_FOLDER> ; DbgTerm=tty; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-chjq3lk8.lt0 /tmp/Microsoft-MIEngine-Out-8xgykbga.4mz /tmp/Microsoft-MIEngine-Pid-u4bxhtup.4nc /tmp/Microsoft-MIEngine-Cmd-aceiyk8q.6a5' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-chjq3lk8.lt0 > /tmp/Microsoft-MIEngine-Out-8xgykbga.4mz & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-u4bxhtup.4nc ; wait $pid;

. . . where <PATH_TO_PROJECT_FOLDER> is replaced with the path to your project folder.

  1. Observe that the path to your project folder includes a parenthesis character.

Here's my launch.json:

{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "gcc build and debug active file", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/prog", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "Skip path files", "text": "-interpreter-exec console \"skip -gfi /build/**/*\"" } ], "preLaunchTask": "make", "miDebuggerPath": "/usr/bin/gdb" } ] }

Here's my tasks.json:

{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "make", "type": "shell", "command": "make" } ] }

For now, I work around this problem by dragging the project folder to a different director, but it would be great to have this problem get solved.

Thank you.

@pieandcakes
Copy link
Contributor

To clarify, I assume you mean a folder like /foo/ba(r/baz where ba(r is one of the folder names?

@pieandcakes pieandcakes added debugger investigate: repro This issue's repro steps needs to be investigated/confirmed labels Aug 8, 2019
@pieandcakes pieandcakes self-assigned this Aug 8, 2019
@ghost
Copy link
Author

ghost commented Aug 10, 2019

Correct. Thank you for looking into this.

@pieandcakes pieandcakes added bug fixed Check the Milestone for the release in which the fix is or will be available. and removed investigate: repro This issue's repro steps needs to be investigated/confirmed labels Aug 20, 2019
@pieandcakes pieandcakes added this to the 0.25.0 milestone Aug 20, 2019
@pieandcakes
Copy link
Contributor

Fix: microsoft/MIEngine#920

@ghost
Copy link
Author

ghost commented Aug 20, 2019

Thank you!

@sean-mcmanus
Copy link
Collaborator

Should be fixed with 0.25.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger fixed Check the Milestone for the release in which the fix is or will be available.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants