Commit Graph

20 Commits

Author SHA1 Message Date
Przemysław Czerpak
fde8db1e35 2014-05-20 17:03 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/debugger.prg
    ! calculate ListBox coordinates as integer value
      (it fixes RTE reported by Rolf in SWITCH statement)

  * src/debug/dbghelp.prg
    ! fixed number of help pages calculation
2014-05-20 17:03:11 +02:00
Przemysław Czerpak
7349602fcb 2014-04-01 12:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filebuf.c
    ! unlock HVM stack before locking local mutex and calling hb_fs*()
      functions which also unlocks HVM. It fixes possible deadlock condition
      when hb_gcAll( .T. ) is executed.

  * include/hbapi.h
  * src/vm/garbage.c
    ! changed mark function semantic.
      Adding support for user defined mark function I created race condition
      in MT GC code. It happens because blocks marked as deleted were not
      scanned by GC mark code so their subitems where not accessible.
      To fix it we have to change mark function semantic. Now mark function
      can be executed also for blocks currently deleted. It means that GC
      block destructor should clean references to just removed items and
      subblocks. The best place to make it is clearing pointers to GC blocks
      just after hb_itemRelease() or hb_gcRefFree().
      It is save to clean the reference just before hb_itemRelease() or
      hb_gcRefFree() but only for the single block passed to these functions.
      It is not save to clear reference to more then one block and then
      execute above functions.
    + check reference count after destructor execution for all blocks
      not only arrays - warning it may exploit some wrong C code.
    - removed not longer used hb_gcRefCheck() function.

  * include/hbvm.h
  * src/vm/hvm.c
    + added new internal function hb_vmLockForce()
    ! fixed to mark GC blocks with active threads

  * src/vm/thread.c
  * include/hbthread.h
    % modified sync mutexes used by xBase++ signal class emulation
      to not use item array internally
    * updated mutex destructor to new GC mark semantic
    ! mark GT items if GT is bound with thread item
    ! fixed mutex notify/subscribe code to not change GC items
      when HVM stack is unlocked
    ! use hb_vmLockForce() to eliminate potential deadlock
    + added new C function hb_threadEnterCriticalSectionGC().
      It should be used instead of hb_threadEnterCriticalSection()
      in code which manipulates GC items inside critical section.
      It's slower but eliminates possible deadlock condition.
      Please remember that remember that both functions cannot
      be used for the same mutex. So if it's necessary to use
      hb_threadEnterCriticalSectionGC() in one place then it
      has to be used in all others when the same mutex is locked.

  * src/vm/arrays.c
  * src/vm/codebloc.c
  * src/vm/hashes.c
  * src/rtl/hbgtcore.c
  * contrib/hbcurl/core.c
  * contrib/hbexpat/core.c
    * updated destructors to new GC mark semantic

  * contrib/hbxpp/dllx.c
    ! fixed destructor for pointer item created by DllPrepareCall()
      Now it respects reference counter.
    ; added note about real behavior of library handle destructor,
      I haven't changed existing code behavior but maybe it should
      be done.

  * contrib/xhb/hbserv.c
  * src/debug/dbgentry.c
  * src/rdd/wacore.c
    ! fixed possible deadlocks by using hb_threadEnterCriticalSectionGC()
      instead of hb_threadEnterCriticalSection().

  * contrib/hbmemio/memio.c
    ! slightly modified hb_memfsDirectory() code to avoid race condition
      without using hb_threadEnterCriticalSectionGC()

  * src/vm/fm.c
    % reduce the lock range in HB_FM_STAT builds

  * src/rtl/hbsocket.c
    ! added missing HVM stack unlocking in hb_socketSelect() function

  * src/rtl/gtxwc/gtxwc.c
    ! added few missing locks for version compiled with HB_XWC_XLIB_NEEDLOCKS

  * src/rdd/dbtotal.prg
    * allow to use symbols instead of codeblocks
    * modified Harbour extension which uses ordKey() as default group
      signature to work also without index. In such case all records
      are summarized into single one.

  ; Most of above modifications were critical for stability of MT programs.
    They should allow to activate GC in any place.
2014-04-01 12:33:17 +02:00
Przemysław Czerpak
5f6c317492 2014-03-05 11:59 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgentry.c
    ! added additional protection against recursive debugger activation.
      It should fix problem reported by Rafa.

  * src/rtl/fssize.c
    * use explicit open attributes.

  * src/rtl/copyfile.c
    ! reset error object between different RTE calls in __copyFile()
    ! copy file attributes only on *nix platforms.
      In Cl*pper __copyFile() does not copy attributes so maybe also
      in *nixes we should make the same.

  * contrib/xhb/xhbcopyf.c
    * changed hb_fs*() API to hb_file*() API.
