Skip to content
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

Breakpoints are broken when compiling with /FC /d1trimfile flags #364

Open
Adarma opened this issue Nov 19, 2024 · 3 comments
Open

Breakpoints are broken when compiling with /FC /d1trimfile flags #364

Adarma opened this issue Nov 19, 2024 · 3 comments
Labels
Debugger Pertains to the debugger. Discussion A thread for discussing development.

Comments

@Adarma
Copy link

Adarma commented Nov 19, 2024

Version: 0.9.14 ALPHA [b99e102]

What paths are supposed to go in File Path Map?
I have my exe and pdb here: c:\build\.
The source code cpp files are here: c:\develop\code\

I assumed the exe path goes in Source Path and the cpp path goes in Destination Path.
Is that correct? Or maybe Source Path is for the source code path... not sure

At the moment my breakpoints are not being hit and I'm guessing this is why. Maybe I'm wrong about that though.
In a previous version I had the breakpoints working and I'm not sure what I did to break it.

Thanks

@ryanfleury
Copy link
Collaborator

The File Path Map is used to redirect paths which are referenced from within debug information, to a different local path. So for example, if I am debugging an executable which was built on another machine, and its debug info refers to a file D:/foo/bar/baz.c in its line info, but I have that file in C:/x/baz.c stored locally, the File Path Map allows me to redirect references to the former, to the latter. This will enable stepping/breakpoints in that relocated file.

Can you provide more information about how you're building & debugging? That should let me help with the breakpoints not working.

@ryanfleury ryanfleury added Discussion A thread for discussing development. Debugger Pertains to the debugger. labels Nov 19, 2024
@Adarma
Copy link
Author

Adarma commented Nov 20, 2024

I'm building from a commandline with current directory c:\develop\code.
I run vcvarsall and then compile with cl using a .bat :

<SetupStuff>
pushd ..\..\build
cl <Args> ..\develop\code\main.cpp <MoreArgs>
popd

I just tried this:

  • Unzipped 0.9.14 ALPHA to a new folder.
  • Complied with /Od and ran in the debugger.
  • Deleted everything from File Path Map.
  • Launched and then paused (Halt all attached processes). I get a message Could not find "C:\build\main.cpp.
  • Press Find alternative....
  • Select C:\develop\code\main.cpp. (It would be nice if this interface could show somewhere a reminder of the file being looked for as it is blurred out behind it).

This opens the code and has the step cursor set. I can now step over, step into, step out fine. I can click next to the line number to set a breakpoint, but if I then Resume all processes, the breakpoint is not hit and it just runs normally.

The only way I can break is with the pause.

Thanks for the development and support

@Adarma
Copy link
Author

Adarma commented Nov 24, 2024

I think I found the problem.

Above I omitted defining the specfic <ARGS> used in the build to minimise the report as I thought they were all fairly standard and irrelevant. I'd missed that I used the cl flag /FC for full path diagnostics, but also /d1trimfile:%CD%\ to strip the current directory from the __FILE__ macro.

If I remove that flag the breakpoints work again, but my __FILE__ macro values are absolute.

@Adarma Adarma changed the title File Path Map: Path Values Breakpoints are broken when compiling with /FC /d1trimfile flags Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugger Pertains to the debugger. Discussion A thread for discussing development.
Projects
None yet
Development

No branches or pull requests

2 participants