{"action":"created","issue":{"url":"https://api.github.com/repos/harold-b/vscode-duktape-debug/issues/8","repository_url":"https://api.github.com/repos/harold-b/vscode-duktape-debug","labels_url":"https://api.github.com/repos/harold-b/vscode-duktape-debug/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/harold-b/vscode-duktape-debug/issues/8/comments","events_url":"https://api.github.com/repos/harold-b/vscode-duktape-debug/issues/8/events","html_url":"https://github.com/harold-b/vscode-duktape-debug/issues/8","id":194777308,"number":8,"title":"Source unknown when debugging","user":{"login":"AndreyArsov","id":9951845,"avatar_url":"https://avatars.githubusercontent.com/u/9951845?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreyArsov","html_url":"https://github.com/AndreyArsov","followers_url":"https://api.github.com/users/AndreyArsov/followers","following_url":"https://api.github.com/users/AndreyArsov/following{/other_user}","gists_url":"https://api.github.com/users/AndreyArsov/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreyArsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreyArsov/subscriptions","organizations_url":"https://api.github.com/users/AndreyArsov/orgs","repos_url":"https://api.github.com/users/AndreyArsov/repos","events_url":"https://api.github.com/users/AndreyArsov/events{/privacy}","received_events_url":"https://api.github.com/users/AndreyArsov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-10T16:26:12Z","updated_at":"2016-12-11T03:31:55Z","closed_at":null,"body":"OK, being able to connect, pause the debugger and see the local variable and add watches.\r\nStill however cannot get the sources to show, when I pause I get \"Source Unknown Source Unavailable\" in the file window, and in the stack I see the functions being called, but get \"\\undefined\\Source Unavailable\" tooltip.\r\nObviously I am doing something wrong, but cannot figure out what.\r\nTried switching the the following code:\r\n#if 0\r\n    if (duk_peval_string(ctx, js.c_str()) != 0) {\r\n        printf(\"eval failed: %s\\n\", duk_safe_to_string(ctx, -1));\r\n        exit(-1);\r\n    }\r\n#else\r\n    duk_push_string(ctx, \"input.js\");\r\n    duk_compile_string_filename(ctx, 0, js.c_str(), );\r\n\r\n    duk_push_global_object(ctx);\r\n    duk_call_method(ctx, 0);\r\n#endif\r\nSo that the execution environment knows about the filename, and I have the same file open VSCode, but nothing help.\r\nAny pointers appreciated.\r\n\r\nAlso Harold I see that the print statements are forwarded to the debugger in your demo, how does that work?\r\n\r\nThanks, Andrey.\r\n"},"comment":{"url":"https://api.github.com/repos/harold-b/vscode-duktape-debug/issues/comments/266258436","html_url":"https://github.com/harold-b/vscode-duktape-debug/issues/8#issuecomment-266258436","issue_url":"https://api.github.com/repos/harold-b/vscode-duktape-debug/issues/8","id":266258436,"user":{"login":"harold-b","id":11462418,"avatar_url":"https://avatars.githubusercontent.com/u/11462418?v=3","gravatar_id":"","url":"https://api.github.com/users/harold-b","html_url":"https://github.com/harold-b","followers_url":"https://api.github.com/users/harold-b/followers","following_url":"https://api.github.com/users/harold-b/following{/other_user}","gists_url":"https://api.github.com/users/harold-b/gists{/gist_id}","starred_url":"https://api.github.com/users/harold-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harold-b/subscriptions","organizations_url":"https://api.github.com/users/harold-b/orgs","repos_url":"https://api.github.com/users/harold-b/repos","events_url":"https://api.github.com/users/harold-b/events{/privacy}","received_events_url":"https://api.github.com/users/harold-b/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T03:31:55Z","updated_at":"2016-12-11T03:31:55Z","body":"Would you add the `\"debugLog\" : true` option to your *launch.json* to see what the incoming \"Pause\" notification look like? They contain the name of the file being debugged so this can be compared with the client's source tree.\r\n\r\nI assume you have local root set to something like this: `\"localRoot\" : \"${workspaceRoot}\"`?\r\nIf the file name from the \"Pause\" notification matches the subpath of the file locally from `localRoot` then it's potentially a bug.\r\n\r\nAs for the print statements, make sure you have the following macros defined in your runtime:\r\n\r\n``` cpp\r\n#define DUK_USE_DEBUGGER_FWD_LOGGING\r\n#define DUK_USE_DEBUGGER_FWD_PRINTALERT\r\n```\r\n\r\nYou can also define `DUK_USE_DEBUGGER_PAUSE_UNCAUGHT` to catch uncaught exceptions on the debugger (pretty sure this was fully implemented...can't quite recall though...)\r\n\r\nLet me know if that helps."}}
{"actor":{"display_login":"harold-b"}}