mod_harbour and Antonino Perricone's vscode Harbour extension and debugger working together !!!!!!

329 views
Skip to first unread message

Antonio Linares

unread,
Jul 4, 2019, 4:51:31 AM7/4/19
to Harbour Users
Now we have debugger on Windows, Linux and OSX ;-)

image.png

yes !!!!!!!


best regards

Antonio Linares
mod_harbour

Alain Aupeix

unread,
Jul 4, 2019, 6:23:35 AM7/4/19
to harbou...@googlegroups.com
Le 04/07/2019 à 10:51, Antonio Linares a écrit :
> Now we have debugger on Windows, Linux and OSX ;-)
Hi Antonio,

Now, under Linux, messages are displayed in the browser, but no console
is open ...

A+
--
------------------------------------------------------------------------
Alain Aupeix
http://jujuland.pagesperso-orange.fr/
http://pissobi-lacassagne.pagesperso-orange.fr/
------------------------------------------------------------------------
U.buntu 12.04 & Xu.buntu 16.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev
(2019-04-11 15:33) | Hw.Gui (2786)
------------------------------------------------------------------------

Antonio Linares

unread,
Jul 4, 2019, 7:34:42 AM7/4/19
to Harbour Users
Screenshot 2019-07-04 at 13.15.27.png

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/9877b2ab-2fec-54b2-01d9-e5cd35491d5e%40wanadoo.fr.
For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com

Antonio Linares

unread,
Jul 4, 2019, 11:08:38 AM7/4/19
to Harbour Users
Alain,

You have to install vscode and the latest beta from Antonino Perricone, but we have a problem with the "handshake"

The debugger PRG code and vscode they need to perform a "handshake" where the name of the app and the process id are used.

In Windows the debugger PRG uses hb_ArgV( 0 ) and __PIDNum() and this is correct.

On Linux hb_ArgV( 0 ) from inside the mod_harbour is returning an empty string (surely because a daemon is used and
not a standard app). We have tried to use any name there that matches with the one checked from vscode, but vscode
uses __PIDNum() also to verify the app is the right one, and here we need to find a solution.

best regards

Antonio Linares
mod_harbour
El jue., 4 jul. 2019 a las 12:23, Alain Aupeix (<alain....@wanadoo.fr>) escribió:
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/9877b2ab-2fec-54b2-01d9-e5cd35491d5e%40wanadoo.fr.
For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com

Antonio Linares

unread,
Jul 4, 2019, 11:15:13 AM7/4/19
to Harbour Users
Alain,

I think that the solution is to use a name and PID for the "handshake" that are fine even if they are not the real ones.

For example, we could use the "calculator" and its PID. That would be enough to bypass the handshake

We are doing tests
--
Antonio Linares
www.fivetechsoft.com

Antonio Linares

unread,
Jul 4, 2019, 11:35:32 AM7/4/19
to Harbour Users
In Windows we are able to bypass the "handshake" using the "Calculator.exe" and its PID and it works

So the same solution should apply to Linux and OSX ;-)
--
Antonio Linares
www.fivetechsoft.com

Eric Lendvai

unread,
Jul 4, 2019, 11:58:55 AM7/4/19
to Harbour Users
Wonderful job Antonio!

But the version you are using from Antonino is not officially released yet. It is going to be version 9.3. He already placed his changes on his github repo, but the .vsix I forward you from him, that he built from that github repo, was a prerelease he custom made for me. 
This is part of his new support to the "attach" method of VSCODE debug engine.
I will be updating the harbour.wiki article (https://harbour.wiki/index.asp?page=PublicArticles&mode=show&id=190401174818&sig=6893630672) about how to use this new debug method next week or after he releases 9.3. It is a holiday in the US and than a mini vacation for me.

Eric


On Thursday, July 4, 2019 at 8:08:38 AM UTC-7, Antonio Linares wrote:
Alain,

You have to install vscode and the latest beta from Antonino Perricone, but we have a problem with the "handshake"

The debugger PRG code and vscode they need to perform a "handshake" where the name of the app and the process id are used.

In Windows the debugger PRG uses hb_ArgV( 0 ) and __PIDNum() and this is correct.

On Linux hb_ArgV( 0 ) from inside the mod_harbour is returning an empty string (surely because a daemon is used and
not a standard app). We have tried to use any name there that matches with the one checked from vscode, but vscode
uses __PIDNum() also to verify the app is the right one, and here we need to find a solution.

best regards

Antonio Linares
mod_harbour

El jue., 4 jul. 2019 a las 12:23, Alain Aupeix (<alain...@wanadoo.fr>) escribió:
Le 04/07/2019 à 10:51, Antonio Linares a écrit :
> Now we have debugger on Windows, Linux and OSX ;-)
Hi Antonio,

Now, under Linux, messages are displayed in the browser, but no console
is open ...

A+
--
------------------------------------------------------------------------
Alain Aupeix
http://jujuland.pagesperso-orange.fr/
http://pissobi-lacassagne.pagesperso-orange.fr/
------------------------------------------------------------------------
U.buntu 12.04 & Xu.buntu 16.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev
(2019-04-11 15:33) | Hw.Gui (2786)
------------------------------------------------------------------------

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbou...@googlegroups.com.


--
Antonio Linares
www.fivetechsoft.com

