bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.75k stars 479 forks source link

Source code accessibility #327

Closed CaptainHook8 closed 8 months ago

CaptainHook8 commented 8 months ago

Hello! I am on Windows and added backward.cpp to my project; on my build machine (where my source code is present) I am able to display the nice code snippets on throwing an exception. If i move my binary, obviously compiled in Debug, to another machine, I am just able to display the really basic stack trace, I guess because source code is missing.

So, what do I have to do to display the nice source related stack trace? Where do I have to put the sources on the target machine? I tried to place the sources on the same path as the build machine, but that didn't help.

Thanks!

bombela commented 8 months ago

Yes the source files must be accessible. The path to the source files within the debug info is most likely configured by flags you pass to your compiler. That's how it is with gcc/clang for example.

On Mon, Jan 22, 2024, 09:51 Pasquale Marino @.***> wrote:

Hello! I am on Windows and added backward.cpp to my project; on my build machine (where my source code is present) I am able to display the nice code snippets on throwing an exception. If i move my binary, obviously compiled in Debug, to another machine, I am just able to display the really basic stack trace, I guess because source code is missing.

So, what do I have to do to display the nice source related stack trace? Where do I have to put the sources on the target machine? I tried to place the sources on the same path as he build machine, but that didn't help.

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/bombela/backward-cpp/issues/327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABUZDH3JC5ESQZX6DFXAWLYPYSAHAVCNFSM6AAAAABCEZ7YHGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4TGMZZGEZDOMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

CaptainHook8 commented 8 months ago

Hello @bombela and thanks for your feedback. I think the problem might be I am not transferring the .pdb file along with the binary on the target machine. I will try and let you know.

CaptainHook8 commented 8 months ago

Hello @bombela and thanks for your feedback. I think the problem might be I am not transferring the .pdb file along with the binary on the target machine. I will try and let you know.

Yeah, that was it!