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

Debugging #41

Open
bryab opened this issue Jul 8, 2018 · 1 comment
Open

Debugging #41

bryab opened this issue Jul 8, 2018 · 1 comment

Comments

@bryab
Copy link

bryab commented Jul 8, 2018

Hey, I was wondering if you all could provide a short guide on how to set this up for debugging. I am honestly new to Go and pretty new to Godot too.

Is it possible to debug this shared library while Godot is running?

@ShadowApex
Copy link
Owner

You can do some debugging with gdb with the following (Linux/Mac OSX):

  1. Compile Godot with debug symbols:
git clone https://github.com/godotengine/godot.git
git fetch && git checkout 3.0
scons platform=<osx/x11> target=debug --jobs 4
  1. Then run Godot with GDB to catch any crashes or segfaults. You can install GDB with any Linux package manager or brew on OSX, then you can run the debug version of Godot with GDB:
gdb godot
  1. Then set following forked processes and run Godot in GDB:
(gdb) set follow-fork-mode child
(gdb) run

Now if you experience a segfault, you can print a backtrace with bt:

#0  0x0000555557575e10 in Vector<SceneState::NodeData>::_get_size (this=0x148) at core/vector.h:61
#1  0x000055555757326c in Vector<SceneState::NodeData>::size (this=0x148) at core/vector.h:113
#2  0x0000555557565306 in SceneState::can_instance (this=0x0) at scene/resources/packed_scene.cpp:45
#3  0x0000555557571002 in PackedScene::can_instance (this=0x55555a0e4c70) at scene/resources/packed_scene.cpp:1670
#4  0x00005555562ec0e2 in MethodBind0RC<bool>::ptrcall (this=0x555559d88240, p_object=0x55555a0e4c70, p_args=0x55555a237380, r_ret=0xc420173a0c) at core/method_bind.gen.inc:565
#5  0x00005555564ba4ec in godot_method_bind_ptrcall (p_method_bind=0x555559d88240, p_instance=0x55555a0e4c70, p_args=0x55555a237380, p_ret=0xc420173a0c) at modules/gdnative/gdnative/gdnative.cpp:69
#6  0x00007fffd64093c8 in runtime.asmcgocall () at /usr/share/go-1.10/src/runtime/asm_amd64.s:688
#7  0x0000000000000810 in ?? ()
#8  0x0000000000000000 in ?? ()

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

No branches or pull requests

2 participants