Debug a console app

Debug a console app

Postby HunterEC » Mon Apr 20, 2015 12:58 am

Guys:

Does anyone remembers how to debug a console mode test app with harbour's debugger ? Thank you very much !
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Debug a console app

Postby Antonio Linares » Mon Apr 20, 2015 1:23 am

Gustavo,

Just compile your PRGs using /b flag and here you have an example of how to invoke the debugger:

Code: Select all  Expand view
// Testing AltD() and Alert() coloring
// Notice you have to compile it using /b

PROCEDURE Main()

   CLS

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

   Alert( "debugger enabled",, "GR+/B" )

   AltD()      // Invokes the debugger

   Alert( "debugger invoked",, "GR+" )

   Alert( "finished",, "GR+/B,W+/R" )

   RETURN
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Debug a console app

Postby HunterEC » Mon Apr 20, 2015 1:40 am

Antonio:

Thank you for the example.

On the MAK file that you emailed me, I don't know why, I included the /B flag but the program crashes with (trace included):
Code: Select all  Expand view
 ┌──────────────────────────────────────────────────┐
 │   Error BASE/1004  No exported method: DISPLAY   │
 │                                                  │
 │                       Quit                       │
 └──────────────────────────────────────────────────┘
Error BASE/1004  No exported method: DISPLAY
Called from DISPLAY(0)
Called from HBDEBUGGER:SHOW(0)
Called from HBDEBUGGER:ACTIVATE(0)
Called from __DBGENTRY(0)
Called from __DBGBUILDMENU(417)
Called from HBDEBUGGER:NEW(0)
Called from __DBGENTRY(0)
Called from MAIN(98)
 


Any ideas ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Debug a console app

Postby Antonio Linares » Mon Apr 20, 2015 2:50 am

Gustavo,

The line that fails is this one:

::oPullDown:Display()

It seems that ::oPullDown is not properly assigned.

As you are using the Harbour debugger menu for your own needs somehow this may be creating the conflict.

Could you try to debug another text app without using the pulldown menu and see if it also fails ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Debug a console app

Postby HunterEC » Mon Apr 20, 2015 3:09 am

Antonio:

I tried with the example you poste on this threads and works ok. It has to be that conflict. Any ideas ? Thank you very much !
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Debug a console app

Postby Antonio Linares » Mon Apr 20, 2015 4:25 am

Gustavo,

In your code please rename __dbgBuildMenu() as BuildMenu() and try it again, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Debug a console app

Postby HunterEC » Mon Apr 20, 2015 6:55 am

Antonio:

I just did but I'm getting the same error. Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Debug a console app

Postby Antonio Linares » Mon Apr 20, 2015 7:25 am

Gustavo,

How are you building your app ?

Please post here your compile and link script, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Debug a console app

Postby HunterEC » Mon Apr 20, 2015 8:11 am

Antonio:

I think I'd found a pot of gold. Full GUI debugger for a console OR GUI app just by linking a lib:
Code: Select all  Expand view
http://www.kresin.ru/en/debugger.html


Here's my part of my MAK file.
Code: Select all  Expand view
#Borland make sample, (c) FiveTech Software 2005-2014

HBDIR=c:\harbourb
BCDIR=c:\bcc582
FWDIR=c:\fwh

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.CH  = $(FWDIR)\include;$(HBDIR)\include
.path.C   = .\
.path.rc  = .\

#important: Use Uppercase for filenames extensions, in the next two rules!

PRG =        \
MYAPP.PRG    \
MYAPP1.PRG   \
MYAPP2.PRG   \
MYAPP3.PRG

PROJECT    : MyApp.exe

MyApp.exe  : $(PRG:.PRG=.OBJ)
   echo on
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
   echo $(PRG:.PRG=.OBJ), + >> b32.bc
   echo MyApp.exe, + >> b32.bc
   echo MyApp.map, + >> b32.bc
   echo $(HBDIR)\lib\hbrtl.lib + >> b32.bc
   echo $(HBDIR)\lib\hbvm.lib + >> b32.bc
   echo $(HBDIR)\lib\gtwin.lib + >> b32.bc
   echo $(HBDIR)\lib\hblang.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmacro.lib + >> b32.bc
   echo $(HBDIR)\lib\hbrdd.lib + >> b32.bc
   echo $(HBDIR)\lib\rddntx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddfpt.lib + >> b32.bc
   echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\hbdebug.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcommon.lib + >> b32.bc
   echo $(HBDIR)\lib\hbpp.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcpage.lib + >> b32.bc
   echo $(HBDIR)\lib\hbwin.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcplr.lib + >> b32.bc
   echo $(HBDIR)\lib\hbct.lib + >> b32.bc
   echo $(HBDIR)\lib\xhb.lib + >> b32.bc
   echo $(HBDIR)\lib\hbziparc.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmzip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbzlib.lib + >> b32.bc
   echo $(HBDIR)\lib\minizip.lib + >> b32.bc
   echo $(BCDIR)\lib\cw32.lib + >> b32.bc
   echo $(BCDIR)\lib\uuid.lib + >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\shell32.lib, >> b32.bc

   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s -jOBJ\ @b32.bc
   del b32.bc

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /L /N /W /ES0 /B /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include >> compiler.txt
  @type compiler.txt
  $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.C.OBJ:
  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
  echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
  $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
  del tmp
 
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Debug a console app

Postby Antonio Linares » Mon Apr 20, 2015 8:13 am

Gustavo,

http://www.kresin.ru/en/debugger.html


Have you already tested it ? Is it working fine for you ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Debug a console app

Postby HunterEC » Mon Apr 20, 2015 8:41 am

Antonio:

I'll let you know how it works after a full eval. So far, so good. It as managed everything I think of without glitches ! Thank you my friend !
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Debug a console app

Postby Antonio Linares » Mon Apr 20, 2015 8:45 am

very good! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests