Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Announcement: HbIDE Implements Harbour/xHarbour Debugger

489 views
Skip to first unread message

Pritpal Bedi

unread,
Aug 31, 2014, 3:07:50 PM8/31/14
to
2014-08-31 10:00 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r342)
* qtcontribs.hbp
+ Added: debug/hwgdebug.hbp

+ debug
+ debug/dbgconnect.prg
+ debug/dbgdop.c
+ debug/debugger.prg
+ debug/hwgdebug.hbp
+ Added: Alexander Kresin's <al...@kresin.ru> application-side debugger
library. Many thanks Kresin. You fittingly separated the rectangular
and non-rectangular code of Harbour's native debugger.
I added some missing features which were added to Harbour debugger,
probably, later than Kresin wrote his library.

+ hbide/debugger.prg
+ hbide/debugger.ui
+ hbide/resources/debugger.png
+ Added: Alex <alexeyz...@gmail.com> written HbIDE specific bridge
for HWGDebug defined protocol. It was a mammoth work. Thanks Alex.

* hbide/actions.prg
* hbide/docks.prg
* hbide/editor.prg
* hbide/hbide.hbp
* hbide/hbide.qrc
* hbide/main.prg
* hbide/object.prg
* hbide/projmanager.prg
* hbide/saveload.prg
* hbide/shortcuts.prg
+ Debbuger specific code parts. Mostly by Alex.

* hbqt/qtgui/hbqt_version.ch
% Version bump.

* hbqt/qtgui/hbqtgui.ch
+ Added: few more constants.

* hbqt/qtcore/hbqt.h
+ Added: MSVC specific defines. Proveded by M.Ronaldo, thanks.

* hbqt/qtgui/qth/HBQPlainTextEdit.qth
* hbqt/qtgui/hbqt_hbqplaintextedit.cpp
* hbqt/qtgui/hbqt_hbqplaintextedit.h
+ Added: methods essential to integrate debugger protocol.
Courtesy: Alex. I just changed the identifiers to confirm to
HbIDE laid rules.

Harbour's debugger is brought to HbIDE by Alex based on Kresin's
communication layer which separates the user-interface from its core.
This separation makes it possible to embbed this protocol in any
GUI/Console environment and for any type of Harbour/xHarbour
compiled application.

PREREQUITES: ( for this version only. In future theme may change. )
1. Compile QtContribs (recompile not needed). It will build
hwgdebug library and will deposit in the folder with rest of
the libraries.

2. Spread sources belonging to the debugged project on same View.
Only those sources where you want to put the break-points needs
to be visible on the active view.

3. Put the break-points by clicking on a line on Line-Numbers area
of editing instance. Such click will toggle the break-point.
The source line will turn RED if a break-point is installed.

4. To be on the safer side, exit HbIDE and execute it again.
All break-points you initiated in previous run will re-appear.

5. Only build the project. Do not launch. Click on the "Debugger"
icon on the main toolbar. A left-hand side docking debugger widget
will appear. Resize it to suit your preferences.

6. Click on "Build" menu on the main menu-bar then click on
"Launch Debug". Application will be fired and will stop execution
on first break-boint it will encounter. Debugger interface will
show up data in its many widgets. Rest you all know how to operate
the debugger.

7. Here are some instructions specific to HbIDE interface:
a. Double-click on any work-area entry will refresh "Current Record"
displaying record information of clicked work-area.

b. Double-click on any entry in "Variables" table will refresh the
"Object Inspector" widget containing relevant information of
clicked variable. Only variables of type (O)bject or (A)rray
can be inspected this way. Currently array can be inspected
for primary elements only. Sub-arrays values cannot be inspected.

c. Click on "Add" button to intiate a new "Watch" and then
double-click in "Expression" field. Punch-in or copy a Harbour
expression and press <Enter>. Its current value will be
reflected in "Value" field. You can add as many "Watches"
as you like. To delete a watch first select the entry and then
click on "Delete" button. Watches are not saved in current vesrion.

ASSUMPTION: ( for current version only )
1. Project file (.hbp), sources (.prg.c.cpp.hb), executable ({win}.exe)
must reside in same folder.

2. Project file (.hbp) must contain following entries:
-b
-lhwgdebug
-lhbdebug

