Page 1 of 1

Debugging the DLL with gdb

PostPosted: 25 Jul 2020, 17:42
by FastEddie
Attached is a paper describing how to debug ManalinkEh.dll with gdb, the GNU debugger. Debugging works solely through the command line. I will post a separate paper on graohical user interfaces (there aren't so many under Windows for these tools...).

Summary and quick start
This document explains how to use gdb (as part of MinGW64) to debug the ManalinkEh.dll using the built-in command line. Graphical user interfaces will be discussed in a separate paper.

If you have MinGW64 installed copy the ManalinkEh.dbg file in the folder containing Magic.exe, open a command prompt (cmd), run gdb and enter the following commands (assuming Magic.exe resides in F:\Program files (x86)\Manalink\Manalink_Unstable).

    cd f:
    cd Program files (x86)
    cd Manalink /Manalink_Unstable
    file ManalinkEh.dll
    symbol-file ManalinkEh.dbg
    exec-file Magic.exe
    break card_arcbound_ravager
    run
Now Magic.exe runs and you can interact as usual. If an Arcbound Ravager is on the battlefield or someone's hand the debugger stops. You can list the code with the list command, step through the code with step or next, print variables like player or event with print player or print event, continue execution with continue and finally quit Magic.exe with kill and gdb with quit.

Edit: removed a typo in the pdf pointing to the wrong exec-file and added Open topics.