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

Godot not printing stack trace numbers in exported C# projects (both debug and release) #51307

Open
janavarro95 opened this issue Aug 6, 2021 · 2 comments

Comments

@janavarro95
Copy link

janavarro95 commented Aug 6, 2021

Godot version

v3.3.2.stable.mono.official

System information

Windows 10

Issue description

Additional Tools:
Visual Studios Community Edition 2019
Godot Editor Build Tool: MSBuild (VS Build Tool)

When exporting projects in Godot, I've attempted to print the current stack trace of the program for debugging purposes for the builds I am running. The reason for this is that if there is an error, a player or modder can send me a bug report with the attached log so that I can discover what the issue might be in my code since I am still in the early stages of development.

I do the following

//using C#
GD.print("HelloWorld" + System.Environment.StackTrace.toString());

but always end up with an issue where in the editor I am able to get the line and file number of the stack trace, but the exported builds, both in debug and release modes, always show the compiler generated symbols.

//Produces the following in the Godot Editor.
"Hello World! at Curator.Game._Ready () [0x001ad] in C:\GodotProjects\Curator\Curator\Game.cs:152"
//Produces the following in any exported build (both debug and release options)
"Hello World! at Curator.Game._Ready () [0x00000] in <c3d7c8d8d5ab4571963f9ed8f1449e22>:0"

Adding the following PropertyGroup setting to my .csproj file for all combinations of $(Configuration)|$(Platform) (as suggested by (https://github.com/godotengine/godot/issues/14822)) does nothing for the exported builds as well unfortunately.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
  <DebugType>Portable</DebugType>
</PropertyGroup>

Attempting to copy over the .pdb file over into the export directory (the same where the .exe resides on windows after export) also does not seem to change the situation at all.

I've attached a simple project reproducing the steps, where running it in the editor displays stack trace line numbers, but running an exported build (I've only been able to test on windows unfortunately) has the compiler symbols.

Understandable if this is not an option available to Release exports, but should this be enabled for Debug exports then?

Steps to reproduce

  1. Make a new c# script.
  2. Call GD.Print(System.Environment.StackTrace.toString());
  3. Verify stacktrace line numbers/file name show up in log when running.
  4. Export project
  5. Run exported executable in debug mode.
  6. Verify that stack trace line numbers are no longer valid.

Minimal reproduction project

StackTraceNoLineNumbers.zip

@Calinou Calinou changed the title Godot not printing stack trace numbers in exported builds. Godot not printing stack trace numbers in exported C# projects (both debug and release) Aug 6, 2021
@Calinou
Copy link
Member

Calinou commented Aug 6, 2021

cc @neikeq

@neikeq neikeq self-assigned this Aug 6, 2021
@mhilbrunner mhilbrunner added this to the 3.x milestone Oct 19, 2022
@Ridleh
Copy link

Ridleh commented Feb 9, 2024

I am experiencing the same issue and the above solution doesnt work for me as well. Are there any other known workarounds?

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

No branches or pull requests

5 participants