3. Possessing some knowledge about Harbour debugger can greatly help
you to understand the basics of debugger but certainly is not
neccessary.

Many more enhancements are planned for the final version. This is just the
begining. The most important enhancement should be to implement it
transparently inside <Build and Launch> mechanism without the need to
add debugger specific switches inside .hbp. For this to happen a hbmk2
provided macro "hb_debug" or similar is required to be used in -workdir
switch. If you happen to know if this macro is available in hbmk2, please
let me know.


Pritpal Bedi
a student of software analysis & concepts



Image: https://lh4.googleusercontent.com/-QWz5-oq4Pc4/VAK02LuthjI/AAAAAAAADJk/B2RZ5cb8nB0/s320/debugger_2.png

winc...@gmail.com

unread,
Sep 2, 2014, 1:14:27 PM9/2/14
to
Hello Pritpal:

First, many thanks for your works, look very good.

Second, this tools IDE are new for me, where I can download this IDE ?

Can you give the the link please, thanks,

Winca

Pritpal Bedi

unread,
Sep 2, 2014, 11:53:09 PM9/2/14
to
In continuation..


2014-09-02 19:02 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r345)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r345.

* hbide/actions.prg
* hbide/debugger.prg
* hbide/docks.prg
* hbide/hbqtoolbar.prg
* hbide/main.prg
* hbide/projmanager.prg
% Facelift to selected-text toolbar.

+ Implemented: debugger protocol in HbIDE's main-stream build engine.
POINTS TO NOTE
--------------
1. You will always construct a project normally as per
production standards.
2. You will never add any debug related switches in the .hbp project file.
3. You will only select <Build Debug and Launch> family of options
either from the <MainMenu><Build> or via context-menu of project
node in <Projects Tree>.
4. HbIDE will post-pend the built executable with "_d" for debug builds.
5. HbIDE will create a "debug" sub-folder in the folder pointed-to
by -workdir switch. If no such switch is detedted in .hbp then
".hbmk/${hb_plat}/${hb_comp}/debug" will be used.
6. You will never be asked to open the "HbIDE Debugger" dock yourself.
Any debug built will open it automatically. The debugger interface
will close itself once <Exit> is clicked.
7. HbIDE manages all the complexities of production and debug builds
transparently and auomatically without any conflics.

WHAT ELSE ? Just enjoy.

Pritpal Bedi

unread,
Sep 3, 2014, 12:01:25 AM9/3/14
to
Hi Winca

HbIDE is a part of QtContribs repository
hosted at Source-Forge at this link:

http://sourceforge.net/projects/qtcontribs/?source=directory

And this is the google-group which is dedicated
to QtContribs development and support:

https://groups.google.com/forum/?fromgroups#!forum/qtcontribs


Do not download right now because Windows installer
is not updated to current version unless you dare to
build Harbour and QtContribs yourselves, though not
impossible but surely difficult for you ( only guessting )
if you are first timer with Harbour.

To use HbIDE you do not need to know about Harbour, HbIDE
is capable of materializing xHarbour projects as well including
the debugger.

In next few days I will commit the windows installer which
you will able to use with your xHarbour projects without any
knowledge about Harbour.


Pritpal Bedi
a student of software analysis and concepts

winc...@gmail.com

unread,
Sep 3, 2014, 11:32:32 AM9/3/14
to
Hi Pritpal:

Thanks for your answers.

OK I will waiting for your notice about windows installer for xHarbour, for begginers programmer some me.


Winca

Pritpal Bedi

unread,
Sep 3, 2014, 12:20:09 PM9/3/14
to
Hi Winca

> OK I will waiting for your notice about windows installer for xHarbour, for begginers programmer some me.


Installer is available right now also.
I was saying that if you need debugger functionality
only then wait a few more days. Debugger implementation
is committed in the SVN but windows installer posted there
does not contain this functionality yet.

Pritpal Bedi

unread,
Sep 3, 2014, 8:30:14 PM9/3/14
to
In continuation:

2014-09-03 16:56 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r346)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r346.

* hbide/actions.prg
* hbide/debugger.prg
* hbide/debugger.ui
* hbide/projmanager.prg
- Removed: postpending "_d" with the ${hb_targetname}. It has side-effects
difficult to manage. For example the project will never be able to
resolve sub-projects or library names, etc. Switching from debug to
production executable, make a small change in some of your sources
so that project is linked again. Thi is the only overhead which I
thought of avoiding but ended up in other problems.

