SNSystems / dexter

DExTer - Debug Experience Tester
MIT License
33 stars 6 forks source link

Dexter can't identify when it's stepped into the right source files #72

Open jmorse opened 5 years ago

jmorse commented 5 years ago

I have a problem with this code [0], which seems to be designed to make the debugger "continue" if we're not yet in a correct source file. On windows under dbgeng, step_info.current_location.path is

 c:\users\jmorse\source\debuginfo-tests\dexter-tests\hello.c

And self.context.options.source_files is

['C:\\Users\\gbmorsej\\source\\o\\debuginfo-tests\\dexter-tests\\hello.c']

Which are two very different strings. The symptom is that dbgeng doesn't implement "go"; but even if it did, this would still be broken.

Ultimately I don't think we should be trying to resolve the paths that the debugger coughs up into paths on the actual filesystem -- or if we do, we should make that the debugger drivers problem, not generic code.

[0] https://github.com/SNSystems/dexter/blob/861102e88937c5a2000b8bf02362dee45371bcdd/dex/debugger/DebuggerBase.py#L158

jmorse commented 5 years ago

Aaaannnddd, this turns out to be necessary for things like lldb to not be infinitely stepping through the implementation of printf and the like. So this portion of code does need to be sticking around.

gregbedwell commented 5 years ago

We should probably call os.path.normpath in that code that you highlighted to make sure that when comparing paths we're actually comparing like for like.

jmorse commented 5 years ago

Ah, that might be a better / more general fix, I'll try that