PDA

View Full Version : Using GDB debugger?



Dimentio
02-02-2017, 09:40 PM
I've been trying to figure this out all day, with no luck. How exactly do I use the gdb debugger included with MingW to debug code? A change I made consistently crashes zelda-w.exe whenever the code I added activates, and all I'm getting is a segfault when starting the program using gdb, with not much other info other than a machine code instruction. Any assistance would be appreciated.

Gleeok
02-02-2017, 11:57 PM
First of all, did you build ZC with debugging symbols? Secondly, it's much easier to use gdb from inside an IDE which can integrate with it, such as C::B for instance. I don't recommend command-line or printf debugging.

Dimentio
02-03-2017, 03:31 AM
I added the -g flags in the makefile to CC = G++ (CC = G++ -g), but yeah, no debug symbols detected. Also, I've been using it from inside MSYS.

Either way, I fixed the crash. It was something stupid involving wPhantom weapons. Still be nice to have this in the future.

ZoriaRPG
02-03-2017, 06:10 AM
First of all, did you build ZC with debugging symbols? Secondly, it's much easier to use gdb from inside an IDE which can integrate with it, such as C::B for instance. I don't recommend command-line or printf debugging.

I should note here, that using MSVC 2008, if I try to build ZC/ZQuest/and all, in Debug mode, the linker crashes. I have not been able to successfully build them using the CMake files, in Debug mode, and I have no idea why.

I would not touch wPhantom with a 10 metre cattle prod. Your best option in any case, is to set the weapons with the scripted collision off. That would have the same overall result, would preserve their type, and would enable the user to enable their collision if they so desire.

wPhantom is reserved for very specific drawing effects tied to the Link class, and as such, is yet another abomination.