+ Implemented: following actions for Watches:
1. Paste : adds a new watch by pasting selected text in active
editing instance. It equals to clicking on <Add> icon
and then manually inputting the expression.
2. Add : as usual adds a new record in Watches browser awaiting
input for expression.
3. Save : saves the list of Watch expressions into a disk file
with ".wch" extention and prefixed by project name plus
"_". Suppose you provide "first" as the name of the
file in File Selection dialog then saved file will be
like: debuggedProjectName_first.wch. You can have as many
sets as you like. If you select an exiting file then that
will be overwritten with visible expressions.
4. Restore: restores expressions off the saved .wch files as above.
Two options are provided while restoring;
a. Merge loaded expression with existing ones.
b. Clear existing expressions and load from file.
5. Delete : as usual deletes the current selected expression.
6. Clear : remove all expressions from the Watches list.




Image Link:

https://lh6.googleusercontent.com/-tDhzUk4H3Kk/VAesXjc8aRI/AAAAAAAADKM/pG9xZdOYNsU/s320/debugger_3.png

Pritpal Bedi

unread,
Sep 4, 2014, 1:53:51 AM9/4/14
to
In continuation...

2014-09-03 22:42 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r347)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r347.

* hbide/debugger.prg
* hbide/debugger.ui
+ Implimented: copy the debug information contained in various tables
onto clipboard. The info is formatted delimited by comma making it
compatible with MS Excel. The action can be initiated via clicking
on the newly added <Copy to Clipboard> button on top of debugger dock.
An image displaying how pasting clipboard in notepad will appear is
also uplaoded on message at QtContrib group.


Image Link:
https://lh6.googleusercontent.com/-rJEuwyi92Hc/VAf9oHamILI/AAAAAAAADKc/51tOrfP1r_E/s320/debugger_4_copy.png

Pritpal Bedi

unread,
Sep 4, 2014, 3:56:52 AM9/4/14
to
In continuation...

2014-09-04 00:37 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r348)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r348.

* hbide/debugger.ui
* hbide/debugger.prg
* hbide/saveload.prg
* hbide/setup.ui
+ Implemented: provision to provide source paths which will be used to
locate source files inside HbIDE debugger if path to such source
could not been located through project file .hbp. Please note that
order of such path entries is very much relevant to this protocol.
HOWTO:
1. Open <MainMenu><Setup><HbIDE Setup><Projects>.
2. Click on <Add> button contained in <Source Paths> groupbox.
3. Navigate to the desired folder in folder selection dialog.
4. Click "Open".
5. Keep a watch on order of folder selection. Sources will be
opened from first path they are contained in.
6. Add as many entries as needed.
7. To be sure that HbIDE remembers these settings, exit and
execute it again.

Play with the debugger. Please report back if you find bugs or
if you need any other feature not there yet.



Image Link:
https://lh5.googleusercontent.com/-vGzMuPv3G74/VAgak2gJQYI/AAAAAAAADKs/uEq3ipUFO8s/s320/debugger_5_sourcepaths.png

Pritpal Bedi

unread,
Sep 4, 2014, 8:09:44 PM9/4/14
to
2014-09-04 16:34 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r349)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r349.

* hbqt/qtgui/hbqt_hbqplaintextedit.cpp
* hbqt/qtgui/hbqt_hbqplaintextedit.h
* hbqt/qtgui/qth/HBQPlainTextEdit.qth
+ Added method void hbSetDebbedLine( int line ).
Used to highlight the line in editing source where debugger is stopped.

* hbide/debugger.ui
* hbide/debugger1.ui
+ Added: another tabWidget based debugger interface.
By default new interface is active. In case you want to bring back the
old interface, set "hbide_debugger_old=1" environmental variable prior
to executing HbIDE.

* hbide/hbide.hbp
+ Added: debugger1.ui

* hbide/debugger.prg
* hbide/main.prg
* hbide/projmanager.prg
+ Implemented: hightlighting the source lin in editing instance where
debugger is stopped at any given point of time. Requested by Francek.

% The line where debugger is stopped is now always scrolled to center
of the editing instance vertically.

