Commit Graph

152 Commits

Author SHA1 Message Date
pierre
a72434e93a Trial to clarify heap for i8086 issues:
- MSDOS heap in tinyheap.inc modified to use usual
  SysGetMem and similar names.
  - Use HAS_MEMORYMANAGER (used previously in wince source code,
  to specify that a memory manager is defined elsewhere than inside
  heap.inc include file.
  - Use
  - Remove TinyHeapMemoryManager Structure variable completely

  heaptrc.pp: remove unneeded macro code after name changes of tinyheap.inc

  msdos/system.pp now only defines HAS_MEMORYMANAGER macro
  win16/system.pp defines HAS_MEMORYMANAGER and FPC_NO_DEFAULT_HEAP
  as it still uses a different memory manager.
  __stkbottom variable added for win16 system.pp as it is required
  by i8086 specific stack check code.

git-svn-id: trunk@33983 -
2016-06-13 22:26:03 +00:00
pierre
fe6feb741b Use macros for msdos OS to translate SysGetMem into SysTinyGetMem and similar, fixes several RTE 203 isssues for msdos target OS
git-svn-id: trunk@33682 -
2016-05-11 14:38:46 +00:00
svenbarth
6afda909d4 Rework TlsKey handling on Windows so that it works as intended with indirect main information
rtl/inc/system.inc:
  * SetupEntryInformation: call new, optional function OSSetupEntryInformation to handle platform specific entry information initialization
rtl/win/sysosh.inc, TEntryInformationOS:
  + new field TlsKeyAddr which will hold the address to the main binary's TlsKey variable
win32/sysinit.inc:
  + provide the variable holding the TlsKey and pass that on to the entry information record
win32/system.pp:
  + new OS specific entry information initialization (currently only the TlsKey)
win/systhrd.inc:
  * declare TlsKey as a pointer to a DWord value instead of a DWord; on non-indirect entry platforms this is initialized with the address of new variable TlsKeyVar, on indirect entry platforms it will be initialized by the entry information initialization
  * adjust usages of TlsKey from DWord to PDWord
win/systlsdir.inc:
  * TlsKey is now a PDWord and (in sysinit) points to TlsKeyVar
win/syswin.inc:
  * adjust TlsKey usage
inc/heaptrc.pp:
  * TlsKey is now a PDWord, thus adjust the import and the usage

git-svn-id: trunk@33091 -
2016-02-12 17:03:52 +00:00
pierre
fd612990e5 Fix number of frames requested when calling CaptureBackTrace function
git-svn-id: trunk@33038 -
2016-01-31 22:08:15 +00:00
nickysn
4454332d7a * fixed the sysutils.GetEnvironment* functions for i8086-msdos
- removed the envp variable from the msdos system unit, because it's not
  compatible with ppchar in all memory models (we use ppfarchar to avoid copying
  the environment in the program's data segment in near data memory models)

git-svn-id: trunk@32017 -
2015-10-11 13:23:59 +00:00
nickysn
3faf91a270 * replaced nested ifdefs with an elseif sequence
git-svn-id: trunk@31957 -
2015-10-05 22:08:53 +00:00
yury
e1a0b1204a * Removed unused vars in RTL.
git-svn-id: trunk@31750 -
2015-09-17 16:48:53 +00:00
michael
1fd2735198 * Fix for 28578
git-svn-id: trunk@31434 -
2015-08-28 08:06:36 +00:00
sergei
7666cd5c0e + Overloaded procedure dump_stack that calls CaptureBacktrace, thus encapsulating internals of stack traversing.
* Use this new procedure in heaptrc unit.

git-svn-id: trunk@29713 -
2015-02-15 20:00:24 +00:00
sergei
baa18dfcb4 * Introduced a new function CaptureBacktrace, using it to handle most of back-tracing in heaptrc unit.
* Use StackTop instead of StackBottom+StackLength in a few remaining locations.

git-svn-id: trunk@27141 -
2014-03-15 05:16:37 +00:00
sergei
5ddb267d57 * Clean up/refactor stack back-tracing code, reducing overall amount of checks and rejecting range from StackBottom to <current frame>.
git-svn-id: trunk@27097 -
2014-03-11 16:29:20 +00:00
sergei
3b5552ae75 - Killed 'goto'.
git-svn-id: trunk@27096 -
2014-03-11 15:16:00 +00:00
nickysn
c1b0fb81f1 * updated all the RTL helper functions related to exceptions and stack traces to use codepointer instead of pointer
git-svn-id: trunk@25513 -
2013-09-17 21:25:26 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
florian
ddc054be79 * patch by Cyrax for easy redirection of heaptrc output, resolves #22168
git-svn-id: trunk@22922 -
2012-11-04 14:07:57 +00:00
pierre
f340ef87e3 * get_addr function renamed to get_pc_addr
+ get_caller_stackinfo procedure added.

git-svn-id: trunk@21707 -
2012-06-25 22:17:49 +00:00
pierre
00ca9b4ce5 + Support multithreaded windows executables inCheckPointer function
git-svn-id: trunk@20181 -
2012-01-26 13:52:51 +00:00
florian
0cc53cc5df + patch from Benito van der Zander to enable heaptrc to dump leaked or faulty memory blocks (function disabled by default), resolves #19691
git-svn-id: trunk@18231 -
2011-08-16 20:47:15 +00:00
sergei
d11d08af73 * heaptrc.pp: In case of early multithreading initialization, initialize all related items (namely, main_relo_todolist), not just the critical section. main_relo_todolist is used later without assigned checks, and it is also used as a flag to destroy the critical section.
git-svn-id: trunk@17937 -
2011-07-05 08:49:24 +00:00
pierre
04d85d32d9 * Disable inline for FPC_HEAPTRC_EXTRA to facilitate cdebugging with GDB
git-svn-id: trunk@17890 -
2011-07-01 07:50:51 +00:00
florian
e6648da567 * make heaptrc aware of the fact that multi threading could be initialized before heaptrc itself is initialized, this is currently the case for windows dlls
git-svn-id: trunk@14560 -
2010-01-07 13:41:43 +00:00
Jonas Maebe
0eec337a00 - removed SUPPORT_UNALIGNED, FPC_SUPPORTS_UNALIGNED and FPC_UNALIGNED_FIXED
defines and ifdefs (already all defined by 2.2.4)

git-svn-id: trunk@13581 -
2009-08-23 07:51:26 +00:00
Jonas Maebe
9ed40aa926 - reverted r13079, it gives wrong results when using heaptrc with an
program that does nothing. It was also not logical, because the expected
    free heap at the end is the total heap size minus any allocated blocks
    and minus the memory that was allocated before heaptrc was activated
    (as the old code calculated, and as it does again now -- mantis #13678)

git-svn-id: trunk@13124 -
2009-05-10 09:28:47 +00:00
micha
c9bea201ce * heaptrace: fix calculation of expected free heap
git-svn-id: trunk@13080 -
2009-05-02 13:48:23 +00:00
Jonas Maebe
f9a17c47bd * write output to screen if log file(s) cannot be opened (mantis #12532)
git-svn-id: trunk@13032 -
2009-04-24 13:28:06 +00:00
giulio
50cd527d30 Checkpointer: consider bss section too for go32v2 (webtbs/tw3661 now works)
git-svn-id: trunk@10967 -
2008-05-14 13:08:11 +00:00
yury
6a36ac786a * Fixed warnings.
git-svn-id: trunk@9095 -
2007-11-03 10:36:27 +00:00
yury
05f718fbd2 * Fixed warnings and notes.
git-svn-id: trunk@9044 -
2007-11-01 15:45:33 +00:00
florian
7cea844223 * more crash fixes
git-svn-id: trunk@9042 -
2007-11-01 14:52:22 +00:00
florian
9472497e5b * finally fixed heaptrc for win64
git-svn-id: trunk@9032 -
2007-11-01 11:42:39 +00:00
florian
7f4c387841 o new BeOS patch by Olivier Coursiere:
* correctly define the stack size for BeOS,
  + implement a minimum nl_langinfo function to correctly initialize WideString support
  + add fgl unit in the BeOS RTL makefile
  * SysOSAlloc now return nil when the system can not allocate the asked memory,
  * HAS_SYSOSFREE is no more defined with an empty implementation under BeOS. This was preventing FPC to reuse memory.
  + there is now a basic implementation of CheckPointer under BeOS.

git-svn-id: trunk@8994 -
2007-10-29 19:00:32 +00:00
florian
a221785d0b * try to read caller address only when we got a proper base pointer
git-svn-id: trunk@8960 -
2007-10-27 20:23:17 +00:00
daniel
0c3a2a257d * Convert heap to ptruint.
git-svn-id: trunk@7950 -
2007-07-04 19:46:47 +00:00
micha
b4363e046b * fix heaptrace segfault, access of lost block
git-svn-id: trunk@7806 -
2007-06-24 21:33:29 +00:00
micha
a70f5bb51e * fix lock release in heap trace
git-svn-id: trunk@7782 -
2007-06-23 09:35:47 +00:00
micha
c0fa8fd255 * heap manager: fix thread exit race condition by using single global lock
fix finishing to be freed list in orphaned list context
  fix heaptrace finalization

git-svn-id: trunk@7752 -
2007-06-20 21:10:35 +00:00
micha
3b7792ead1 * heaptrace: cleanup orphaned lock only in case of threading used
also improve readability of zeroing LSB

git-svn-id: trunk@7726 -
2007-06-18 21:05:32 +00:00
Jonas Maebe
0a10f521f6 * added {$inline on} directive to fix compilation with 2.0.4
git-svn-id: trunk@7658 -
2007-06-14 07:25:47 +00:00
micha
c226f6fd44 * heap manager: handle freeing of block owned by exited thread
* heap trace: ditto

git-svn-id: trunk@7649 -
2007-06-13 20:27:42 +00:00
Jonas Maebe
79e84ba129 * fixed add_tail functionality for cpus which require natural
alignment

git-svn-id: trunk@7471 -
2007-05-25 12:02:08 +00:00
micha
e989730f34 * initialize/finalize critical sections in heaptrace properly
git-svn-id: trunk@7419 -
2007-05-22 15:34:46 +00:00
micha
7f2a257102 + heap manager now per thread, reduce heap lock contention
+ heap threading test

git-svn-id: trunk@7407 -
2007-05-20 20:58:12 +00:00
pierre
9137533864 Patch from Vincent Snijders, sent to fpc-devel
add the same sanity check for the frame pointer
  in TraceReAllocMem as already is in TraceGetMem.

git-svn-id: trunk@7086 -
2007-04-10 22:14:47 +00:00
pierre
4f3f5d042b * return nil in TraceGetMem if SysGetMem returns nil
git-svn-id: trunk@6811 -
2007-03-12 20:59:36 +00:00
florian
8ed35dd5fb * do a stack trace in case of abording with an heap error when EXTRA is defined
git-svn-id: trunk@6358 -
2007-02-07 19:35:54 +00:00
florian
2fb33c4664 * better export of EXTRA define of heaptrc unit
git-svn-id: trunk@6317 -
2007-02-03 11:14:18 +00:00
Jonas Maebe
01749b93f3 * disabled checkpointer for Darwin since it doesn't work
git-svn-id: trunk@6079 -
2007-01-19 21:40:58 +00:00
pierre
1eefed6cfe + HaltOnNotReleased boolean added:defaults to false.
if set to true, and all memory is not freed,
   a RTE 203 is generated.
   Can only be set via HEAPTRC environment variable.

git-svn-id: trunk@5806 -
2007-01-04 10:48:22 +00:00
Károly Balogh
8311d34b3f + added some morphos support to checkpointer
git-svn-id: trunk@4122 -
2006-07-08 08:25:19 +00:00
florian
481f73e989 * don't check pointers in the heap trace unit fixes #7050
git-svn-id: trunk@3873 -
2006-06-16 17:50:41 +00:00