Page 1 of 4

Help with Debug

Posted: Wed Jun 03, 2009 5:54 am
by Rathinagiri
Hi,

I never used debugging facility in my whole xBase programming life. Can somebody help me to know about debugging in Harbour? Is there any documentation about the usage of debug facility?

HMG+Debugging any difference with regard to GUI part?

Thanks in advance,

S. Rathinagiri.

Re: Help with Debug

Posted: Wed Jun 03, 2009 7:14 am
by mol
Debugging is beatiful!
You can monitor your variables, loops, you can change/set value of variables. You can view opened dbfs, indexes, arrays.
Place altd() function to your code, where you want to observe how program runs. You can run program line by line or run whole function/procedure. When debugger window opens, all possibilities are placed in upper menu.
I didn't search documentation about debug in the internet, because I use it from always (there was no internet years ago). I can search my installation diskettes for clipper 5.2, I think there was some information in norton guide format.

Re: Help with Debug

Posted: Wed Jun 03, 2009 8:06 am
by Rathinagiri
Thanks a lot Mol. I am sure it would be very much useful.

Now, coming to the GUI part, can we do something for that? Or is it already there?

Re: Help with Debug

Posted: Thu Jun 04, 2009 4:26 am
by swapan
rathinagiri wrote:Hi,

I never used debugging facility in my whole xBase programming life. Can somebody help me to know about debugging in Harbour? Is there any documentation about the usage of debug facility?

HMG+Debugging any difference with regard to GUI part?

Thanks in advance,

S. Rathinagiri.
Hey Rathi, you've asked the Question which I was thinking to post in this forum. Like you I too never used Debugger in Clipper. I just learnt it a year ago when I switched my job. The guys here use the debugger option heavely for dubugging any module.

In Clipper the its done in this way:

To compile:
CLIPPER <APPNAME> /b (/b=debug info)
RTLINK FI <APNAME>

To invoke in application:
Alt-D (debugger's interface will popup)


Its really very good tool. Not tried in HMG..

Regards,

Swapan

Re: Help with Debug

Posted: Thu Jun 04, 2009 5:58 am
by mol
Using debug with HMG is little different from using with clipper. With open windows, we cannot use alt-d, so we must put functon altd() ic code for invoke debugger.
I use debugger for code, not for graphics interface (in my opinion, nothing to debug...)

Re: Help with Debug

Posted: Thu Jun 04, 2009 7:16 am
by Rathinagiri
After your guidance, I had tried /d option in compile.bat and seen the nice debug window.

Re: Help with Debug

Posted: Thu Jun 04, 2009 10:21 am
by jayadevu
Hi,

Pls consider the following example,

#include "minigui.ch"
function Hello
altd()
use test new
dbgotop()
msginfo("Top Reached")
return NIL

When I compile with the /D option, debug window does not open up :-(

I am using xHarbour 1.2.1 with HMG extended. Is that the problem ?

Alternatively, Rathinagiri, can u post some sample code which you have tested in HMG, so that I can test the same code and know if the xHarbour+HMG extended environment is a issue.

Warm regards,

Jayadev

Re: Help with Debug

Posted: Fri Nov 16, 2012 11:27 am
by joerg
Hi to all,

Tried to use the debugger by building with hmg.3.0.45 with the /d option.
Build works fine and the debugger starts in the console window after the build.

When pressing F5 "Go" the application (GUI) window opens and I can use the application.

As soon as ALTD() is encountered in the coding, there is a hangup.
In the console window the debugger displays the proper (ALTD()) line in the coding, but I cannot call commands (the enter key doesn't react), the GUI application window is there but gone (processing indicator when going there with the mouse) ... no reaction.
I have to close both windows ...

The "/d" debugger would be very useful - is there some way to make it work properly / without a hangup?

Thanks ...

Re: Help with Debug

Posted: Fri Nov 16, 2012 1:55 pm
by mol
I'm building app via IDE and I heven't any problems with debugger.
Try this way

Re: Help with Debug

Posted: Fri Nov 16, 2012 4:34 pm
by danielmaximiliano
joerg wrote:Hi to all,

Tried to use the debugger by building with hmg.3.0.45 with the /d option.
Build works fine and the debugger starts in the console window after the build.

When pressing F5 "Go" the application (GUI) window opens and I can use the application.

As soon as ALTD() is encountered in the coding, there is a hangup.
In the console window the debugger displays the proper (ALTD()) line in the coding, but I cannot call commands (the enter key doesn't react), the GUI application window is there but gone (processing indicator when going there with the mouse) ... no reaction.
I have to close both windows ...

The "/d" debugger would be very useful - is there some way to make it work properly / without a hangup?

Thanks ...
Harbour say wrote: * $Id: altdtest.prg 17835 2012-07-18 13:41:31Z vszakats $
*/

// Testing AltD()
// Notice you have to compile it using /b
// 2012-07-18
PROCEDURE Main()

AltD( 1 ) // Enables the debugger. Press F5 to go

Alert( "debugger enabled" )

AltD() // Invokes the debugger

Alert( "debugger invoked" )

RETURN