-
Notifications
You must be signed in to change notification settings - Fork 21
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
Configuring the debugger with multiple source roots #51
Comments
To clarify as to what the issue is: the debugger actually attaches, but breakpoints never trigger. Below is the output of setting
The strange is that the files referenced in the |
Hi. I'm a fairly new maintainer to this repo, but its my intention in the coming weeks to have a look in to the code for source maps etc, since I have a similarly complex project which currently I'm struggling to get working just though debugger config (I use the debugger with source maps disabled). Would you be able to share a zip with an example so I can reproduce and I might be able to help. Also, I merged today a PR for multiple source roots (Using the debugger config localRoots). I wonder if you can pull master and try that to see if it fixes your issue. |
Also, I'd be interested to see your debugger 'hacks' - it might help my own debugging with these issues and give some ideas for changes, so if you don't mind please push to a fork, it doesn't matter how ugly the changes are :) |
I'm going to try and take some time to clean up the changes before getting them to you... I just realized they were made against a really old version of this repository (0.4.1). |
I pushed out an extension update to the marketplace the other day so maybe give that a try as well and see if it helps for your use case. |
I'm seeing the same issue as the OP This is my launch json
and this is the sort of log I see when I try and enable a breakpoint
My debug code is pretty vanilla, so it should't be any local changes - I've put as many breakpoints inside the c++ code as I can (inside duktape itself and the transport code), and it never hits - it looks like it's failing here: https://github.com/harold-b/vscode-duktape-debug/blob/master/src/DukDebugger.ts#L817 It looks like it's trying to match up the true filename I think the option for multiple roots is fairly recent (it wasn't in the 0.4 release) so I'm guessing the new code added for that is incomplete, so isn't properly looping over all the roots trying to resolve the relative path |
I had a coworker take a look at our issue, and she noticed a few things:
...to (only the 'if' condition changed)...
These were the minimal set of changes required in order for the debugger to work with my build. I don't really know how to proceed, as I'm not really a real TypeScript nor source mapping expert, but I figured I'd share this information with you. Does anyone know how that |
+ Updated package/package-lock + Implemented new path logic from aserra54 for `unmapSourceFile`
I've pushed out an update to the market place with @chsimp's fix merged. Please let me know if this fixes the issue and I'll close this, but if not I plan to push a new update to the marketplace with much more logging of file paths and filenames within the week which will hopefully help to diagnose these issues. |
I'll have him test it out as soon as possible (I work with him), but I don't believe that solves the |
Thanks @aserra54. I've just pushed out an update (0.5.4) which is an attempt to make the current path resolution logic a bit more robust. Please let me know if this fixes anything for you. |
Also, I pushed out v0.5.5 which I hope also fixes the issue with |
Hi @andrewrch , I'm working on the same team as @aserra54 and @chsimp . I've attempted to use the new version of the debugger with our current repository structure. In fact since this ticket was opened we re-organized our repository structure to have all the folders under the same root as follows: -src I seem to still be struggling to get the debugger to hit breakpoints:
I've tested this with vs-code 1.39.2 and 1.40.2. Do you have any suggestions? |
How do you pass the paths to duktape? I'm assuming it is embedded in a framework, so check how the paths are being passed to duktape when you compile the source (check the filename and directory prefix). I'd recommend turning on debug logs for the debugger and seeing what paths are printed with the latest version. Duktape will only hit the breakpoints if the paths passed from vscode match the paths you've passed to duktape. When using source maps, it'll try to read the source map and get the file path... I would probably try just using If your duktape is running on a remote with a different path prefix you can use the 'dukRemoteRoot' option, or use this option if you're running from a different location and there is a directory prefix you need to prepend. |
Hello,
I have a TypeScript project with the below directory structure (stripped down for brevity):
The rationale behind the layout is that everything under the base
src
directory corresponds to the API of the project, while everything undersamples
correspond to very specific examples indicating how to use the API. Each sample has asrc
directory containing TypeScript source files, and a correspondingtsconfig.json
. Thosetsconfig.json
files look as follows (again, stripped down for brevity):Specifically, we use the
baseUrl
andpaths
compiler options to reference the source code both in the sample (./*
) and the API (../../../src/*
) directories. Using this, the output directory (../../build/out-tsc/sample1
) winds up looking something:In light of this, what's the proper way to configure this debugger to work with this setup? I've tried a number of things to no avail, and I guess it boils down to my misunderstanding of some of the properties. Specifically, I have this in my
launch.json
:But I don't see how this can make sense.
outDir
points to the root of thesample1
output, but the source files in that directory are spread out in two different sub-directories (at odd locations no less).I've hacked the debugger to get this setup to work by using multiple search paths for searching for files, but it isn't production quality (or really sustainable). I'm also wondering if I even need to hack the debugger, or if this is something that could be supported with the current debugger implementation.
So... any ideas? I'm also open (to a certain degree) to changing my directory structures if necessary. Any help would be appreciated.
(Please consider that I'm not really a Node developer, so if any of the above looks odd or non-standard, it wasn't intentional.)
The text was updated successfully, but these errors were encountered: