Commit Graph

55 Commits

Author SHA1 Message Date
Michael VAN CANNEYT
ccfa38c68e * Dotted RTL compiles 2023-07-27 19:04:03 +02:00
Michael VAN CANNEYT
6084bb6d09 * Some forgotten string -> shortstring instances 2023-07-14 20:13:43 +02:00
Michael VAN CANNEYT
d2d3fe6bc3 * Char -> AnsiChar 2023-07-14 17:26:10 +02:00
Jonas Maebe
f13b47289e * handle case where the first instruction with line information is looked up
o this should be handled better. The common way is looking up address - 1,
     but that doesn't seem to work here.

git-svn-id: trunk@49142 -
2021-04-08 19:50:40 +00: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
florian
45b3d8e0bf * check for cache entry before even trying to open the file containing the debug info
git-svn-id: trunk@49086 -
2021-03-30 14:06:19 +00:00
florian
4dfcdeaef8 + use a hash table to speed up line info retrieval
git-svn-id: trunk@49080 -
2021-03-29 12:20:39 +00:00
nickysn
b18602485a * fixed base segment calculation on i8086 (code moved after call to OpenDwarf,
because it needs to have e.processsegment initialized)

git-svn-id: trunk@39114 -
2018-05-25 00:52:14 +00:00
nickysn
45bcbca71b * fixed reading of DW_FORM_ref_addr on i8086
git-svn-id: trunk@39113 -
2018-05-25 00:21:53 +00:00
nickysn
2a5fbd4598 * continue reading the segment when walking the dwarf arange tuples on i8086
git-svn-id: trunk@39076 -
2018-05-20 22:51:52 +00:00
nickysn
d1cdd8be7c * do not emit padding bytes after the dwarf arange header on i8086 for
compatibility with Open Watcom (also, the dwarf spec is not very clear about
  the alignment requirements on segmented architectures, so that's why we do
  this by default, instead of putting it behind a -go debug switch)

git-svn-id: trunk@39075 -
2018-05-20 22:50:46 +00:00
nickysn
6fedf7e930 + debug dump the address size from the header in ParseCompilationUnitForFunctionName
git-svn-id: trunk@39070 -
2018-05-20 20:41:13 +00:00
nickysn
1d3ad2b078 + also take the segment portion of the address in lnfodwrf.ParseCompilationUnit
git-svn-id: trunk@39067 -
2018-05-20 17:20:29 +00:00
nickysn
4ce5db5188 + also check the arange segment in ParseCompilationUnitForDebugInfoOffset
git-svn-id: trunk@39066 -
2018-05-20 17:00:56 +00:00
nickysn
81d5483ab1 * subtract the process load segment from the code segment on i8086
git-svn-id: trunk@39064 -
2018-05-20 16:55:18 +00:00
nickysn
875330d84f + pass a segment (0 on non-i8086) to all ParseCompilationUnit* functions in unit
lnfodwrf

git-svn-id: trunk@39063 -
2018-05-20 16:51:49 +00:00
nickysn
d7a3f755e4 + also read arange segments on i8086
git-svn-id: trunk@39062 -
2018-05-20 16:07:28 +00:00
nickysn
3989e57fed * take into account the address size in lnfodwrf.ReadAddress on i8086; support
2-byte and 4-byte addresses

git-svn-id: trunk@39060 -
2018-05-20 15:48:58 +00:00
nickysn
a7f5a69000 + added an address size parameter to lnfodrwf.ReadAddress(); pass the expected
address size, as taken from the dwarf header structure

git-svn-id: trunk@39059 -
2018-05-20 15:43:19 +00:00
nickysn
dc8b78abe6 + debug print the arange address and segment sizes
git-svn-id: trunk@39058 -
2018-05-20 14:58:09 +00:00
nickysn
1f76f52996 * use hexstr(addr) in the dwarf backtrace function, so it displays always a good
value, according to the x86 pointer type

git-svn-id: trunk@39057 -
2018-05-20 14:42:17 +00:00
nickysn
96b53c168c * use hexstr(baseaddr) to print out the pointer value, regardless of its x86 type (near/far, etc.)
git-svn-id: trunk@39056 -
2018-05-20 14:39:28 +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
0ceb1244bf * changed the type of the first parameter ('addr') of lnfodwrf.GetLineInfo to
CodePtrUInt instead of PtrUInt

