* source/debug/dbgentry.c
* contrib/xhb/hbxml.c
* contrib/hbbtree/hb_btree.c
% hb_itemRelease( hb_itemReturn() ) -> hb_itemReturnRelease()
* contrib/xhb/hbxml.c
! Applied this fix from xhb:
2008-11-06 20:00 UTC+0100 Jose F. Gimenez <jfgimenez/at/wanadoo.es>
! 'Escape' characters, such & or " were not written correctly in node attribute values
! 'Escape' characters in the form &#NN; and &#xHH; were not allowed when reading
* harbour/source/vm/memvars.c
* modified __mvDbgInfo():
- accept as 1-st parameter also HB_MV_PRIVATE_LOCAL and
HB_MV_PRIVATE_GLOBAL values
- changed parameters meaning now when less then 3 parameters is
given this function returns number of variables and the second
parameter is the call stack level. Memvar value and optionally
name is returned only if 3 or more parameters is given.
3-rd party code which used this function with two parameters
has to be updated.
* harbour/source/debug/debugger.prg
* mark non local private variables in monitor as "Private^" (with "^")
* do not show public and private variables hidden by other private
declarations
* harbour/source/debug/dbgwa.prg
! Guard against recursive debugger activation when a user callback
containing debug info is implicitly called from the debugger's workarea
browser. By Phil Krylov borrowed from xHarbour.
* harbour/source/vm/arrays.c
! protection against possible GPF in hb_rAscan() if user block
reduces the array size
* harbour/source/debug/tbrwtext.prg
! fixed source color text to be more Clipper compatible.
Borrowed from xHarbour by Phil Krylov
* harbour/source/debug/debugger.prg
! added missing :forceStable() to refresh the screen after break point
setting
* harbour/source/vm/fm.c
! fixed typo in default FM module setting/
* harbour/include/hbapicls.h
* harbour/source/vm/classes.c
* harbour/source/debug/dbgentry.c
* renamed hb_dbgObjSendMessage() to hb_dbg_objSendMessage() to keep
naming convention used for other C debugger functions
* harbour/source/vm/debug.c
* added information about existing debugger functions and where they
are used.
* harbour/include/hbvm.h
* harbour/include/hbapidbg.h
* harbour/include/hbvmpub.h
* harbour/include/hbstack.h
* harbour/include/hbapi.h
* harbour/source/vm/codebloc.c
* harbour/source/vm/estack.c
* harbour/source/vm/hvm.c
* harbour/source/debug/dbgentry.c
* changed the method of static variable handling. Now we do not
have centralized array of all statics used by application (s_aStatics)
but each module uses it's own array to keep statics. The old
s_aStatics has been removed. It means that loading new PCODE module
from .hrb file or shared/dynamic library does not cause any static
table reallocation so it does not creates potential GPF trap for MT
code which may operate on static vars.
This modification changed a little bit the debugger interface.
I also updated some unused by us debug functions like __DBGVMVARSLIST()
or __DBGVMVARSLEN() anyhow any 3-rd party debuggers should be
updated for new API and modified hb_dbgEntry() syntax.
* include/hbclass.ch
* include/hbcomp.ch
* include/hberrors.h
* include/hbgenerr.c
* include/hbmain.c
* include/hbopt.c
+ PCode optimizations:
1) Self := QSELF(), Self:method -> QSELF():method
2) Declared, but unused variables are removed from code
These optimizations are enabled if jump optimizations are enabled.
+ added recursive pcode tree tracer. It is capable to generate new
warning: Variable %s is assigned, but not used.
Warning is not generated in these cases:
1) unoptimal Self := QSELF() pcode [generated by preprocessor rules]
2) if variable name starts with '_nowarn_'. This allows to
suppress warning in case unoptimal pcode is generated by
preprocessor rules
3) assigned value is NIL. This let us force garbage collection
using oVar := NIL
Warning has warning level 3.
; NOTE: if you are using -w3 -es2 in makefiles, you'll need to fix your
redundant code to compile the project
* source/rtl/achoice.prg
* source/rtl/browse.prg
* source/rtl/tbrowse.prg
* source/rtl/teditor.prg
* source/rtl/tget.prg
* source/rtl/tgetlist.prg
* source/rtl/tlabel.prg
* source/rtl/tmenusys.prg
* source/rtl/tpersist.prg
* source/rtl/treport.prg
* source/debug/dbgtmenu.prg
* source/debug/debugger.prg
* source/debug/dbgtobj.prg
* fixed 'assigned but not used' warnings
* utils/hbdoc/hbdoc.prg
* utils/hbdoc/genasc.prg
* utils/hbdoc/genhpc.prg
* utils/hbdoc/genhtm.prg
* utils/hbdoc/genchm.prg
* utils/hbdoc/genng.prg
* utils/hbdoc/genos2.prg
* utils/hbdoc/genrtf.prg
* utils/hbdoc/gentrf.prg
* utils/hbdoc/ft_funcs.prg
* utils/hbmake/hbmake.prg
* #pragma -w2
; NOTE: I've been fixing warnings in utils/hbdoc/* for 2 hours,
but only fixed half of files. There are a lot of garbage code here.
I do not thing this code is working...
I used fallback method: restored original files and used -w2
; NOTE: hbmake.prg has about 140 unused assignments.
I've also fallback to -w2, because some of unused code is complex,
ex., ASCAN() with block parameters. I'm not using hbmake, and I'm
affraid to break something important.
* compiler/hbpcode.c
- removed Ron's copyright on hb_compStrongType(). We do not have this
functions in the compiler at all. I guess this text is just a result
of .c header copy-paste from xHarbour's hbstrong.c some time ago.
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
+ added hb_atomic_set(), hb_atomic_get(), hb_atomic_inc() and
hb_atomic_dec() functions which operates on HB_COUNTER or smaller
type if it's necessary for some platforms which can be access/assign
increment/decrement in MT safe atom operations.
hb_atomic_dec() returns true if counter is 0 after decrementation
* harbour/include/hbatomic.h
! fixed compilation in Linux and OpenWatcom
* harbour/include/hbapiitm.h
* harbour/source/rtl/itemseri.c
+ make hb_itemSerialize() and hb_itemDeserialize() public functions
! fixed serialization items with internal item references
* harbour/source/vm/hvm.c
* release memvars after closing RDDs
* harbour/source/debug/dbgentry.c
! fixed buffer overflow reported by Rodrigo
* harbour/source/vm/macro.c
* harbour/source/compiler/hbmain.c
* formatting
* harbour/include/hbexprb.c
! fixed wrongly recognized functions with HB_I18N_ prefix as
HB_I18N_GETTEXT()
* harbour/include/hbapi.h
* harbour/include/hbstack.h
* harbour/include/hbthread.h
* harbour/source/vm/estack.c
* harbour/source/vm/thread.c
* harbour/source/vm/hvm.c
+ added support for I18N in HVM.
Each thread can have it's own i18n set.
When new thread is created then it inherits i18n set from parent
thread and both uses the same set (please remember about it if you
will want to make some direct modifications on active i18n set
internals).
When thread change active i18n set then it effects only this thread
and new threads which will be create later. It does not change i18n
in other existing threads.
+ added functions to set/get pointer to active i18n set in HVM
void * hb_vmI18N( void )
void hb_vmSetI18N( void * )
* harbour/include/hbapi.h
* harbour/source/rtl/hbi18n.c
+ added i18n module. Now only for internal Harbour usage without support
for optional switching to alternative implementations.
I'll add such functionality later when I will work on native gettext
support.
The following public .prg functions has been added:
HB_I18N_GETTEXT[_STRICT]( <cMsgID> [, <cContext> ] )
-> <cTranslatedMsgID> | <cMsgID>
HB_I18N_NGETTEXT[_STRICT]( <nValue>, <cMsgID> | <acMsgID> ;
[, <cContext> ] )
-> <cTranslatedMsgID> | <cMsgID> | <acMsgID>[ <nIndex> ]
This is minimal support necessary for .prg code which has to exists
in each i18n module working with Harbour.
The following functions had been added as public C API:
PHB_ITEM hb_i18n_gettext( PHB_ITEM pMsgID, PHB_ITEM pContext )
PHB_ITEM hb_i18n_ngettext( PHB_ITEM pNum,
PHB_ITEM pMsgID, PHB_ITEM pContext )
The following functions had been added as private HVM C API:
void hb_i18n_init( void )
void hb_i18n_exit( void )
void hb_i18n_release( void * cargo )
void * hb_i18n_alloc( void * cargo )
They have to be supported by alternative i18n modules
The following functions has been added to manage Harbour i18n
translations sets:
HB_I18N_CREATE()
-> <pI18N>
Creates new empty I18N translation set
HB_I18N_CODEPAGE( [<pI18N>,] [<cNewCP>], [<lBase>], [<lTranslate>] )
-> <cOldCP>
Gets or sets Harbour codepage used by translation set
<pI18N> - I18N translation set,
if it's not given then currently active I18N set is used
<cNewCP> - new CP ID. Must be linked with application
<lBase> - when it's .T. then get/set base massages CP instead of
translated massages CP
<lTranslate> - if it's .T. then translate base (<lBase>==.T.) or
final messages in I18N set from previous CP to
given one. Base messages translation in synced
with context ID translation.
HB_I18N_PLURALFORM( [<pI18N>,] [<cNewForm>|<bNewForm>], [<lBase>] )
-> <cOldForm>|<bOldForm>
Gets or sets plural form used for final or base messages
<pI18N> - I18N translation set,
if it's not given then currently active I18N set is used
<cNewForm> - language ID of plural form, f.e.: "EN", "PL", "LT".
Now only three above are supported. Please add rules
for other languages to source/rtl/hbi18n.c.
<bNewForm> - codeblock used to calculate plural form indexes.
can be used instead of character representation but
it's not storred in serialized I18N set
<lBase> - when it's .T. then get/set base massages plural form
instead of translated massages one.
HB_I18N_DESCRIPTION( [<pI18N>,] [<cNewDescription>] )
-> <cOldDescription>
Gets or sets translation set description. After serialization
up to 32 bytes is stored in header which can be easy used to
determinate type of translation file.
<pI18N> - I18N translation set,
if it's not given then currently active I18N set is used
<cNewDescription> - new description
HB_I18N_ADDTEXT( <pI18N>, <cMsgID>, <cTrans> | <acTrans> [, <cContext> ] )
-> NIL
Adds new message with translation to i18n translation set
<pI18N> - I18N translation set
<cMsgID> - original message
<cTrans> - translated message
<acTrans> - array with translated messages used for plural forms
<cContext> - message context
HB_I18N_SET( [ <pI18N> | NIL ] )
-> <lActive>
Sets given I18N translation set as default one used by
HB_I18N_[N]GETTEXT[_STRICT]() functions or remove translation
set for calling thread when passed parameter is NIL
<pI18N> - I18N translation set
Returns logical value which is .T. when i18n set is active
HB_I18N_SAVETABLE( [<pI18N>] )
-> <cTable>
Returns I18N translation as string item which can be stored
in file or database
<pI18N> - I18N translation set, if it's not given then currently
active I18N set is used
HB_I18N_RESTORETABLE( <cTable> )
-> <pI18N> | NIL
Restores I18N translation set from strin item.
<cTable> - I18N translation set in string representation
On success it returns new <pI18N> set otherwise NIL if <cTable>
is not valid item created by HB_I18N_SAVETABLE() or it's corrupted.
HB_I18N_HEADERSIZE()
-> <nHeaderSize>
Returns size of header used by i18n serialized version
HB_I18N_CHEK( <cTable> | <cHeader> [, @<cDescription> ] )
-> <lValid>
<cTable> - i18n translation set serialized by HB_I18N_SAVETABLE
<cHeader> - header of i18n translation set
( LEFT( <cTable>, HB_I18N_HEADERSIZE() )
<cDescription> - optional parameter passed by reference where
will be sored i18n translation set description
extracted from valid header
Returns logical value indicating if given table or header is
valid serialized by HB_I18N_SAVETABLE() data. It does not
decode the table though it validates size and control sums.
These functions are optional and some future alternative implementations
may not support all of them and/or may provide some other functions.
+ added unofficial .prg function __I18N_HASHTABLE() which allows to
access hash table used by i18n translation set or create new translation
set with given hash table. It's helper functions for developers which
will work on Harbour i18n tools and should not be used by Harbour users.
Unlike original gettext Harbour allows to use language with many
plural forms as base one. In such case programmer should activate
at application startup default i18n translation set with base plural
form valid for base application language, f.e. by:
pI18N := hb_i18n_create()
hb_i18n_pluralForm( pI18N, <cLangID> | <bForm>, .t. )
hb_i18n_set( pI18N )
.prg code example:
#xtranslate _( <x,...> ) => hb_i18n_gettext_strict( <x> )
#xtranslate _N( <x,...> ) => hb_i18n_ngettext_strict( <x> )
proc main()
local pI18N, i
pI18N := hb_i18n_create()
hb_i18n_pluralForm( pI18N, "PL", .t. )
hb_i18n_set( pI18N )
for i := 0 to 30
? i, _N( i, {"grosz", "grosze", "groszy"} )
if i > 0 .and. i % 10 == 0
wait
endif
next
return
In .pot files created during compilation by Harbour with -j option
for above code we have the following entries for message with plural
forms:
msgid "grosz"
msgid_plural "grosze"
msgid_plural2 "groszy"
msgstr[0] ""
The msgid_plural2 (and others if language has more plural forms)
is Harbour extension which is not gettext compatible.
The above implementation is base version but should be fully functional.
Now we will need functions to safe/read i18n files and tools to mange
.pot files: merge them, edit translations, create final binary i18n
translation sets. Because we are using gettext compatible .pot files
then for some of such jobs we can use original gettext tools but we
need at least function which will create translation set from one or
more .pot files.
We should also agree some default localization(s) for files containing
translated data, their name convention and environment variable(s)
to set default language. It's not strictly necessary and each user
can have his own implementation but it would help in adding new
translations by final users to any Harbour application which will
respect them. We can use LANG envvar to extract preferred language
and use the same path as executed application looking for files
<appname>-<lang>.hil files though it may create some problems for
OSes which support only 8.3 file names so we can also define that
HB_I18N envvar has higher priority and points to expected translation
file.
* harbour/include/hbextern.ch
- removed old __i18n_*() functions
+ added current i18n functions
* tests/longstr.prg
* contrib/hbole/oleauto.prg
* contrib/hbole/ole2.c
* contrib/gtwvg/wvgutils.c
* contrib/gtwvg/wvgcore.c
* contrib/hbgd/gdbarcod.prg
* contrib/hbgd/gdbar.prg
* contrib/hbwin/win_tole.prg
* contrib/hbwin/win_ole.c
* contrib/hbvpdf/hbvpdf.prg
* contrib/examples/hbsqlit2/tests/hbsqlite.prg
* contrib/examples/hbsqlit2/TODO.txt
* contrib/examples/hbsqlit2/hbsqlit2.c
* source/debug/dbgwa.prg
* source/rtl/gtwin/gtwin.c
* source/rtl/tget.prg
* source/rtl/tgetint.prg
* source/compiler/gencobj.c
! Removed high chars from comments. This usually means
copyright holders' names. I apologize for touching
them, I also have one in mine, but it's better to
not use them in source code to avoid encoding problems.
* source/rtl/tbrowse.prg
* source/debug/debugger.prg
! Cleaned hb_AINS()/hb_ADEL() usage after changing the
default of the last parameter.
Should fix the recent TBrowse() crash.
; NOTE: I'll rethink the defaulting situation at least
for hb_AINS().
* source/common/hbstr.c
* Some tweaks to hb_snprintf(). It still doesn't work
for some reason.
* include/hbapi.h
+ Added hb_snprintf() to header.
* source/debug/dbgentry.c
* Changed strcpy() to hb_strncpy(). Chances are high
this is wrong. Please review and test.
* source/debug/debugger.prg
! Fixed error when moving in the call stack window to an source prg
not included in the path, and a ::oWndVars (Monitor of vars) is opened.
* source/debug/debugger.prg
! Fixed error when selecting "Restore Settings" and the current prg source
is not in the "path for Files" option. (NIL ::oBrwText at line 1478 on
debugger.prg)
* 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/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.
* 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.
* 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.
* source/debug/debugger.prg
* source/rtl/typefile.prg
* source/rtl/tgetlist.prg
* source/rtl/treport.prg
* source/rtl/teditor.prg
* Using [Q]QOut() functions instead of "[?]?" commands.
* Using hb_Run() function instead of RUN command.
* source/rtl/typefile.prg
% Upped read buffer.
* Formatting.
% Got rid of a few unnecessary initialization.