Understanding Debug in HMG-Extended?

212 views
Skip to first unread message

Spencer Redfield

unread,
Feb 3, 2020, 7:26:07 PM2/3/20
to Harbour Minigui
I have NOT been successfully using DEBUG in HMG-Extended.  However, I regularly use DEBUG in "Official" HMG with no problems.  I do not know what is different. I am using HMG Extended Edition version 20.01 (Update 2) in Windows 10 (up to date).

In HMG-Extended:
    • After a “Build (Incremental)“ then IDE’s “Project” → “Debug” option the result is never goes beyond a blank (no text) command/terminal window.  
    • After the project has been built with “HBMK2” then “Project” → “Debug” the dialog seems to indicate completion BUT the EXE does not open.

I honesty need some guidance!  To date I have NOT found DEBUG instructions in the “MiniGui 20 Extended” .CHM.  Neither have I discovered this information in files under “\Samples”.  

Can someone please point me to usable HMG-Ext DEBUG information?  I would be extremely grateful.

Thank you and best regards, 
SDRed2

Barnabás Mátis

unread,
Feb 4, 2020, 5:26:55 PM2/4/20
to Harbour Minigui
Try using the Harbour built-in debugger as follows.

Place the following line at the beginning of the program source:
#pragma /B+

Place the AltD() function name in the appropriate location of the program source.

The program must be compiled in mixed mode, open the prompt window and run:
<minigui_path>\batch\compile.bat <prgfile> /CG
Here you can use /D parameter instead of #pragma /B+ as an additional parameter.

Regards,
Barna


Here is the working sample:

#pragma /B+     // linking the debugger

#include <minigui.ch>

Function Main()
    AltD()  // activate Harbour debugger console
    DEFINE WINDOW Demo AT 100,100 WIDTH 300 HEIGHT 150 TITLE 'Demo' MAIN
        DEFINE BUTTON Button
            ROW    20
            COL    80
            WIDTH  100
            HEIGHT 28
            CAPTION "Click here"
            ACTION Click()
        END BUTTON
    END WINDOW
    Activate Window Demo
Return (Nil)

Function Click()
    // AltD()
    ? "Clicked... ", This.Name, Time()
Return (Nil)


Grzegorz Wojnarowski

unread,
Feb 12, 2020, 8:31:37 AM2/12/20
to Harbour Minigui
I use hwgdebug
http://www.kresin.ru/en/debugger.html

Regards
Grzegorz
Reply all
Reply to author
Forward
0 new messages