+ Implemented: expanding the wild cards used in source entries in .hbp
which gets reflected in project node in "Projects Tree".
So if an entry like : c:\dev_source\vouch\*.prg is encountered then
all the .prg(s) deposited in "c:\dev_source\vouch" folder will be
added to the project tree. Requested by Francek.

+ Initialization of debugger where it calls the debugged application is
now done in a detached process. It may ( not sure ) solve problem
reported by Maurizio where custom error handler crashes the application.

+ Many small improvements leading to better debug session.



Image Link:
https://lh6.googleusercontent.com/-kXsYHJ4rtEc/VAj-j726pMI/AAAAAAAADK8/KYtu94BcnZY/s320/debugger_6_newui.png

winc...@gmail.com

unread,
Sep 6, 2014, 11:59:16 AM9/6/14
to
Pritpal, thanks for your avise, I try download and test this one.

Sorry for my later answers, I don't see this forum every days.

Winca

Pritpal Bedi

unread,
Sep 7, 2014, 3:38:32 PM9/7/14
to
In Continuation...

2014-09-07 11:56 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r351)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r351.

* debug/dbgconnect.prg
% Initialization of debugger is changed to honor only one-way, that is,
when fired from within HbIDE. Originally HwgDebugger is designed to
to be fired either-way, application-to-debugger or debugger-to-app.
This fixes race conditions in certain situations.

* hbide/debugger.ui
* hbide/debugger1.ui
+ added <SwitchUI_1|2> pushbuttons to activate either of the two
interfaces developed in recent days. It is a handy feature to switch
to the view most suitable for a particular purpose. The only point
of note is that interface resfresh completely only on next BP or STEP.

* hbide/debugger.prg
* hbide/edit.prg
* hbide/projmanager.prg
+ Implemented: <F5 GO>, <F10 STEP> and <F8 TOCURS> keyboard navigation.
Requested by Maurizio.

! Fixed not to show the highlighted row where debugger is stopped
at initialization which was causing great confusion.

+ Implemented: separation of location of different components of a project;
1. Sources - keep sources as and where you already have.
2. Project - keep project file .hbp anywhere you want.
3. Executable - keep executable anywhere required per production setup.
4. Run Executable - from folder as per your production/development setup.

So, if you have scenario like this ( per my company )
Source Folder - h:\DevAR\dev, h:\DevAR\dev\*source-sub-folders
Project Folder - h:\DevAR\dev
Execuable Folder - h:\DevAR\exes ( contains all dlls required )
Exe Run Folder - r:\artest ( executable must be run from here )

Then, HbIDE's debugger implimentation now supports it. How:
.
1. Build your project .hbp as usual as you would do for a normal project.
2. Open <Project Properties> dialog.
3. Enter folder path from where executable should start in <Start In>
field. In above example it would be "r:\artest".
4. Enter parameters needed to execute ( if any ) in <Launch Parameters>
field. We do not have to pass with out executable in above example.
5. Click on <Build Debugg and Launch> from <MainMenu><Build>.

Probably, this will cover <Dos 3> error reported by Maurizio.
Please test and let me know it debugger is working as intended or
something more is needed. I want to close HbIDE Debugger topic.

Massimo Belgrano

unread,
Sep 8, 2014, 5:25:11 AM9/8/14
to
Using build debug and launch with xharbour project i receive error

Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Fatal: Unable to open file 'HWGDEBUG.LIB'

hbmk2: Error: Running linker. 2

must i use from http://www.kresin.ru/en/debugger.html?

Massimo Belgrano

unread,
Sep 8, 2014, 5:37:40 AM9/8/14
to
Il giorno lunedì 8 settembre 2014 11:25:11 UTC+2, Massimo Belgrano ha scritto:

and after try use kresin's HWGDEBUG.LIB
Waited for ver. No answer. May be a bad query.
Not Connected, Debug Terminated !!

using hbide r351 with xharbour

Pritpal Bedi

unread,
Sep 8, 2014, 11:21:59 AM9/8/14
to
Hi Massimo


> Fatal: Unable to open file 'HWGDEBUG.LIB'


You need to compile with xHarbour harbour/addons/debug producing
hwgdebug library and put it in xHarbour lib folder.


Pritpal Bedi

Pritpal Bedi

unread,
Sep 8, 2014, 11:24:37 AM9/8/14
to
Hi


