dseight / vscode-disasexpl

Disassembly Explorer for VS Code
MIT License
48 stars 11 forks source link

workspaceFolder variable not working correctly in settings #3

Closed HorstBaerbel closed 5 years ago

HorstBaerbel commented 5 years ago

Thanks for the possibly nice extension. I have a problem though. I'm compiling with CMake and I use this in settings:

"disasexpl.associations": {
        "**/*.c": "${workspaceFolder}/build/${fileBasenameNoExtension}.s",
        "**/*.cpp": "${workspaceFolder}/build/${fileBasenameNoExtension}.s"
    },

Now when I run the show command, the path of the .s-file is missing the last directory (/foo/build vs. /foo/bar/build), so it opens with an error. When I add the directory manually the file opens fine.

HorstBaerbel commented 3 years ago

I'm just revisiting the extension... Thanks for the fix, but this is not sufficient for my CMake builds. A usual out-of-dir build will save the files according to their subfolder into the build folder (so ${workspaceFolder}/src/subdir/file.cpp ${workspaceFolder}/build/src/subdir/file.s), so ${fileDirname} or ${workspaceFolder} are not working. ${relativeFile} is not working either, because I need to replace the extension by ".s". What would work is using the variables from the cmake extension:

${command:cmake.buildDirectory}/${relativeFileBasenameNoExtension}.s

If that's not possible relativeFileBasenameNoExtension would be helpful...

Here are the docs for the CMake variables: https://github.com/microsoft/vscode-cmake-tools/blob/729a749afcb1e25d181ee74ebe0345d04cdd1636/docs/cmake-settings.md and: https://vector-of-bool.github.io/docs/vscode-cmake-tools/settings.html

HorstBaerbel commented 3 years ago

Dumb me got this working with: ${workspaceFolder}/.o/${relativeFileDir}/${fileBasenameNoExtension}.s ;) Well, almost, because CMake + GCC -save-temps dumps the .s files a seemingly random base dir, depending on project and subdir :/