-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs: add LLDB crash workaround and issue reference #13704
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
base: main
Are you sure you want to change the base?
Changes from all commits
22cfeb9
29bab77
742c4ca
39e3f80
35d1166
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.apple.xcode.dsym.a.out</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>dSYM</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
triple: 'arm64-apple-darwin' | ||
binary-path: a.out | ||
relocations: [] | ||
... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,5 +54,5 @@ int main(int argc, char **argv) | |
|
||
std::cout << "All threads exited!" << std::endl; | ||
|
||
return 1; | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
void * thread_proc(void* ctx); | ||
#ifndef THREAD_H | ||
#define THREAD_H | ||
|
||
void* thread_proc(void* ctx); | ||
|
||
#endif // THREAD_H |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You seem to be replacing the extension's launch.json (which we use to launch the extension for debugging), with a native C++ launch.json for the Fib sample. I assume this is not intended to be included in the PR. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,143 +1,26 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
{ | ||
"version": "0.1.0", | ||
"configurations": [ | ||
{ | ||
// debugs the extension | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--no-sandbox", | ||
"--disable-updates", | ||
"--skip-welcome", | ||
"--skip-release-notes", | ||
"--disable-workspace-trust", | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
], | ||
"sourceMaps": true, | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**" | ||
], | ||
// you can use a watch task as a prelaunch task and it works like you'd want it to. | ||
"preLaunchTask": "watch" | ||
}, | ||
{ | ||
// debugs the extension (selecting the workspace) | ||
"name": "Run Extension-Select Workspace", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--no-sandbox", | ||
"--disable-updates", | ||
"--skip-welcome", | ||
"--skip-release-notes", | ||
"--disable-workspace-trust", | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"${input:pickWorkspace}" | ||
], | ||
"sourceMaps": true, | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**" | ||
], | ||
// you can use a watch task as a prelaunch task and it works like you'd want it to. | ||
"preLaunchTask": "watch" | ||
}, | ||
{ | ||
// debug scenario tests (selecting the workspace) | ||
"name": "VSCode Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"env": { | ||
"SCENARIO": "${input:pickScenario}" | ||
}, | ||
"args": [ | ||
"--no-sandbox", | ||
"--disable-updates", | ||
"--skip-welcome", | ||
"--skip-release-notes", | ||
"--disable-extensions", | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--extensionTestsPath=${workspaceFolder}/dist/test/common/selectTests", | ||
"--scenario=${input:pickScenario}", | ||
"${input:pickScenario}" | ||
], | ||
"sourceMaps": true, | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**" | ||
], | ||
// you can use a watch task as a prelaunch task and it works like you'd want it to. | ||
"preLaunchTask": "watch" | ||
}, | ||
{ | ||
// used for debugging unit tests | ||
"name": "MochaTest", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 9229, | ||
"continueOnAttach": true, | ||
"autoAttachChildProcesses": false, | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**", | ||
"!**/node_modules/**" | ||
] | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"type": "pickString", | ||
"id": "pickScenario", | ||
"description": "Select which scenario to debug VSCode tests.", | ||
"options": [ | ||
{ | ||
"label": "MultirootDeadlockTest ", | ||
"value": "${workspaceFolder}/test/scenarios/MultirootDeadlockTest/assets/test.code-workspace" | ||
}, | ||
{ | ||
"label": "SimpleCppProject ", | ||
"value": "${workspaceFolder}/test/scenarios/SimpleCppProject/assets/simpleCppProject.code-workspace" | ||
}, | ||
{ | ||
"label": "SingleRootProject ", | ||
"value": "${workspaceFolder}/test/scenarios/SingleRootProject/assets/" | ||
}, | ||
{ | ||
"label": "CompilerDetection ", | ||
"value": "${workspaceFolder}/test/scenarios/CompilerDetection/assets" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "pickString", | ||
"id": "pickWorkspace", | ||
"description": "Select which workspace scenario to debug VSCode.", | ||
"default": "-n", | ||
"options": [ | ||
{ | ||
"label": "(Debug with new window) ", | ||
"value": "-n" | ||
}, | ||
{ | ||
"label": "MultirootDeadlockTest ", | ||
"value": "${workspaceFolder}/test/scenarios/MultirootDeadlockTest/assets/test.code-workspace" | ||
}, | ||
{ | ||
"label": "SimpleCppProject ", | ||
"value": "${workspaceFolder}/test/scenarios/SimpleCppProject/assets/simpleCppProject.code-workspace" | ||
}, | ||
{ | ||
"label": "SingleRootProject ", | ||
"value": "${workspaceFolder}/test/scenarios/SingleRootProject/assets/" | ||
}, | ||
{ | ||
"label": "CompilerDetection ", | ||
"value": "${workspaceFolder}/test/scenarios/CompilerDetection/assets" | ||
} | ||
] | ||
} | ||
] | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/a.out", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "lldb" | ||
}, | ||
{ | ||
"name": "Attach to a.out", | ||
"type": "cppdbg", | ||
"request": "attach", | ||
"program": "${workspaceFolder}/Code Samples/Fib/a.out", | ||
"processId": "${command:pickProcess}", | ||
"MIMode": "lldb", | ||
"stopAtEntry": false | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,13 @@ abstract class AbstractDebugAdapterDescriptorFactory implements vscode.DebugAdap | |
export class CppdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterDescriptorFactory { | ||
|
||
async createDebugAdapterDescriptor(_session: vscode.DebugSession, _executable?: vscode.DebugAdapterExecutable): Promise<vscode.DebugAdapterDescriptor> { | ||
const adapter: string = "./debugAdapters/bin/OpenDebugAD7" + (os.platform() === 'win32' ? ".exe" : ""); | ||
// Updated adapter path (adjust if your binary moved) | ||
const adapter: string = "./out/debugAdapters/OpenDebugAD7" + (os.platform() === 'win32' ? ".exe" : ""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is |
||
|
||
const command: string = path.join(this.context.extensionPath, adapter); | ||
|
||
return new vscode.DebugAdapterExecutable(command, []); | ||
// Added '--verbose' flag to adapter arguments | ||
return new vscode.DebugAdapterExecutable(command, ['--verbose']); | ||
} | ||
} | ||
|
||
|
@@ -43,6 +45,7 @@ export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterD | |
void vscode.window.showErrorMessage(localize("debugger.not.available", "Debugger type '{0}' is not available for non-Windows machines.", "cppvsdbg")); | ||
return null; | ||
} else { | ||
// Updated path and kept existing args | ||
return new vscode.DebugAdapterExecutable( | ||
path.join(this.context.extensionPath, './debugAdapters/vsdbg/bin/vsdbg.exe'), | ||
['--interpreter=vscode', '--extConfigDir=%USERPROFILE%\\.cppvsdbg\\extensions'] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,19 @@ File questions, issues, or feature requests for the extension. | |
<br> | ||
|
||
**[Known issues](https://github.com/Microsoft/vscode-cpptools/issues)** | ||
## Debugging with LLDB (macOS/Linux) | ||
|
||
Some users may encounter a crash (exit code 139) when using LLDB with this extension on macOS or Linux platforms. | ||
|
||
> 🛠️ **Fix:** This issue has been investigated and addressed. See [Issue #13496](https://github.com/microsoft/vscode-cpptools/issues/13496) for full details. | ||
> ✅ A fix is proposed in [Pull Request](https://github.com/microsoft/vscode-cpptools/compare/microsoft:vscode-cpptools:main...Subham-KRLX:vscode-cpptools:fix/llcdbg-crash?diff=unified&w). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @Subham-KRLX . This 'fix proposed in' link appears to refer to this same PR. (?) Also the issue you're referring to is still open and does not appear to be addressed. Could you clarify the root cause of the issue and potential fix? I think we would prefer to implement a fix over temporarily updating the README to refer to a pending fix. Has the potential issue in LLDB been investigated? |
||
|
||
Make sure you are using: | ||
- A compatible LLDB version (`lldb --version`) | ||
- The latest version of the extension | ||
|
||
This helps prevent crashes during C++ debugging on Unix-based systems. | ||
|
||
<br> | ||
If someone has already filed an issue that encompasses your feedback, please leave a 👍 or 👎 reaction on the issue to upvote or downvote it to help us prioritize the issue. | ||
<br> | ||
|
@@ -79,4 +92,5 @@ The software may collect information about you and your use of the software and | |
|
||
## Trademarks | ||
|
||
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. | ||
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming that everything here related to 'a.out' is the result of building locally and should not be in the PR.