Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Make stacktrace handling of missing files more robust #145

Merged
merged 1 commit into from
May 3, 2017

Conversation

simonomis
Copy link

Improves the handling when files referenced in the stacktrace aren't available where vscode is running. Addresses two issues that were causing the debugger to throw an exception (and so fail to provide the call stack and current position) when debugging a rails app within a docker container:

  • The rails app ran within the /app directory in the container, so files such as /usr/local/lib/gems/railties-3.0.20/lib/rails/application.rb weren't being filtered out by the check on line 259, which resulted in an exception when attempting to read the file (as the file only exists within the docker container)
  • One stack frame reported by rdebug-ide had a line number of 0, which caused an exception when trying to get the line from the array (on line 275).

This PR changes the logic so that missing files aren't filtered out, because it's still useful to be able to see the stackframe even if you can't see the code. Instead, they are included as "filename:linenum", like this: actionpack-3.0.20/lib/action_controller/base.rb:150 (Unknown Source:150) (the gems directory path is stripped off to make it easier to read).

Make sure these boxes are checked before submitting your PR -- thanks in advance!

@simonomis
Copy link
Author

Let me know if you want some help testing this. I reckon it should be possible to do it locally without needing docker, but I haven't tried yet.

@rebornix
Copy link
Member

rebornix commented May 3, 2017

Thanks @simonomis it looks awesome!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants