Commit Graph

70 Commits

Author SHA1 Message Date
Michael VAN CANNEYT
ccfa38c68e * Dotted RTL compiles 2023-07-27 19:04:03 +02:00
Michael VAN CANNEYT
b5dd1f9beb * Fix windows compilation 2023-07-24 15:38:09 +02:00
Michaël Van Canneyt
8af6fdefa8 * Better length check 2023-07-17 10:04:46 +02:00
Michaël Van Canneyt
0be4498284 * Add length check 2023-07-17 10:02:15 +02:00
Michaël Van Canneyt
33dba31536 * Add overload to fix issue 40931 in lazarus 2023-07-16 19:06:22 +02:00
Michaël Van Canneyt
f36ec0ed7f * Fix non-unix compilation 2023-07-14 17:26:10 +02:00
Michael VAN CANNEYT
2339db3b00 * Fix compilation 2023-07-14 17:26:10 +02:00
Michael VAN CANNEYT
d2d3fe6bc3 * Char -> AnsiChar 2023-07-14 17:26:10 +02:00
florian
396a030fc2 + debugging statement 2021-09-04 19:12:04 +02:00
Jonas Maebe
0eb9dd3879 * Darwin support for printing line info for backtraces when using Dwarf,
based on patches by Colin Western, mantis #38483)
   o requires that the program/library is compiled with -Xg (or that
     dsymutil is run on it after compiling), and that the .dSYM bundle
     is in the same directory as the program/library
   o always use the "dl" unit in exeinfo for Darwin, as that's needed for
     dynamic library support, and this does not cause an extra dependency
     since on Darwin we always use libc
   o cleaned up the exeinfo unit for Darwin, and sped it up by using mmap
     instead of small reads
   o fixed unit dependencies for exeinfo, lineinfo and lnfodwarf in Darwin
     RTL Makefile
  * use the process address info from the original exe even when reading
    the debug information from an external file
  - removed outdated ifdef'd darwin code from dl.pp (no longer needed now
    that processaddress gets set correctly in exeinfo for that platform)

git-svn-id: trunk@49140 -
2021-04-08 19:50:34 +00:00
yury
4ade471488 * GetModuleByAddr: Prevent returning a name of the current executable for invalid addresses such as pointer(-1) on Windows.
git-svn-id: trunk@43364 -
2019-11-02 14:54:25 +00:00
Károly Balogh
c85f7cfc26 aros/amigaos4: enabled ELF32/64 and GetModuleAddr() in exeinfo, based on the MorphOS versionexeinfo.pp
git-svn-id: trunk@41088 -
2019-01-28 04:16:44 +00:00
Károly Balogh
b2dafed7c5 haiku: drop the old OpenElf32Beos function, and have a platform specific GetModuleByAddr, this fixes lineinfo on stacktraces (both i386-stabs and x86_64-dwarf2)
git-svn-id: trunk@40845 -
2019-01-11 19:51:13 +00:00
nickysn
a598e17c8a * fix loading of i8086-msdos ELF when the MZ binary in front of it exceeds 64kb
git-svn-id: trunk@39069 -
2018-05-20 20:18:00 +00:00
nickysn
2955ee2dc4 + i8086-msdos implementation of exeinfo.GetModuleByAddr
git-svn-id: trunk@39068 -
2018-05-20 20:03:58 +00:00
nickysn
abe61d0daa * the 'addr' and 'baseaddr' parameters of exeinfo.GetModuleByAddr changed to
far pointers on i8086
* the 'addr' parameter of lnfodwrf.OpenDwarf changed to codepointer

git-svn-id: trunk@39055 -
2018-05-20 14:33:17 +00:00
nickysn
443980b7ac * moved the morphos code for exeinfo.GetModuleByAddr to a separate ifdef section
git-svn-id: trunk@39054 -
2018-05-20 14:09:57 +00:00
nickysn
2c000d1e74 * processaddress's type changed to word on i8086 (ptruint changes size between
memory models and we only need the offset; the segment is tracked separately)
+ introduce texefile.processsegment on i8086
* initialize processaddress and processsegment properly on i8086-msdos (for .exe
  files; .com files are not supported yet)

git-svn-id: trunk@39052 -
2018-05-20 13:19:49 +00:00
nickysn
c8cbb1daea * changed the sechdrofs,secstrofs and ImgOffset types to 32-bit to prevent
overflow errors on i8086 (ptruint is 16-bit in certain i8086 memory models;
  file offsets, however, still remain 32-bit)

git-svn-id: trunk@39036 -
2018-05-20 11:26:40 +00:00
nickysn
0d8ba2ddfa * skip the MZ exe in order to reach the ELF32 image on i8086-msdos
git-svn-id: trunk@39032 -
2018-05-20 10:11:14 +00:00
nickysn
ccf5aaeebb + enable the ELF32 reader in unit exeinfo for i8086-msdos
git-svn-id: trunk@39031 -
2018-05-20 10:01:19 +00:00
nickysn
537fbefb9e * add texeheader.ImgOffset to all file offsets when reading an ELF file. This
will be useful for reading i8086-msdos dwarf debug info, because it is
  appended after the regular dos MZ exe in an ELF32 image by the watcom linker.

git-svn-id: trunk@39030 -
2018-05-20 09:43:08 +00:00
nickysn
3bcd21663e * replaced nested ifdefs in unit exeinfo with a chain of {$if defined(...)} ...
{$elseif defined(...)}

