Page 1 of 1

HMG 4 Debug

Posted: Sun Feb 20, 2011 5:47 pm
by kajko
Hi,

I am using HMG 4 and i am trying to use debug.

I am calling HBMK2 with batch file i made:

compile.bat:
@echo off
SET HMGPATH=c:\hmg.4
SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
SET HB_WITH_QT=%HMGPATH%\qt\include
HBMK2 -b sasaTest.hbp

-----------------------

sasaTest.hbp:

-inc

-osasaTest

Main.prg
Token.prg
bhe_form.prg

----------------

hbmk.hbm:
c:\hmg.4\svn\hmg.hbc

------------------

Main.prg:
#include "hmg.ch"


Function Main

MsgBox( "aabbccdd", "neki titl", "info", "detalj" )

return
---------

Run sasaTest.exe and no response to Alt-D keystroke...

Include ALTD() as first line:

Function Main
ALTD()
MsgBox( "aabbccdd", "neki titl", "info", "detalj" )
return

but then program hangs at start and i can only see sasaTest.exe in process list in task manager, but no debuger is showing nor MsgBox.

Any one knows what i am doing wrong ?

Kajko.

Re: HMG 4 Debug

Posted: Mon Feb 21, 2011 11:41 pm
by kajko
Update :)

After days of searching (and implementing countless 'fixes' from all over the web) I can honestly say that debugging harbour+Qt does not work :(

If you include AltD() call, app will hung as soon as it gets there. I think it is because it can not find 'console' screen (DOS type of harbour app works fine with debugger), but i did not have more time to look into it.

I will now try to dissect debugger from harbour source dist and, in worst case, include in my test HMG project all debugger source files.

I hope that quick and dirty fix (for start) would be to open console window and redirect debugger in/out to that window. Not sure that that will work on Linux tho...When I do that on Win I will try it on Ubuntu.

That solution would be acceptable as there will be minimal work involved with updating code with future releases of harbour debugger.

What do rest of you think ?
Should I 'forget' about console subwin and convert it to Qt from the start ?

Kajko

Re: HMG 4 Debug

Posted: Thu Mar 15, 2012 7:20 pm
by danielmaximiliano
kajko wrote:Update :)

