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

Stack traces inside Mono do not show file/line numbers. #14822

Closed
PJB3005 opened this issue Dec 19, 2017 · 17 comments
Closed

Stack traces inside Mono do not show file/line numbers. #14822

PJB3005 opened this issue Dec 19, 2017 · 17 comments

Comments

@PJB3005
Copy link
Contributor

PJB3005 commented Dec 19, 2017

Godot version:
652c98a

OS/device including version:
Windows 10 Pro 64-bit, Mono 5.4.1

Issue description:
Mono doesn't seem to be ran in debug mode, so if you get an exception, the file will just be something like this: <abcbe92421df45dd9c0b29a6fa712911>:0. You have to pass --debug to the mono command line to run it in debug mode, but you can't really do that when it's embedded inside Godot.

Steps to reproduce:

  1. Make a new C# script.
  2. Make it throw an exception.
  3. Try printing the exception stack trace.
public class Thrower : Node
{
    public override void _Ready()
    {
        try
        {
            throw new Exception("whoopsie!");
        }
        catch (Exception e)
        {
            GD.Print($"Uh oh: {e}");
        }
    }
}
@akien-mga
Copy link
Member

cc @neikeq

@mhilbrunner
Copy link
Member

mhilbrunner commented Dec 19, 2017

Duplicate of #14589 (although that is a little hard to find)

Edit: But yeah, this one makes using C# quite hard :(

@akien-mga
Copy link
Member

Closing as duplicate of #14589 then, but I'll edit that one to add more details from this one.

@neikeq
Copy link
Contributor

neikeq commented Dec 19, 2017

Not a duplicate of #14589. I think --debug shouldn't be needed, but I'll check when I'm back.

@neikeq neikeq reopened this Dec 19, 2017
@neikeq neikeq removed the archived label Dec 19, 2017
@PJB3005
Copy link
Contributor Author

PJB3005 commented Dec 19, 2017 via email

@PJB3005
Copy link
Contributor Author

PJB3005 commented Dec 21, 2017

Commenting what I accidentally said in the other issue:

This seems to be broken on Windows, but I've had no problem with it on MacOS. Might be related.

@neikeq
Copy link
Contributor

neikeq commented Dec 28, 2017

Just tested and couldn't reproduce this on Linux, so this seems to be Windows only. I can't test on Windows right now though.

@neikeq
Copy link
Contributor

neikeq commented Dec 28, 2017

Could it be because we are using System MSBuild instead of Mono's? We are using it because I can't get Mono's MSBuild to work on Windows (as well as other people), so maybe the PDB is incompatible.

@akien-mga
Copy link
Member

We have now entered release freeze for Godot 3.0 and want to focus only on release critical issues for that milestone. Therefore, we're moving this issue to the 3.1 milestone, though a fix may be made available for a 3.0.x maintenance release after it has been tested in the master branch during 3.1 development. If you consider that this issue is critical enough to warrant blocking the 3.0 release until fixed, please comment so that we can assess it more in-depth.

@neikeq
Copy link
Contributor

neikeq commented Mar 4, 2018

Just checked today and the log had several "Symbol file LoadedFromMemory is not a mono symbol file" messages. Changing DebugType to portable fixed it.

@Duehok
Copy link

Duehok commented Mar 22, 2018

Changing DebugType to portable fixed it.

What does that mean? A fix will be available in next 3.0x? In 3.x? Never? Or we can already fix it easily?
Because if this issue is the one killing debugging then it really needs to get fixed ASAP. We are not in the 60s anymore, "print to console" is not enough.

@PJB3005
Copy link
Contributor Author

PJB3005 commented Mar 22, 2018

I believe he may be talking about the DebugType property in the csproj files. I can't test right now though. If you want to try fixing it open your .csproj file and change the DebugType tags to portable.

Also I think we're all well aware how painful lack of debuggers is, there's a reason C# isn't marked stable yet.

@Duehok
Copy link

Duehok commented Mar 26, 2018

Changing debugtype to portable in the .csproj did not solve this issue.
Godot 3.0.2 stable, win 8.1m mono 5.4.1.7.

@neikeq
Copy link
Contributor

neikeq commented Mar 26, 2018

@Duehok You probably didn't change the one with the Tools Configuration condition. Make sure you change all them.

@PJB3005
Copy link
Contributor Author

PJB3005 commented Apr 6, 2018

I can confirm personally that <DebugType>portable</DebugType> makes file & line numbers work. Can't seem to get the mono debug extension for VSCode to work though, but it's not connecting at all (can't even pause the program) so I doubt it's related.

@PJB3005
Copy link
Contributor Author

PJB3005 commented Apr 6, 2018

Ok got the debugger to connect, it's still not hitting breakpoints.

@neikeq
Copy link
Contributor

neikeq commented May 25, 2018

This was fixed by #18949. For existing projects, you need to manually rename all <DebugType>full</DebugType> occurrences in your csproj file to <DebugType>portable</DebugType>.

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