> and after try use kresin's HWGDEBUG.LIB
>
> Waited for ver. No answer. May be a bad query.
>
> Not Connected, Debug Terminated !!


Recompile hwgdebug library as I pointed out in earlier message.
You might be using the one which is shepped with hgw repository.
The hand-shake is changed a bit.


Pritpal Bedi

Massimo Belgrano

unread,
Sep 8, 2014, 12:39:50 PM9/8/14
to

in addons\debug folder
hbmk2 hwgdebug.hbp -xhp

hbmk2: Elaborazione in corso delle opzioni d'ambiente: -comp=bcc
hbmk2: Compilazione dei sorgenti Harbour in corso...
G:\CLIP52\XH\include\hbsetup.ch(66) Warning W0002 Redefinition or duplicate def
inition of #define HB_COMPAT_C53
debugger.prg(208) Error E0030 Syntax error "syntax error at 'FUNCTION'"


Pritpal Bedi

unread,
Sep 9, 2014, 3:43:35 AM9/9/14
to
In Continuation...

2014-09-09 00:31 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r352)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r352.

* hbide/debugger.ui
* hbide/debugger1.ui
+ Added: buttons <NextR [F6]> and <Trace [F8]> and shulled others.

* debug/dbgconnect.prg
* debug/debugger.prg
! Fixed: Fearse() calls which invariably erase the files on Linux even
if file is in use by other process. I cannot get this logic, anybody ?

% Reformatted to make it more readable and understandable.

* hbide/debugger.prg
* hbide/edit.prg
* hbide/projmanager.prg
+ Added and shuffled commands with corresponding buttons, like this:
F5 Go, F6 NextR, F7 ToCurs, F8 Step, F10 Trace

Rick Lipkin

unread,
Sep 9, 2014, 3:20:56 PM9/9/14
to
Pritpal

Please put this on your 'wish list' .. It would be great to have a 'jump list' on the right side of the editor to identify and take you to your User Defined Functions.

Many of my .prgs are over 1000+ lines with various Static Functions. It would be nice to be able to see a list of all defined .prg functions and be able to click on the UDF you wish to 'jump' to and edit.

If you have this already built in .. please dis-regard.

Many Thanks
Rick Lipkin

Pritpal Bedi

unread,
Sep 9, 2014, 3:48:08 PM9/9/14
to
Hi Rick

> Please put this on your 'wish list' .. It would be great to have a 'jump list' on the right side of the editor to identify and take you to your User Defined Functions.
>
>
>
> Many of my .prgs are over 1000+ lines with various Static Functions. It would be nice to be able to see a list of all defined .prg functions and be able to click on the UDF you wish to 'jump' to and edit.
>
>
>
> If you have this already built in .. please dis-regard.


This feature is there since beginning.
How:

1. Click on <Functions List> toolbar icon,
OR
<MainMenu><Views><Docking Widgets><Functions List>
2. Have right-hand side docking widget containing list of functions in active editing instance.
3. Initially it appears in alphabetic order.
4. Right-click anywhere inside the list and have following options:
1. Show Sorted
2. Show in Natural Order
3. Show Code Fragment:
Opens a small window containing source lines contained in that function.
That tiny window can be resized. Ctrl+P within that windows opens
a print-preview dialog with various options.
Keep as many tiny windows open as you wish.
4+ Not implemented yet.
5. Double-click on any function entry and have editing cursor jumped to that method.

Always remember that CTRL+L always returns you to last editing position no matter where and how you navigated to another line in the source.

Is that enough ?

Pritpal Bedi

unread,
Sep 9, 2014, 9:23:32 PM9/9/14
to
In Continuation...


2014-09-09 18:22 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r353)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r353.

* hbide/debugger.ui
* hbide/debugger1.ui
+ Added: button <btnObjBack>.

* debug/debugger.prg
% Minor.

* hbide/debugger.prg
+ Implemented: drill-down of arrays and objects vai <Object|Array Inspector>
and returning one level up upwards. First level is when object inspector
is invoked from <Variables> tabs. Drill-down then is achieved by double-
clicking on an array or object entry in <Object Inspector> table.
Returning to one-level-up is achieved by clicking on <Back> button made
active along title-bar of <Object Inspector> widget.

Pritpal Bedi

unread,
Sep 12, 2014, 3:07:50 AM9/12/14
to
In Continuation...


