* include/hbapi.h
* source/common/hbgete.c
+ Added hb_getenv_buffer(). Similar to hb_getenv() but
this one needs a buffer+size to be passed, so no memory
allocation is done by the function. It also return
a BOOL to signal success. It doesn't signal if passed
buffer was too small to store the value.
* source/debug/dbgtwin.prg
* source/debug/dbgbrwsr.prg
* source/debug/tbrwtext.prg
* source/debug/debugger.prg
! Fixed to not crash after switching to mono display.
DISCLAIMER: This is a quick patch (but even this took
hours) and it absolutely can be wrong, incomplete in
any ways. I'm not using or knowing debugger code, pls
patch it further on.
NOTE: Color refresh after switching mono/color mode
is still wrong and I've given up after trying
for a few hours.
* Minor formatting.
* harbour/source/pp/hbpp.c
* workaround for warning in some GCC versions which can lost
user casting during function autoinline optimization.
* harbour/source/rtl/console.c
* harbour/source/rtl/gtapi.c
* moved //INFO message from hb_gtInit() to hb_conInit()
* harbour/source/rtl/hbgtcore.c
* harbour/contrib/hbct/ctwin.c
* minor cleanup
* harbour/source/debug/debugger.prg
* changed __dbgInput() to return logical value and set edit value in
variable passed by reference
* harbour/source/debug/dbgtobj.prg
* harbour/source/debug/dbgthsh.prg
* harbour/source/debug/dbgtarr.prg
! fixed typo in VALID block declaration - it was array by mistake
* removed unnecessary code related to GET behavior
* use new __dbgInput() format
* harbour/source/debug/dbgtwin.prg
* use hb_scroll() instead of scroll()
* harbour/source/debug/tbrwtext.prg
! fixed screen redrawing in horizontal movement
* harbour/source/debug/debugger.prg
* harbour/source/debug/dbgtinp.prg
! replaced GET/GETLIST objects by HbDbInput()
! fixed some interface incompatibilities with Clipper debugger
* removed HB_NO_READDBG and code using GET classes - HbDbInput()
works better and is much simpler in use.
% do not use __GetListActive()/__GetListSetActive() - now debugger
does not touch GET/GETLIST so it's not necessary to save/restore
GETLIST state
Now all references (except HBCLASS) to external .prg code in
debugger have been removed.
TODO: remove HB_NO_READDBG from other debugger files replacing
code inside with __dbgInput()/HbDbInput().
I would like to leave it for someone else and return to
core code modifications.
* harbour/common.mak
* harbour/source/debug/Makefile
+ harbour/source/debug/dbgtinp.prg
+ added HbDbInput class for simple user input (GET)
* harbour/source/debug/debugger.prg
! changed __dbgInput() to use HbDbInput() class instead of ACCEPT
It fixes all bad visual end edit bad effects caused by ACCEPT.
TODO: replace all GET references in debugger code with HbDbInput class.
* common.mak
* make_b32.bat
* make_b32.mak
* make_vc.bat
* make_vc.mak
* make_gcc.mak
* HB_BUILD_VERBOSE=yes is now the default. If someone
is wanting to build Harbour from source and is bothered
by the compiler command-lines being shown, these can
be turned off with HB_BUILD_VERBOSE=no.
These lines are IMO very important to see, which options
were exactly used when Harbour was built, I personally
archive these logs along with the builds.
* make_b32.mak
* make_vc.mak
* make_gcc.mak
+ Readded -b when HB_BUILD_STATIC=yes.
Now it should work.
* make_b32.mak
* make_vc.mak
* make_gcc.mak
* contrib/mtpl_b32.mak
* contrib/mtpl_gcc.mak
* contrib/mtpl_vc.mak
% Deleted -l- switch when HB_BUILD_STATIC=yes.
Line numbers are automatically enabled when
-b switch is used.
* source/debug/debugger.prg
* Renamed getdbginput() -> __dbgInput()
; NOTE to TOFIX: Do we need "Mono display" these days? :)
* harbour/source/debug/dbgbrwsr.prg
* harbour/source/debug/dbgtwin.prg
* harbour/source/debug/tbrwtext.prg
* harbour/source/debug/dbgwa.prg
* harbour/source/debug/debugger.prg
* harbour/source/debug/dbghelp.prg
* harbour/source/debug/dbgtmenu.prg
* harbour/source/debug/dbgtmitm.prg
* use hb_dispOutAt()/hb_dispBox() instead of DispOutAt()/DispBox()
! fixed using ADel()/AIns() with xHarbour extended parameters
! fixed RT debugger errors caused by missing ::nTabWidth and ::colorSpec
in HBBrwText class
! fixed processing source code with TABs (chr(9))
; TOFIX: "Mono Display" causes RT error due to missing color index
range checking. It also does not change all colors immediately
; TOFIX: getdbginput(): writing out of window area, scrolling internal
buffer, cursor navigation, interrupting by ESC
* harbour/source/debug/dbgtobj.prg
* harbour/source/debug/dbgbrwsr.prg
* harbour/source/debug/dbgtwin.prg
* harbour/source/debug/dbgmenu.prg
* harbour/source/debug/dbgthsh.prg
* harbour/source/debug/tbrwtext.prg
* harbour/source/debug/debugger.prg
* harbour/source/debug/dbgtarr.prg
* harbour/source/debug/dbgtmenu.prg
* harbour/source/debug/dbgtmitm.prg
* use #define HB_CLS_NOTOBJECT to disable inheritance from HBObject
in internal debugger classes.
Here is complete list of other .prg functions still used by hbdebug
library:
GET, __GETLISTACTIVE, __GETLISTSETACTIVE, HBGETLIST, ACHOICE,
HB_CSTR, HBCLASS
* harbour/source/debug/tbrwtext.prg
! fixed vertical navigation to be compatible with old debugger
and Clipper
! fixed horizontal scrolling to the size of maximal line
not to the size of current line
% use single call to hb_aTokens() to convert source code into array
* harbour/source/debug/dbgbrwsr.prg
! added missing #include "common.ch"
! added missing colorBlock variable in HBDBColumn class
% replaced .prg wrappers for type checking with native
harbour class type validation
* source/debug/tbrwtext.prg
* Replaced with new implementation from Lorenzo Fiorini.
Sent to the list on 2008.07.26.
; NOTE: Some issue were reported with this, but it's again
a step into the right direction, please try to update
this code to better resemble to Clipper and to fix
possible error. Thanks.
; Remaining RTL .prg dependencies:
- ACHOICE() (just one call)
* source/debug/debugger.prg
* Using hb_MemoWrit() instead of MemoWrit()
* source/rtl/achoice.prg
% Minor opt.
* harbour/include/hbstack.h
* harbour/source/vm/estack.c
* harbour/source/vm/hvm.c
* harbour/source/debug/dbgentry.c
* harbour/source/debug/debugger.prg
* moved debugRequest flag and debugger internal structure
pointer to HVM stack
* allocate debugger internal structure dynamically in thread
thread local area when PCODE with debug information is executed
* changed STATIC s_oDebugger to THREAD STATIC
* send HB_DBG_VMQUIT after each thread termination when
debugger is activated
Now debugger can be used in MT programs and each thread can be
debugged separately (each has its own debuger). Please only
remember that thread sharing console window can overwrite other
threads debugger screen. There is also one limitation which I'll
try to remove later: only main thread debugger keeps information
about file wide STATIC names and line numbers with possible break
point places. This data should be shared between debuggers.
* harbour/include/hbapi.h
* harbour/source/vm/hvm.c
* harbour/source/vm/estack.c
* disabled all debugger related bindings and variables when
HB_NO_DEBUG macro is set
% moved s_fDebuging to HVM function stack frame to eliminate
saving/restoring this variable in each function/message call
Note: if you think it's good to block linking .prg code compiled
with -b (debugger support) with HVM compiled with HB_NO_DEBUG
then it's enough to disable whole hb_dbg_SetEntry() function
in hvm.c when HB_NO_DEBUG macro is set.
* make_b32.mak
* make_vc.mak
* make_gcc.mak
* Removed disabling -b for non-debug builds.
; We aim to remove RTL .prg dependencies from hbdebug.lib,
either by local implementation, .c rewrite, or force
disabling debug mode in more core files.
Until this happens, one will have to be careful with
using -b switch to compile Harbour. These are the core .prg
modules currently used by hbdebug.lib:
- HBGETLIST(), GET(), __GET(), __GETLISTACTIVE(), __GETLISTSETACTIVE(), READINSERT(), READMODAL()
- HBCLASS()
- HBOBJECT()
- HBEDITOR()
- TBCOLUMNNEW()
- ACHOICE()
- ALERT()
* source/debug/dbgtobj.prg
* source/debug/dbgbrwsr.prg
* source/debug/dbgtwin.prg
* source/debug/dbgmenu.prg
* source/debug/dbgthsh.prg
* source/debug/tbrwtext.prg
* source/debug/dbgwa.prg
* source/debug/debugger.prg
* source/debug/dbghelp.prg
* source/debug/dbgtarr.prg
* source/debug/dbgtmenu.prg
* source/debug/dbgtmitm.prg
+ Readded '#pragma DEBUGINFO=OFF'.
* source/debug/dbgtobj.prg
* source/debug/dbgbrwsr.prg
* source/debug/dbgtwin.prg
* source/debug/dbgmenu.prg
* source/debug/dbgthsh.prg
* source/debug/tbrwtext.prg
* source/debug/dbgwa.prg
* source/debug/debugger.prg
* source/debug/dbghelp.prg
* source/debug/dbgtarr.prg
* source/debug/dbgtmenu.prg
* source/debug/dbgtmitm.prg
+ Added '#pragma DEBUGINFO=OFF' to debugger
sources. Otherwise compiling full Harbour with
-b was causing an infinite loop. (this is now
the default when building with
'HB_BUILD_DEBUG=yes'.
* source/rdd/nulsys/nulsys.c
! Added DBSELECTAREA(), DBSTRUCT(), HEADER(),
RECSIZE(), LUPDATE()
so that programs can be built with -b and
hbnulrdd.lib. hbdebug.lib/dgbwa.prg uses
symbols above.
* harbour/contrib/hbwin/win_tole.prg
! Fixed assignment to oErr:Operation from "+" to "-" in
OleValueMinus() method - fix by Luis Krause Mantilla borrowed
from xHarbour
* harbour/source/rdd/wacore.c
; updated comments about xbase++ behavior in dbRelease()
* harbour/include/hbvm.h
* harbour/source/vm/hvm.c
* harbour/source/vm/dynlibhb.c
* harbour/source/vm/runner.c
! added MT protection for HB_LIBLOAD()/HB_LIBFREE() and
HB_HRBLOAD()/HB_HRBUNLOAD(). Please remember that you should
not use any external LoadLibrary() functions because they are
not protected for clean PCODE modules loading/unloading even
in ST mode. Using them can cause HVM internal structure corruption.
If we have such functions in contrib then they should be redirected
to our HVM ones.
There is still one problem in MT mode which has to be resolved yet.
When dynamic library containing PCODE using static variables
is loaded 1-st time then it will force resizing of internal array
with static variables. If in exactly the same moment some other
thread operates on static variable then it may cause corruption.
To resolve this problem we will have to divide continuous memory
block common for all modules where we store all static variables
into separated blocks bound with each PCODE module (symbol table).
* harbour/source/vm/dynlibhb.c
+ added support for DLL loading/unloading in OS2 builds.
Based on xHarbour code by Maurilio Longo - please test.
* harbour/source/vm/thread.c
+ added small description for hb_threadOnce() .prg function
* harbour/include/hbthread.h
! do not set TLS in POCC and XCC builds when _MSC_VER macro is set
This compilers also have this macro but dllspec( thread) does
not work for them (at least in version 4.50.15)
* harbour/utils/hbtest/rt_hvm.prg
+ added few tests which exploit by DMC bug. Be careful with
this compiler. In some cases it gives buggy final code, f.e.
try this:
#include <stdio.h>
typedef struct
{
double dd;
long long int ll;
} UN;
const char * cmp( UN * pU )
{
return pU->dd >= pU->ll ? "OK" : "ERRROR";
}
int main( void )
{
UN u = { 10.50, 10 };
printf( "%s\n", cmp( &u ) );
return 0;
}
The same bug can be exploited also by final Harbour binaries
compiled by DMC in code like:
? iif( 10.50 >= 10, "OK", "ERROR" )
I used DMC 8.42n. As long as such things will not be fixed by
DMC developers this compiler is not supported by Harbour and
reported problems with DMC Harbour builds will have to be
ignored by us.
* harbour/include/hbclass.ch
* harbour/source/vm/classes.c
* harbour/source/rtl/tobject.prg
* harbour/source/rtl/tclass.prg
! fixed race condition when class function is called 1-st time
and new class is created. It was possible that more then one
thread execute this function simultaneously and two classes
identical classes but with different handles were created
and registered in HVM
* harbour/contrib/xhb/xhbcomp.prg
* updated hack with optional inheritance for new class code