After days of searching (and implementing countless 'fixes' from all over the web) I can honestly say that debugging harbour+Qt does not work :(

If you include AltD() call, app will hung as soon as it gets there. I think it is because it can not find 'console' screen (DOS type of harbour app works fine with debugger), but i did not have more time to look into it.

I will now try to dissect debugger from harbour source dist and, in worst case, include in my test HMG project all debugger source files.

I hope that quick and dirty fix (for start) would be to open console window and redirect debugger in/out to that window. Not sure that that will work on Linux tho...When I do that on Win I will try it on Ubuntu.

That solution would be acceptable as there will be minimal work involved with updating code with future releases of harbour debugger.

What do rest of you think ?
Should I 'forget' about console subwin and convert it to Qt from the start ?

Kajko
Hola Kajko:
hace unos dias escribi al grupo harbour la posibilidad de usar el depurador con una GUI y no en el modo consola.
sinceramente siempre use el depurador de Turbo Pascal y es realemente maravilloso su uso. simple y efectivo, no puedo decir lo mismo en Harbour.
xHarbour tiene a xDebug pero es pago y necesitamos algo libre como es Harbour y sus proyectos basados en el.
hoy estoy mirando el codigo C:\hb31\harbour\src\debug y es muy bueno

Translate Google:
Hello Kajko:
I wrote a few days ago the group harbor the ability to use the debugger with a GUI and console mode.
sincerely always use the debugger for Turbo Pascal and dont really wonderful to use. simple and effective, I can not say the same Harbour.
xHarbour has XDebug but payment and need something free as Harbour and its projects based on it.
I am now looking at the code C:\hb31\harbour\src\debug and is very good

follow the comments Debugger GUI http://ar.mg6.mail.yahoo.com/neo/launch ... u1pdpeo1si

Re: HMG 4 Debug

Posted: Thu Mar 15, 2012 8:33 pm
by mol
I'vel used debugger with my hmg 3.0.40 application and everything worked ok. When I've run my app, console window was opened and normal window was opened too. after calling altd() function, you must move focus to console window by mouse...

Re: HMG 4 Debug

Posted: Thu Mar 15, 2012 8:44 pm
by danielmaximiliano
mol wrote:I'vel used debugger with my hmg 3.0.40 application and everything worked ok. When I've run my app, console window was opened and normal window was opened too. after calling altd() function, you must move focus to console window by mouse...
Hola Mol:
no uso la funcion Altd() , simplemente en el IDE uso la opcion depurar del menu proyecto.
pero las teclas rapidas F7 o otras no funcionan.
ud utiliza otra cosa aparte de utilizar el llamado a altd() dentro de su aplicacion???
puede darme un ejemplo .

Translate Google:
Hello Mol:
Altd not use function () just in the IDE using the debug option from the menu project.
but the hotkeys F7 or others do not work.
ud used to use something other than the call to altd () inside your application???
can give me an example.

mire aqui / look here : http://ar.mg6.mail.yahoo.com/neo/launch ... u1pdpeo1si

Re: HMG 4 Debug

Posted: Thu Mar 15, 2012 8:54 pm
by danielmaximiliano
hoy estoy mirando el codigo C:\hb31\harbour\src\debug y es muy bueno
pero es un libreria y no una aplicacion del proyecto Harbour.
escribi al grupo harbour user para ver la posibilidad de que sea una aplicacion, de esta manera manejar el codigo fuente e ir corrigiendo a medida que salten errores.
si ud manejo el IDE de HMG.3x sabe que cuando compila y presenta un linea de error , un doble click sobre esa linea que causa conflicto puede corregir el error y seguir compilando, no es asi ?
en mi caso el depurador abre el codigo fuente y me permite ver a la izquierda la numeracion de linea. pero no puedo modificar nada. debo cerrar el depurador y volver al ide , de ahi ir al Editor, corregir , volver al IDE y depurar de nuevo.
engorroso, no ?

Translate Google:

Code: Select all

I am now looking at the code C:\hb31\harbour\src\debug and is very good
but it is a library and an application of Harbour project.
wrote harbor user group to see the possibility that either an application, thus driving the source code and go as you jump correcting errors.
If you use IDE HMG.3x know that when you compile and presents an error line, double click on that line that causes conflict can correct the error and continue to compile, is not it?
in my case the debugger opens the source code and allows me to see on the left the line numbering. but I can not change anything. I close the debugger and return to ide, from there go to Editor, correct, return to the IDE and debug again.
cumbersome, right?

Re: HMG 4 Debug

Posted: Fri Mar 16, 2012 6:19 am
by mol
Pressing Alt-D does not work.
But, calling altd() function works OK.
Image

With debuggers you can not change code. You can run program step by step. You can set values of variables. You can even call functions by typing their names with parameters.

Re: HMG 4 Debug

Posted: Tue Apr 03, 2012 10:17 am
by mbelgrano
will be interesting if with the evolution of hmg.4 ide
will be extended to have a visual editor
seem me that c:/harbour/src/debug/debugger.prg
can be update to use gui element instead use hb_dispoutat
or can rewritten with a library who made call to editor
and activate debug menu in editor with specialized mode for debugging
Similar to qtcreator Ctrl+3 Debug mod

This is wikipedia page regarding debugger
Typically, debuggers also offer more sophisticated functions such as running a program step by step (single-stepping or program animation), stopping (breaking) (pausing the program to examine the current state) at some event or specified instruction by means of a breakpoint, and tracking the values of variables. Some debuggers have the ability to modify program state while it is running. It may also be possible to continue execution at a different location in the program to bypass a crash or logical error.
Same interesting resource about debugger http://www.openrce.org/articles/


mol wrote:Pressing Alt-D does not work.
But, calling altd() function works OK.
With debuggers you can not change code. You can run program step by step. You can set values of variables. You can even call functions by typing their names with parameters.

Re: HMG 4 Debug

Posted: Tue Apr 03, 2012 6:03 pm
by danielmaximiliano
mbelgrano wrote:will be interesting if with the evolution of hmg.4 ide
will be extended to have a visual editor
seem me that c:/harbour/src/debug/debugger.prg
can be update to use gui element instead use hb_dispoutat
or can rewritten with a library who made call to editor
and activate debug menu in editor with specialized mode for debugging
Similar to qtcreator Ctrl+3 Debug mod

This is wikipedia page regarding debugger
Typically, debuggers also offer more sophisticated functions such as running a program step by step (single-stepping or program animation), stopping (breaking) (pausing the program to examine the current state) at some event or specified instruction by means of a breakpoint, and tracking the values of variables. Some debuggers have the ability to modify program state while it is running. It may also be possible to continue execution at a different location in the program to bypass a crash or logical error.
Same interesting resource about debugger http://www.openrce.org/articles/
Hola Maximo:
El depurador de Turbo Pascal ( algo muy viejo digamos los años 90) deja sonrojado al depurador de Harbour.
este depurador tiene la habilidad de cambiar los valores de programa mientras esta corriendo.
puede probarlo sin saber programacion en Pascal.
solo pesa 10 megas toda la aplicacion Turbo pascal. cargue un ejemplo y dele click a depurar.

*///// Translate Google /////*

Hi Max:
Pascal Turbo Debugger (very old say the years 90) leaves the cleaner flushed Harbour.
This debugger has the ability to change values ​​while program is running.
you can try it without knowing programming in Pascal.
weighs only 10 meg Turbo pascal entire application. charge and give an example, Click to debug.