2014-09-11 23:33 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r355)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r355.

* debug/dbgconnect.prg
+ Added code which will be useful for next generation debugger.
After each response written in response file, handle is closed
and opened again. This action initiates date-stamp change
on the response file which in turn is being "watched" by the
debugger. For now it facilitates to log so many things in
"Output Console".

* hbide/debugger.ui
* hbide/debugger1.ui
+ Added button <btnExpand> in the title area of <Object Inspector>.
Clicking on this button automatically drill-down the elements of
type array, formats them, and finally presents the drilled values
of entire array ( from the point click is initiated ) in a
stay-on-top simpel editor, just like code-fragments, syntax highlighted
and ready to be sent to printing preview.
Expand operation can be performed on the variable of type object also.
In this case only array members will be expanded along-with variables
and methods list.
WARNING: large arrays may take longer period, so use it with caution.

* hbide/debugger.prg
* hbide/editor.prg
* hbide/main.prg
% Changed: debugger info copied to clipboard via <Clipboard> button will
fire a stay-on-top widget containing the debug info. This is the same
editor deployed for <btnExpand> output as above. The only difference
is in the highlighter theme which is different in both cases.

! Fixed: to honor the break-points in real-world scenario. Till now
BPs were initiated only from editing instances hosting the source
contained in the project. It had a severe side-effect. A project
may contain sub-projects or mere libraries were sources contained
in those libraries cannot be determined prehand and it rendered the
whole process ineffective.

Now clicking on line-number area on any editing instance tried to set
BP on current project being debugger. If the source name is matched
inside debug info retained by the application, it is entertained,
otherwise discarded. So the onus to determine a valid BP is transferred
to Harbour debug engine.



Image Link:
https://lh5.googleusercontent.com/-IAAUVShLl7o/VBKa8BHOMuI/AAAAAAAADLo/9OfoLo1cTXw/s1600/debugger_8.png



Jacek K.

unread,
Sep 12, 2014, 4:09:42 PM9/12/14
to
I have xHarbour 0.99.7 and xMate
How I can migrate to HbIde?
In install package I don't see examples how create script or configuration
enviroment for xHarbour 0.99.7

Regards

Jacek K.

Pritpal Bedi

unread,
Sep 13, 2014, 3:40:48 AM9/13/14
to
Hi Jacek

This link will give you start-up instructions.

https://groups.google.com/forum/?fromgroups#!searchin/qtcontribs/%7Bcontent%7D$20set$20HB_COMPILER$3Dbcc/qtcontribs/Xo3nrem7di8/VrwEnhuv0DUJ

Let me know if you succeeded or ask any questions you may have.

Pritpal Bedi

unread,
Sep 14, 2014, 4:21:59 AM9/14/14
to
In Continuation...


2014-09-14 12:43 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r357)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r357.

* debug/dbgconnect.prg
% Minor.

* hbide/debugger.prg
* hbide/misc.prg
* hbide/projmanager.prg
+ Implemented: Text lines dumped in <Output Console> are now prefixed
with Seconds() with 3 decimal places. The ideas is to have a
generic profiler which serves two purposes:
1. Identified each line with a number useful to ask support
questions in context of this identifier.
2. To measure the time taken in between two actions.

+ Restructured the whole engine how debugger and application communicates.
In console mode debugger mechanism there is only one way ( at a time )
to transfer control from debugger to application or vice-versa.
But in a GUI debugger it is not possible. The actions are initiated
independently by the debugger and application which are suseptible to
dead-lock type situations more often. I have tried to overcome
this problem and have been successful greatly. Ultimately, you will
be the better judge to tell how good it is behaving.

This exercise has resulted in a faster execution also.



Image Link:
https://lh4.googleusercontent.com/-gkzHqSspsOw/VBVPPSVVY-I/AAAAAAAADL4/T66FWoxJXdc/s1600/debugger_9.png


Pritpal Bedi
a student of software analysis and concepts

Pritpal Bedi

unread,
Sep 15, 2014, 1:28:49 AM9/15/14
to
In Continuation...


2014-09-14 21:43 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r358)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r358.