git-svn-id: trunk@39027 -
2018-05-19 21:04:30 +00:00
Károly Balogh
4002833001 morphos: also enable the elf32 loader in exeinfo for morphos
git-svn-id: trunk@36805 -
2017-07-28 12:20:40 +00:00
Károly Balogh
ac19b0eae6 morphos: enabling lineinfo unit
git-svn-id: trunk@36804 -
2017-07-27 22:31:19 +00:00
svenbarth
00e9289f58 * envp is part of sysunixh, so no need to manually import it using an external
git-svn-id: trunk@36685 -
2017-07-08 19:15:54 +00:00
michael
011a88b1fe * Remove mode objfpc (bug ID 31629)
git-svn-id: trunk@35886 -
2017-04-22 08:53:13 +00:00
pierre
dcd349abd9 Use DEBUG_LINEINFO instead of DEBUG in exeinfo unit source
git-svn-id: trunk@34521 -
2016-09-13 08:37:52 +00:00
pierre
1612138071 Use $checkpointer off to avoid calls to CheckPointer function if -gc option is used
git-svn-id: trunk@34384 -
2016-08-28 15:59:36 +00:00
pierre
57f2df1f62 * Remove sysutils in _USES clause, to avoid exception handling importation,
especially when exeinfo unit is implicitly loaded when -gl compilation option
  is used.
  + LocalError, new ExitProc procedure, used to catch any error that could happen
  inside GetExeInMemoryBaseAddr procedure.
  * Use SetJmp/LongJmp instead of Try/except in GetExeInMemoryBaseAddr function,
  together with local change and restoration of ExitProc.

git-svn-id: trunk@33561 -
2016-04-27 13:13:31 +00:00
pierre
3de617c79e Fix phdr pointer increment and use envp variable from system unit for Solaris operating system
git-svn-id: trunk@33008 -
2016-01-27 10:47:16 +00:00
pierre
90359bcb3c Add code to find base address in unix ELF aux vector above enviroment in startup stack
git-svn-id: trunk@33007 -
2016-01-26 14:44:31 +00:00
yury
7688639a10 * Return a real base address for ELF executables by GetModuleByAddr() instead of hard-coded 0.
* Obtain a real processaddress for ELF images by OpenExeFile() instead of hard-coded 0.
* It fixes line info information for Position Independent Executables (PIE).

git-svn-id: trunk@32052 -
2015-10-13 20:08:03 +00:00
florian
d0f4e7cc99 * respect feature defines
git-svn-id: trunk@30378 -
2015-03-29 19:43:25 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
Jonas Maebe
e6c812a60a * assume unicode in case of FPC_OS_UNICODE instead of only for WinCE
git-svn-id: branches/cpstrrtl@24959 -
2013-06-24 09:39:57 +00:00
yury
d26f0552a0 * Sync with trunk r23404.
* Regenerated makefiles.

git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
yury
1e78337015 * Oops, wrong commit r23235. Reverted. Now correct: Fixed lineinfo for Android.
git-svn-id: branches/targetandroid@23236 -
2012-12-28 10:42:27 +00:00
sergei
47cd83ae14 * Fetch PECOFF section sizes correctly (not including zero padding), resolves #22788.
git-svn-id: trunk@22879 -
2012-10-30 09:00:13 +00:00
pierre
afaea929a1 * Also enable ELF32 or ELF64 for OpenBSD OS
git-svn-id: trunk@21004 -
2012-04-23 10:10:10 +00:00
Tomas Hajny
5d82eaa628 * fix buggy stabs offset calculation
git-svn-id: trunk@20144 -
2012-01-21 20:43:03 +00:00
pierre
ceffd8b8cc * Fix lineinfo problems for BeOS/Haiku
git-svn-id: trunk@19760 -
2011-12-05 16:29:43 +00:00
armin
fc45960024 updated for netware target
git-svn-id: trunk@17193 -
2011-03-27 15:11:43 +00:00
Jonas Maebe
fdfb21387f * fixed potential buffer overflow errors (reported by Stian Skjelstad,
mantis #17922)

git-svn-id: trunk@16343 -
2010-11-14 11:59:24 +00:00
Jonas Maebe
79fbca8c63 * don't crash when reading a Macho-O binary with an unanticipated
structure (patch by Colin Western, mantis #17424)

git-svn-id: trunk@15995 -
2010-09-16 13:55:30 +00:00
yury
628b0c23ac * exeinfo: Return executable image base and current module base address on Windows.
* exeinfo: Properly handle long COFF section names. Bug #13499.
* lineinfo, lnfodwrf: Properly use executable image base and current module base address.

git-svn-id: trunk@13145 -
2009-05-15 22:14:09 +00:00
florian
8a940151a7 o patch by Sergej Gorelkin:
* When OpenExeFile is called with an empty filename argument, 
    it apparently opens stdin and crashes immediately thereafter trying to seek in non-seekable stream. 
    The filename is empty whenever GetLineInfo is called with the address that does not belong to valid module.

git-svn-id: trunk@12802 -
2009-02-26 18:34:48 +00:00
florian
67fbadcdcf * WinCE compilation fixed
git-svn-id: trunk@11057 -
2008-05-23 15:35:18 +00:00
florian
873409cd3c * baseaddr must be nil on windows
git-svn-id: trunk@11030 -
2008-05-21 20:45:20 +00:00
florian
d955c9b4f7 + proper handling of lineinfo retrival for dyn. libs in unix
git-svn-id: trunk@11010 -
2008-05-18 18:42:09 +00:00