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

sourceFileMap from .vscode/launch.json not used #267

Closed
4 tasks done
milesfrain opened this issue Jun 6, 2021 · 3 comments
Closed
4 tasks done

sourceFileMap from .vscode/launch.json not used #267

milesfrain opened this issue Jun 6, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@milesfrain
Copy link

milesfrain commented Jun 6, 2021

Checklist

  • The issue is about this extension and NOT about a fork.
  • Check the known issues list.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue

Describe the bug

My launch configuration (.vscode/launch.json) contains a sourceFileMap entry, but this mapping is not used when debugging an individual test case. For example, when attempting to debug, I'll get errors like this:

Unable to open 'calc.c': Unable to read file '/proc/self/cwd/src/calc.c' (Error: Unable to resolve non-existing file '/proc/self/cwd/src/calc.c').

This error is due to bazel paths, and is fixed with the following mapping:

 `"sourceFileMap": { "/proc/self/cwd": "${workspaceFolder}" `

A workaround I found is to add sourceFileMap to testMate.cpp.test.advancedExecutables, although I don't believe that should be necessary. I'm assuming that the sourceFileMap setting should be picked-up from launch.json as described here: https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/debug.configTemplate.md

To Reproduce

An easy way to reproduce this issue is by cloning the following repo and following the steps in the readme:
https://github.com/milesfrain/bazel-googletest

If you skip the advancedExecutables setup step (but still add bazel-bin to testMate.cpp.test.executables), then you should see the same /proc/self/cwd error.

If you then configure advancedExecutables and copy the sourceFileMap setting from launch.json, then the mapping errors go away and debugging works.

Desktop

  • Extension Version: 3.6.26
  • VS Code Version: 1.56.2
  • Google Test Version: Current master
  • OS Type and Version: Ubuntu 20.04
  • Using remote-ssh/docker/wsl?: No

Log

snip-log.txt
Environment vars removed.

@matepek matepek added the enhancement New feature or request label Jun 7, 2021
@matepek
Copy link
Owner

matepek commented Jun 7, 2021

If you don't add sourceFileMap into advancedExecutables the navigation doesn't work I assume. So one should add there anyway. Therefore it might not necessary get from launch.json.

Does the navigation (jumb to test) work for you without adding sourceFileMap into advancedExecutables?

@milesfrain
Copy link
Author

Does the navigation (jumb to test) work for you without adding sourceFileMap into advancedExecutables?

Yes, jumping to tests works without the source map. I only encounter errors when attempting to debug.

@matepek
Copy link
Owner

matepek commented Nov 22, 2021

Added "unsupported" functionality in version >=4.0.2

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

No branches or pull requests

2 participants