* hbdbu/dbu.prg
* hbqtwidgets/hbqtdbu.prg
+ Implemented to consume HbDBu specific table-info string in the format:
Main,C:\harbour\tests\test.dbf,TEST,DBFCDX,0,500,2,0 0 300 504,21,1,,,,
=>
View TableName Alias Driver Order Record ...
on the command line needed to fire the component via debugger's
WorkAreas table (Read Below).

* debug/debugger.prg
+ implemented to return more information about the work areas.

* hbide/debugger.prg
* hbide/projmanager.prg
! Fixed: two regressions reported by Itamar, thanks.

+ Implemented tooltip on <Alias> field of <WorkAreas> table depicting
some more information about this workarea:
1. TABLE_PATH - c:\harbour\tests\test.dbf
2. INDEX_PATH - c:\harbour\tests\test.cdx
3. ORD_TAG_EXP - 1 : LAST : test->last
4. <INDEXES>
[ 1 : LAST ] test->last
...
...
</INDEXES>

+ Implemented opening the selected workarea in <WorkAreas> in either
IdeDBU or HbDBU. The feature can be activated from context-menu presented
by right-clicking on <Alias> field of selected work-area.


Image Links:

https://lh3.googleusercontent.com/-ROWQB300Pkc/VBZ3d9Sp3EI/AAAAAAAADME/ASvDPvzOWDo/s1600/debugger_10_1.png

https://lh6.googleusercontent.com/-zPhh_oxi010/VBZ3kFjnf6I/AAAAAAAADMM/IdurFlffaqs/s1600/debugger_10_2.png

https://lh5.googleusercontent.com/-4A3Us0D0BEM/VBZ3p1OjfNI/AAAAAAAADMU/JEfnVx0Vgc4/s1600/debugger_10_3.png


Pritpal Bedi
a student of software analysis and concepts

Pritpal Bedi

unread,
Sep 19, 2014, 9:50:22 PM9/19/14
to
In Continuation...


2014-09-19 17:25 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r360)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r360.

* debug/dbgconnect.prg
* debug/dbgdop.c
* debug/debugger.prg
+ Added more constructs to honor HbIDE implementation.
% Changed behavior of some components how these should interact with HbIDE.
+ Added code to supprt xHarbour projects.

* debug/hwgdebug.hbp
+ Added commented-out switch to turn-on for very old xHatbour builds.

+ hbide/resources/clipboard.png
+ Added new image.

* hbide/hbide.qrc
+ Added: clipboard.png.

* hbide/debugger.ui
% Scheduled to be removed from build.

* hbide/debugger1.ui
+ Added: few more control to have better debugging experience.
- Deleted: switching between two ui's. Original ui is deprecated.

* hbide/debugger.prg
* hbide/editor.prg
* hbide/projmanager.prg
+ Implemented: to pull only the components currently being viewed inside
user-interface. For example, if current tab is <WorkAreas> then only
workareas related info will be requested from the application. Navigating
the tabs will pull related info. The info will be pulled once only
for each tab until application is suspended after another STOP.
In that case all info will be deleted and fresh info downloaded for
the tab in view.

The above implementation has boosted-up the debugging speed per GUI
context where populating controls are a big overhead. Also it help
to remain responsive in very large applications written in sephagetti
style with hundereds of public/private variables hanging around all the
time. This has increased HbIDE's acceptance many fold.

+ Added: <Download All> button at the right-side corner of main tabs.
This can be clicked to download info for all components in all tabs.
But probably you may seldom need to click it in real sessions.

+ Added: <Copy Strucure> icon on the right-side corner of
<Record Inspector> component which is clubbed in <WorkAreas> tab.
This copies to the clipboard something like this:
LOCAL aStruct := { { "FIRST" , "C", 20, 0 },;
{ "LAST" , "C", 20, 0 },;
{ "HIREDATE", "D", 8, 0 },;
{ "MARRIED" , "L", 1, 0 },;
{ "AGE" , "N", 2, 0 },;
{ "SALARY" , "N", 6, 2 },;
{ "NOTES" , "C", 70, 0 } }
The intent is to provide a mechanism where structure info could be
consumed as a variable directly in the source code.

+ Implemented: to change value of vriables.
Double-click on <Value> column in miscallaneous variables tab.
If the variable is of type C,D,N,L, then ui will allow to edit it. The
changed value will be applied instantly in the application. Resumed
execution will honor its value. Note that variables of type character
are always displayed inside double-quotes. You must not overwrite
them when editing.

