Commit Graph

180 Commits

Author SHA1 Message Date
Pierre Muller
cb6fe28898 Add support for DISABLE_SYSTEMINLINE inside heaptrc unit 2024-05-02 07:56:33 +00:00
Karoly Balogh
be4e5f240c m68k-sinclairql: make heaptrc compile for the QL 2024-01-08 02:22:15 +01:00
Michael VAN CANNEYT
d2d3fe6bc3 * Char -> AnsiChar 2023-07-14 17:26:10 +02:00
marcoonthegit
5418ccf31e * fix bootstrapping *BSD with 3.2.2, which isn't flagged as supporting weakexternal on those targets 2022-06-18 14:52:24 +02:00
marcoonthegit
46de243fe6 * fix bootstrap with 3.2.2, whi 2022-06-18 14:50:13 +02:00
Sven/Sarah Barth
ae346a87a1 * ensure that the heaptrc unit can be used on Linux and BSD without linking against the C library 2022-06-15 22:55:13 +02:00
pierre
86c036d9ed Explicitly disable range and overflow checking to avoid troubles with pointer arithmetics
git-svn-id: trunk@49198 -
2021-04-13 20:57:18 +00:00
pierre
d52aaf63eb msxdos target uses same __fpc_envp symbol as msdos
git-svn-id: trunk@46935 -
2020-09-24 09:48:49 +00:00
florian
8b24033e93 * last fix was most likely not complete
git-svn-id: trunk@43712 -
2019-12-22 23:39:44 +00:00
florian
0dabe49601 * fix building on non-unix/windows targets
git-svn-id: trunk@43711 -
2019-12-22 23:34:22 +00:00
florian
99680eb88c * patch by Anton Kavalenka: heaptrc: Improve tracing by printing actual
module name (ether EXE or DLL), resolves #36130

git-svn-id: trunk@43710 -
2019-12-22 22:51:53 +00:00
pierre
ee22dbe589 Handle change of memory base address after call to SysTryResizeMem
git-svn-id: trunk@43062 -
2019-09-24 12:44:01 +00:00
svenbarth
f88a98e976 * heaptrc should not rely on the original SysAllocMem calling the heaptrace memory manager's functions
git-svn-id: trunk@42796 -
2019-08-24 10:37:16 +00:00
pierre
8015bfb5a0 Fix arm specific failure in tw12048
git-svn-id: trunk@42657 -
2019-08-12 12:17:00 +00:00
pierre
7b3e027dc8 Move update of fields counting allocated memory to after SysGetMem call
git-svn-id: trunk@41882 -
2019-04-16 15:05:13 +00:00
Károly Balogh
56f0a71466 heaptrc: empty the array for the call trace, otherwise the trace dump code will just dump the rest of the array as well, on systems where the heap is not initialized to zero, or if the memory area has been re-used
git-svn-id: trunk@40856 -
2019-01-13 16:23:18 +00:00
pierre
70fae803ce Increase default trace size to 16
git-svn-id: trunk@39734 -
2018-09-11 13:08:51 +00:00
pierre
18cc1f1709 Try to implement CheckPointer exclusion range for FreeBSD OS
git-svn-id: trunk@39394 -
2018-07-06 09:08:54 +00:00
florian
4029783abb * forgotten space added
git-svn-id: trunk@37684 -
2017-12-05 21:06:13 +00:00
florian
c08bdf3f85 * patch by Anton Kavalenka: heaptrc prints exe/dll binary name where it is linked, resolves #32707
git-svn-id: trunk@37670 -
2017-12-03 18:07:41 +00:00
pierre
6c43882cf5 Allow compilation with -Sfnothreading
git-svn-id: trunk@36092 -
2017-05-04 21:18:22 +00:00
florian
bb8b8f2eae * do not set IsMultithread on windows, if no second thread is started, resolves #30535
git-svn-id: trunk@35567 -
2017-03-11 21:35:48 +00:00
pierre
749dc00401 Fix CheckPointer code for pointer in stack area for linux
git-svn-id: trunk@34551 -
2016-09-21 13:19:27 +00:00
pierre
cb5f540eb9 Fix typo in last commit: to disable TraceManager, call SetMemoryManager with saved PrevMemoryManager variable
git-svn-id: trunk@34399 -
2016-08-30 15:51:56 +00:00
pierre
b6b27f2fb7 + Add tail_size varaible to be able to adjust size of tail memory area.
* Correct computation of CRC for if add_tail is true:
    tail is before extra_info, not after.
    Use tail_size variable to cacluate CRC use the whole tail memory area.
  + New function released_modified. Checks if released memory
    was modified after it release (used if keep_released is true).
  * TraceGetMem,TraceFreeMem TraceReallocMem: adapt to new tail_size variable.
  * TraceInit: Store previous memory manager in local variable,
    to be able to restore it in TracExit call.
  * LoadEnvironment: Add parsing of tail_size=XXX, where XXX is a decimal value,
    rounded up to next multiple of sizeof(ptruint).

git-svn-id: trunk@34385 -
2016-08-28 21:42:07 +00:00
pierre
5884fbc8b0 Move {$checkpointer off} before interface and relax windows data bss check to also accept sections in between like .rdata
git-svn-id: trunk@34262 -
2016-08-10 09:46:37 +00:00
pierre
0cb0bc3371 Use symbols instead of constants in code:
+ AllocateSig and ReleaseSig for theap_mem_info.sig field.
  + CheckSig for theap_extra_info.check field.
  + CRC32Seed and CRC32Pattern in CRC related functions.

  * if sig is equal ReleaseSig, always assume already released (even if usecrc ius true).

git-svn-id: trunk@34260 -
2016-08-10 08:36:38 +00:00
pierre
47f01eaa52 Fix CRC calculation for i8086 compact memory model
git-svn-id: trunk@34070 -
2016-07-05 22:06:18 +00:00
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