2014-03-05 11:59:16 +01:00
Przemysław Czerpak
b04066c388 2014-03-04 18:15 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/debugger.prg
    * minor cleanup

  * src/rtl/copyfile.c
    ! fixed RTE after recent modification (#55)
2014-03-04 18:15:39 +01:00
Przemysław Czerpak
96ca3fe470 2014-01-21 20:41 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* Makefile
  * config/*
  * contrib/*
  * doc/*
  * extras/*
  * include/*
  * lib/*
  * package/*
  * src/*
  * tests/*
  * utils/*
    * removed empty lines left after removed '$' + 'Id' + '$' identifiers
2014-01-21 20:41:05 +01:00
Przemysław Czerpak
a767a89aa0 2014-01-21 20:35 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbct/ctnet.c
    ! fixed copy and past typo in previous commit

  * src/rdd/hbsix/sxcompat.prg
    ! fixed sx_Compress() and sx_Decompress() used with arrays

  ; modifications below comes from Viktor fork:

  * include/dbinfo.ch
  * src/rdd/workarea.c
    + added support for new dbInfo() action: DBI_CODEPAGE
      It returns Harbour CP used by current work area.

  * src/common/expropt2.c
    * change instruction order to protect against NULL references
      if we ever add support for dummy lists

  * src/common/hbver.c
    ! CLANG detection

  * src/lang/l_fr.c
  * src/lang/l_hu.c
    * updated translations

  * src/rtl/cdpapihb.c
  * include/harbour.hbx
    + added function hb_cdpExists( <cCDP> ) -> <lExists>
      it returns .T. if the passed codepage is supported
      and linked, .F. otherwise

  * src/rtl/hbrand.c
  * include/harbour.hbx
    + added hb_randStr( <nLen> ) -> <cBytes> which returns a strong
      random stream of bytes of requested length

  * src/vm/hashfunc.c
  * include/harbour.hbx
    + New hash function to easily check for the existence
      of a key and at the same time retrieving its corresponding
      value:
         hb_HGetRef( <hHash>, <xKey>[, <@xValue> ] ) -> <lFound>
      If the key is not found, <xValue> is also reset to NIL.
      Useful to replace hb_HPos()/hb_HValueAt() call pairs and
      associated temp variable, or to avoid multiple hash lookups
      for the cost of one temp variable.

  * src/rtl/copyfile.c
    % use 64KB buffer

  * src/rtl/tget.prg
    ! Get():Insert()/Get():OverStrike() GET freeze fix reworked
      using better solution by Heinz.

  * src/rtl/tgetlist.prg
  * src/rtl/tmenuitm.prg
  * src/rtl/tmenusys.prg
  * src/rtl/tpopup.prg
    ! fixed to precisely verify against multiple expected class names
      previously a custom class named f.e. 'LIST' was accepted in some
      places for LISTBOX
    ! fixed TOFIX where CP/encoding dependent string was
      used to determine whether a menu item is separator
      throughout the lifetime of the menu.

  * src/common/hbdate.c
  * src/common/hbprintf.c
  * src/common/hbtrace.c
  * src/common/hbver.c
  * src/compiler/compi18n.c
  * src/compiler/genc.c
  * src/compiler/gencc.c
  * src/compiler/hbusage.c
  * src/debug/dbgthsh.prg
  * src/debug/dbgtmenu.prg
  * src/debug/debugger.prg
  * src/debug/tbrwtext.prg
  * src/pp/hbpp.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/dbfuncs.prg
  * src/rdd/dbtotal.prg
  * src/rdd/hbsix/sxcompat.prg
  * src/rdd/hbsix/sxini.prg
  * src/rdd/usrrdd/rdds/arrayrdd.prg
  * src/rdd/usrrdd/rdds/hscdx.prg
  * src/rtl/adir.prg
  * src/rtl/arc4.c
  * src/rtl/cdpdet.prg
  * src/rtl/dbedit.prg
  * src/rtl/dircmd.prg
  * src/rtl/diskspac.c
  * src/rtl/disksphb.c
  * src/rtl/errint.c
  * src/rtl/errintlo.c
  * src/rtl/errsys.prg
  * src/rtl/filesys.c
  * src/rtl/fslink.c
  * src/rtl/gtkbstat.c
  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/hbbffnc.c
  * src/rtl/hbi18n1.c
  * src/rtl/hbi18n2.prg
  * src/rtl/hbini.prg
  * src/rtl/hbjson.c
  * src/rtl/listbox.prg
  * src/rtl/menusys.prg
  * src/rtl/mtran.c
  * src/rtl/radiogrp.prg
  * src/rtl/tgetlist.prg
  * src/rtl/tmenusys.prg
  * src/rtl/tobject.prg
  * src/rtl/tpersist.prg
  * src/rtl/tpopup.prg
  * src/rtl/tpopuphb.prg
  * src/rtl/treport.prg
  * src/rtl/tscalar.prg
  * src/rtl/ttopbar.prg
  * src/rtl/tget.prg
  * src/rtl/tlabel.prg
  * src/rtl/tmenuitm.prg
  * src/rtl/valtoexp.prg
  * src/rtl/valtype.c
  * src/vm/dlmalloc.c
  * src/vm/fm.c
    ! check module handle returned by GetModuleHandle() in MS-Windows
      builds
    ! use %u for unsigned printf formatting
    * casting, formatting, casing and some modifications in names
    * use #if 0 / #endif to mark commented blocks
    * updated year to 2014
    % use FOR EACH, SWITCH, DO CASE statements
    % use :__enumFirst() / :__enumLast()
    % eliminated some local variables and redundant declarations
    % use hb_defaultValue()
    % use $ operator instead of At() and hb_HHasKey()
    % use hb_ADel() instead of ADel()+ASize()
    * replace some functions with procedures
    * pacified some MSC warnings
    * use hb_StrFormat() for user messages
    * use :: instead of Self:
    * use ANSI date delimiters
2014-01-21 20:35:51 +01:00
Przemysław Czerpak
084ab0bbe2 2013-07-08 23:34 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgentry.c
    + added protection against wrong parameters passed to __dbgDelBreak()

  * src/debug/debugger.prg
    + implemented display history for command window.
      This modification also fixes clearing command window when focus is
      changed.
    + added support for new commands:
         DELETE ALL BP
         DELETE BP <nNumber>
         LIST BP
    * replicated Clipper compatible command line shortcuts
    ! send :RefreshAll instead of :RefreshCurrent to source code window
      when break point changed
    ; TODO: add support for window resizing and repositioning. Commands
            like LIST BP are in practice unusable in 3 line command window.

  * src/rtl/console.c
    % minor optimization
2013-07-08 23:34:20 +02:00
Przemysław Czerpak
b2dd9d5923 2013-07-08 17:09 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgtmenu.prg
    ! allow to chose current menu item by its hotkey

  * src/debug/dbgtmitm.prg
    % eliminated dummy hb_DispOutAtBox() for not marked options

  * src/debug/debugger.prg
    ! keep RunAtStartup flag synced with menu
    ! fixed options decoding from init.cld file.
      Thanks to Franček Prijatelj for locating the problem though fix
      should be a little bit different.

  * src/debug/tbrwtext.prg
    ! respect LineNumbers on/off setting

  * src/rtl/console.c
    ! call hb_gtFlush() at the end of hb_DispOutAtBox() - it fixes
      different side effects in code using hb_DispOutAtBox().
2013-07-08 17:09:36 +02:00
Phil Krylov
1d79a39621 2013-07-05 20:02 UTC+0400 Phil Krylov (phil a t newstar.rinet.ru)
* src/debug/debugger.prg
    % Don't save debugger window positions if user did not change them as the
      original debugger behaves.
    + Support arguments to Options Save and Options Restore debugger commands
      as the original debugger does.
2013-07-05 20:02:45 +04:00
Phil Krylov
2f28dd8d03 2013-07-05 19:34 UTC+0400 Phil Krylov (phil a t newstar.rinet.ru)
* src/debug/debugger.prg
    ! Maintain fixed window logical order as the original debugger does.
    ! Load debugger settings in two steps: before and after debugger UI activation.
    ! Save watchpoints to the settings file.
2013-07-05 19:34:53 +04:00
Phil Krylov
e48674f094 2013-07-05 17:50 UTC+0400 Phil Krylov (phil a t newstar.rinet.ru)
* src/debug/debugger.prg
    ! Set debugger activity flag before restoring settings.
2013-07-05 17:50:54 +04:00
Phil Krylov
8184133ea1 2013-07-05 17:05 UTC+0400 Phil Krylov (phil a t newstar.rinet.ru)
* src/debug/debugger.prg
    ! Fixed a typo in my last commit.
    ! Make the debugger show itself before it starts restoring its settings.
2013-07-05 17:15:13 +04:00
Przemysław Czerpak
6153da2b05 2013-07-05 14:12 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgentry.c
    ! added missing casting

  * src/debug/debugger.prg
    + show in call stack references to code compiled without debug info

  * src/rtl/itemseri.c
    * ignore HB_HASH_RESORT flag during hash serialization
2013-07-05 14:12:46 +02:00
Phil Krylov
613ddf38cb 2013-07-05 04:35 UTC+0400 Phil Krylov (phil a t newstar.rinet.ru) 2013-07-05 04:44:55 +04:00
Przemysław Czerpak
79203c5939 2013-07-05 00:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgentry.c
    ! fixed line number setting in debugged coeblocks.
      Tanks to Teo for detail information about the problem.
2013-07-05 00:39:39 +02:00
Przemysław Czerpak
48137e6a61 2013-07-04 18:09 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgtwin.prg
  * src/debug/debugger.prg
    ! use explicitly INKEY mask in INKEY() calls to avoid interactions
      with user code

  * src/debug/debugger.prg
  * src/debug/tbrwtext.prg
    % removed code used for internal breakpoints handling - it was
      redundant and all necessary information can be easy and fast
      accessed directly from dbgentry.c. Current code is smaller,
      faster and we do not have to worry about keeping break point
      information synchronized between C level debugger internals,
      HBDebugger object and HBBrwText object.
    ! changed source code window navigation key to work like in
      Clipper debugger
    ! changed source lines displaying to work like in Clipper debugger -
      with HOME/END scrolling code horizontally it's not such important
      to always see line numbers
    ! redirect few missing K_CTRL_* keys to active window it fixes key
      navigation in some of them
    ! redirect K_ENTER to command window if command is not empty just
      like in Clipper debugger

  * src/rtl/inkeyapi.c
    ! do not convert ASCII 127 to character in hb_inkeyKeyString()
      and HB_KEYCHAR()
2013-07-04 18:09:47 +02:00
Przemysław Czerpak
ebcbbfd518 2013-07-04 05:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgentry.c
    + added new PRG functions:
         __dbgIsBreak( <pDbg>, <cModule>, <nLine> ) -> <nPos>
         __dbgGetBreakPoints( <pDbg> ) -> <aBreakPoints>

  * src/debug/debugger.prg
    - removed old and long time unused PRG function __dbgAltDEntry()

  * src/rtl/hbproces.c
    * changed returned status when execvp() fails, -1 should give
      maximal exit code on given platform (i.e. 255)
2013-07-04 05:33:22 +02:00
Przemysław Czerpak
ab3f6109c1 2013-07-03 12:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapidbg.h
  * src/debug/dbgentry.c
  * src/debug/debugger.prg
    + added new C function hb_dbgGetModuleName() - it returns module name
      used to register module in HVM. In current version it only strips
      path part though in the future it may use some more advanced code
      which allow to debug modules with the same name but different paths
      in single application and such extension will be local to core debug
      code if upper level debugger uses hb_dbgGetModuleName()
    + added new PRG function __DBGGETMODULENAME() - it's wrapper to
      hb_dbgGetModuleName()
    + added new PRG function __DBGMODULEMATCH()
    ! use __DBGMODULEMATCH() instead of hb_FileMatch() and strip_path()
    ! eliminated strip_path() from PRG code and use hb_dbgGetModuleName()
      in C code in places where it's necessary
    ! replaced few strcmp() used to compare module names with
      FILENAME_EQUAL()
    ; above modification may fix few potential problem with breakpoints
      in debugger on some platforms if user uses different paths for
      debugger and compilers.
    ! eliminated hack with memvar/field name copy in watch points,
      it also fixes memory leak when fields are used in watch points.
    % replaced few DO CASE with SWITCH
2013-07-03 12:14:50 +02:00
vszakats
9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00
vszakats
a4a357a18b 2013-03-15 11:12 UTC+0100 Viktor Szakats (harbour syenar.net)
* /harbour/* -> /*
    * moved whole Harbour source tree one level up to
      avoid single 'harbour' top dir
2013-03-15 11:13:30 +01:00