+ Implemented: a way to send any information from within the application
to be published in HbIDE's <Output Console> similar like any debugging
tool. You can call it <IdeTrace>. We will refer it by this name onwards.
It is on top of the debugger protocol. It is a very powerful mechanism
to measure the performance of your code based on inserting it at
crucial points in source code. As <Output Console> prefixes every message
with time in seconds, which can become the basis of judging the
performance of your code. You will add something like this lines:
#ifdef __HBIDE_DEBUG__
IdeTrace( { "This is real-time push!", "This is another push!!" } )
#endif
#ifdef __HBIDE_DEBUG__
IdeTrace( xVariable )
#endif
#ifdef __HBIDE_DEBUG__
IdeTrace( "Customer info is missing" )
IdeTrace( { 6030, "Nevada Ave", ctod( "" ), .T. } )
#endif
Any type of variable is accepted, either an array of variables or literals.
You need not to #define __HBIDE_DEBUG__, HbIDE's build system automatically
defines it for debug builds. You can keep above debug points intact
for all types of builds.

Backdrop: as you know I had zero knowledge how Harbour debugger works,
I struggled at times to understand how the flow of request/response
behaves. For this I had to devise a mechanism where I could know
what is happening at the back-end. After it got implemented,
I realized how powerful it could be. Not only for debugging info,
but also for measuring performance between two execution points.
This simulates Qt creator's debugger protocol to an extent.

Pritpal Bedi

unread,
Sep 26, 2014, 5:44:14 AM9/26/14
to
In Continuation...


2014-09-26 01:55 UTC-0800 Pritpal Bedi (bedipritpal at hotmail.com)(r362)
* hbqt/qtgui/hbqt_version.ch
% Version bump to r362.

* hbqtwidgets/hbqtbrowse.prg
% Changed the 2nd argument to callback in :navigationBlock to send
{ nX,nY } mapped to window where the clicks originated instead of
global nX,nY position. It simplifies a lot of operations.

* debug/dbgconnect.prg
* debug/dbgdop.c
! Fixed to be compiled with xHarbour.

* debug/debugger.prg
+ Added: additional fields in SendAreas() where more info is added
about the tables, like order, fullpath, indexpath, index info.
comprising

+ hbide/debugger2.ui
+ Added MDI compliant debugger interface.
* hbide/hbide.hbp
+ Added debugger2.ui.

* hbide/debugger.prg
* hbide/saveload.prg
+ Implemented MDI interface to display/exploit debug elements taking
use of HbQtBrowse() as the prime component. Besides offering seemless
freedom to organize and view debug elements, this new protocol is
extremely fast as near as console-mode implementation.

WHY THIS CHANGE: My employers "Curacao" deploys extremely big and
complex application for its business operations
in-development since 1987 gradually ported to
xHarbour from Clipper. This is fondly called "AR".
AR is written in the then prevailing coding style
which is termed as "sephaghatti" with hundreds,
nay thousands, of public and private variables
embedded inside macros. When I executed it via
IdeDebugger, it took ages to refresh after every
STEP, just rendering IdeDebugger useless and hence
unacceptable to the management. I explored the
bottlenecks and soon discovered that populating
QTableWidget()'s items was killing it. Communication
of debugger and application was just in-time.
At one BP debugger UI took many minutes to populate
2577 public variables... Simply too much.

AND THE OUTCOME: After switching to HbQtBrowse() the exchange is
instant. No time-lag. And happily management has
accepted HbIDE and hence IdeDebugger to be deployed
for all fellow developers, at least for debugging
purposes.

OTHER BENEFITS: 1 Complete freedome to organize the various elements
to suit the taste and/or need by aspect of debugging.

2 Feature to Save/Load such organized unlimited "views"
even in the same session.

3 Drilling-down any multi-dimentional ragged arrays
to last element and view it all-together.

4 Preview and Print indivisual elements for future
reference or for cross verification.

; Attached image ( separately ) with QtContribs group message will
help grasp the true essense of this new interface.





Image Link:
https://lh6.googleusercontent.com/-La3d48yFV9Y/VCU0ZMv4fuI/AAAAAAAADPM/i-9XHp8qmjU/s1600/dbg-firsttime-0.png



Pritpal Bedi
a student of software analysis & concepts
0 new messages