Antonio Linares

unread,
Jul 4, 2019, 2:12:01 PM7/4/19
to Harbour Users
Working on Ubuntu :-)

image.png


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/2d806273-97df-4214-a4c9-382a5802a68e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com

Antonio Linares

unread,
Jul 4, 2019, 2:17:49 PM7/4/19
to Harbour Users
image.png
--
Antonio Linares
www.fivetechsoft.com

Antonio Linares

unread,
Jul 4, 2019, 2:22:27 PM7/4/19
to Harbour Users
image.png
--
Antonio Linares
www.fivetechsoft.com

Antonino Perricone

unread,
Jul 5, 2019, 3:42:04 AM7/5/19
to Harbour Users

The pid is used from the debugger as input, it is necessary to check if the program is closed during the debugger, and to kill it if it is lunched by debugger. 

in this way the debugger check il nautilus-desktop is running! and check it for killing, so in windows if you close calculator during debugger the debugger exits !!!!
It does not works with empty program name? I will check it...

The attach is not released yet, I will release it next week probably.

Alain Aupeix

unread,
Jul 5, 2019, 3:46:19 AM7/5/19
to harbou...@googlegroups.com
Le 05/07/2019 à 09:42, Antonino Perricone a écrit :
>
> in this way the debugger check il nautilus-desktop is running! and
> check it for killing

And how to do if we don't use Ubuntu, and nautilus ?

For example xubuntu and thunar ...

Antonio Linares

unread,
Jul 5, 2019, 6:07:36 AM7/5/19
to Harbour Users
modharbour_osx_debug.png

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com

Alain Aupeix

unread,
Jul 5, 2019, 6:47:26 AM7/5/19
to harbou...@googlegroups.com
Le 05/07/2019 à 12:07, Antonio Linares a écrit :
> modharbour_osx_debug.png

Hi, I have installed vscode 1.36.0, and the plugin Harbour/xHarbour
0.9.2 of Antonino Perricone.

But I have no toolbar for the debugger(at the right of your hardcopy), I
suppose that a new plugin version is needed ...

Antonino Perricone

unread,
Jul 5, 2019, 8:14:11 AM7/5/19
to Harbour Users

Alain Aupeix

unread,
Jul 5, 2019, 11:22:11 AM7/5/19
to harbou...@googlegroups.com
Hi, with the help of a part of Eric doc, and yours, I have been able to
save debugger.prg (in samples, for exemple)

When I try to run debugon.prg, I have an errors, and in Problem box, I
have the message that it don't find hbdebug.ch

alain@aupeix-GX723:~/Bureau/ged2dbf$ locate -b hbdebug.ch
/home/alain/harbour_for_modharbour/include/hbdebug.ch
/opt/TuxPrograms/trunks/harbour/include/hbdebug.ch
/usr/include/harbour/hbdebug.ch

Which on I must use, and how to enter the folder for the parameter -I ?

Thanks
+A

Antonio Linares

unread,
Jul 5, 2019, 1:50:41 PM7/5/19
to Harbour Users
Alain,

// {% hb_SetEnv( "HB_INCLUDE", pathToCHFiles ) %}

#include "hbdebug.ch"

function Main()

...

best regards

Antonio

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com

Alain Aupeix

unread,
Jul 5, 2019, 4:04:50 PM7/5/19
to harbou...@googlegroups.com
Le 05/07/2019 à 19:50, Antonio Linares a écrit :
> Alain,
>
> // {% hb_SetEnv( "HB_INCLUDE", pathToCHFiles ) %}
>
> #include "hbdebug.ch <http://hbdebug.ch>"
>
> function Main()

Done

// {% hb_SetEnv( "HB_USER_PRGFLAGS", "-B" ) %}
// {% hb_SetEnv( "HB_INCLUDE", "/usr/include/harbour/" ) %}

function Main()
...

and launch.json is :

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "harbour-dbg",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/debugon.prg",
"workingDir": "${workspaceFolder}/",
"sourcePaths": [
"${workspaceFolder}"
]
}
]

Problems (seems ok)
No problems have been detected in the workspace so far

Output : empty

No debug toolbar ...

Where do I fail ?

Probably not the latest version of harbour vscode ?

Thanks
A+

Antonio Linares

unread,
Jul 5, 2019, 4:10:31 PM7/5/19
to Harbour Users
Alain,

You have to use the "attach" mode instead of the "launch" mode, but this is available in the latest beta from Antonino only!

             "type": "harbour-dbg",
             "request": "attach"  

best regards

Antonio Linares
mod_harbour
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com

Alain Aupeix

unread,
Jul 5, 2019, 5:55:30 PM7/5/19
to harbou...@googlegroups.com
Le 05/07/2019 à 22:10, Antonio Linares a écrit :
> Alain,
>
> You have to use the "attach" mode instead of the "launch" mode, but
> this is available in the latest beta from Antonino only!
>
> "type": "harbour-dbg",
> "request": "attach"
>
> best regards

Thanks

And where to find it ?

Antonio Linares

unread,
Jul 6, 2019, 3:16:38 AM7/6/19
to Harbour Users
Alain,

You have to ask Antonino for it

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/5Gd90Yu7zqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Antonio Linares
www.fivetechsoft.com
Reply all
Reply to author
Forward
0 new messages