git-svn-id: trunk@39053 -
2018-05-20 13:41:10 +00:00
nickysn
2411cb3f24 * fix save/restore of base/index/pos on i8086
git-svn-id: trunk@39050 -
2018-05-20 12:55:22 +00:00
nickysn
0ca05f042b + parse the openwatcom dwarf extension DW_LNE_SET_SEGMENT and also track segment
data in the dwarf state machine on i8086

git-svn-id: trunk@39049 -
2018-05-20 12:43:53 +00:00
nickysn
60d49d696a * fix for ReadLEB128 on 16-bit CPUs
git-svn-id: trunk@39047 -
2018-05-20 12:06:36 +00:00
nickysn
994783db95 + introduce the TFilePos type for storing file offsets; use longint instead of
sizeint on i8086, because sizeint is 16-bit and file offsets are 32-bit there

git-svn-id: trunk@39046 -
2018-05-20 11:55:47 +00:00
nickysn
8364b1f4ca * changed the result of function Pos() to SizeInt (same type as the 'index'
variable it returns). Fixes the register allocation failure error when
  compiling on i8086.

git-svn-id: trunk@39033 -
2018-05-20 10:40:00 +00:00
maciej-izak
322720236c + added missing dwarf constants: DW_FORM_sec_offset, DW_FORM_exprloc and DW_FORM_flag_present
git-svn-id: trunk@35717 -
2017-04-03 10:42:27 +00:00
florian
71b7cd7e1d * the size of DW_FORM_ref_addr entries depends on the DWARF version
git-svn-id: trunk@33477 -
2016-04-10 19:46:05 +00:00
florian
a7346b2f9d + make use of .debug_aranges section for faster name search when generating stack backtraces
git-svn-id: trunk@33470 -
2016-04-10 12:21:35 +00:00
florian
feb15f08b3 * abbrev section must be re-read for each chunk of debug info, should resolve #29825
git-svn-id: trunk@33233 -
2016-03-13 14:41:56 +00:00
florian
928027a7a4 * read Dwarf data blocks correctly
git-svn-id: trunk@33232 -
2016-03-13 12:52:25 +00:00
florian
8a2917639b * improved comments
* tried to make code more robust

git-svn-id: trunk@33231 -
2016-03-13 12:28:26 +00:00
florian
5109ad9c55 + write also the function name in stack backtraces when dwarf debugging info is used, resolves #17574
git-svn-id: trunk@33228 -
2016-03-12 22:35:29 +00:00
michael
9225ff3293 * Fix for bug ID #28283 by Denis Kozlov
git-svn-id: trunk@32919 -
2016-01-10 20:14:28 +00:00
nickysn
75ec4adcf9 * fixed compilation of lnfodwrf in the i8086 medium and compact memory models
git-svn-id: trunk@30638 -
2015-04-18 01:56:29 +00:00
florian
f7785be945 * make the dwarf line info reader more fault tolerant, patch by Martin Friebe, resolves #24900
git-svn-id: trunk@26812 -
2014-02-18 20:36:25 +00:00
sergei
35a2ed9a6c - Removed unused variable
- Removed inline directive (formal arguments are unsupported and only cause compiler noise)

git-svn-id: trunk@17988 -
2011-07-13 22:14:39 +00:00
pierre
8bcad0c07f avoid range check error in ParseCompilationUnit
git-svn-id: trunk@15478 -
2010-06-25 22:21:38 +00:00
michael
3e9b6151ee * Added warning about thread-safety
git-svn-id: trunk@14169 -
2009-11-14 10:29:45 +00:00
michael
740bd6744b * Patch from Martin Friebe to buffer reading dwarf info
git-svn-id: trunk@14168 -
2009-11-14 10:12:53 +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
29ba36e70b * when the end of a sequence is reached, first_row has to be set for proper address checking, resolves #10856
git-svn-id: trunk@11063 -
2008-05-23 21:12:03 +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
florian
96f8576bf2 * handle lineinfo in dlls correctly, resolves #4171 and #10797 for windows
git-svn-id: trunk@11004 -
2008-05-18 16:46:17 +00:00
peter
cc710dc05f * remove objpas dependency, patch by Giulio
git-svn-id: trunk@10154 -
2008-02-02 16:16:21 +00:00
peter
482ad1334b * support .gnu_debuglink section to have the debug info in an
external file

git-svn-id: trunk@9813 -
2008-01-20 13:13:55 +00:00
peter
a504c974ab * use exeinfo unit to find .debug_line section
git-svn-id: trunk@9801 -
2008-01-19 22:09:58 +00:00