Help with Debug

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Help with Debug

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Help with Debug

Post 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.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Help with Debug

Post 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?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: Help with Debug

Post 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
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Help with Debug

Post 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...)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Help with Debug

Post by Rathinagiri »

After your guidance, I had tried /d option in compile.bat and seen the nice debug window.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
jayadevu
Posts: 238
Joined: Tue May 19, 2009 7:10 am

Re: Help with Debug

Post 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
User avatar
joerg
Posts: 10
Joined: Tue Sep 25, 2012 4:08 pm
DBs Used: DBF; mySQL
Location: Austria
Contact:

Re: Help with Debug

Post 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 ...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Help with Debug

Post by mol »

I'm building app via IDE and I heven't any problems with debugger.
Try this way
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Help with Debug

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply