-
Notifications
You must be signed in to change notification settings - Fork 20
Debugger
The debugger is rewritten from scratch, It was made to include some features unavailable on standard debugger. From the version 0.7.7 xHarbour is supported too.
First of all, you need the debugger code, it can be done using integrate command Harbour:Get debugger code
This file need to be included on your project, and compile all source files with -b(debug info) switch active.
At this point you need to configure the debugger, if no debugger is configured go in the debugger page with CTRL+SHIFT+D and press the gear wheel:
then select harbour, it creates a config file like this:
{
// 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": "${workspaceRoot}/Program",
"workingDir": "${workspaceRoot}/",
"sourcePaths": [
"${workspaceRoot}"
]
}
]
}
So:
type is the type of the debugger
request can be launch, meaning the program will be run, or attach, meaning the debugger connect on an executing application. The attach is not supported.
name needed to identify the debug session, it is possible define more then one configuration on launch.json
program is the path of executable
workingDir is the path where start the executable
sourcePaths is a list of path where looking for source code
In case of launch.json is already present in your workspace, you need do press "Add configuration..."
Then select harbour
and a configuration like above is created.
In bold feature unsupported by standard debugger.
Features | Harbour | xHarbour |
---|---|---|
Pause execution | Done | Done |
Step | Done | Done |
Step in | Done | Done |
Step out | Done | Done |
Watch local | Done | Done |
Watch Public | Done | Done |
Watch Private | Done | Partial1 |
Watch statistics | Done | Partial2 |
Watch global | ||
Copy expression | Done | Done |
Object support | Done | Partial3 |
Hash support | Done | Done |
Breakpoints | Done | Done |
Conditional breakpoints | Done | untested |
Hitcount breakpoints | Done | untested |
Break on error | Done | |
Multi thread support |
1Only private local are supported, it is an xHarbour limitation. ↩
2File level statistics are not supported, It will be fixed. ↩
3It does not support hidden and protected, It will be fixed. ↩
From the 0.7.8 version it is possibile on watch use the commands copy expression and add to watch:
that allow to obtain a piece of code that point to this value: