Commit Graph

102 Commits

Author SHA1 Message Date
florian
f1f0cb033a * move ReplaceForbiddenChars to cpubase of avr so it can be used in dbgstabs as well
* tried to fix dbgstabs so that it doesn't emit illegal chars using ReplaceForbiddenChars, however, dbgstabs accesses symbol names quite often, so this failed

git-svn-id: trunk@18972 -
2011-09-04 19:36:43 +00:00
florian
8bc94610c7 + tai_stab.create_ansistr
* write vmt info using create_ansistr, resolves #20003
* replaced move/getmem sequences in dbgstabs.pas by create_ansistr

git-svn-id: trunk@18230 -
2011-08-16 20:27:54 +00:00
florian
d35d1ed357 + initial support for pascal booleans with sizes 2, 4 and 8
git-svn-id: branches/pasboolxx@17836 -
2011-06-26 15:02:37 +00:00
svenbarth
35b47e491c Rebase to revision 17306
git-svn-id: branches/svenbarth/classhelpers@17314 -
2011-04-13 10:04:14 +00:00
florian
4d19f6c532 * patch by Jeppe Johansen to be able to generate debug info if an rtl without variant support is used, resolves #18483
git-svn-id: trunk@17300 -
2011-04-10 21:11:03 +00:00
svenbarth
96116a6c3a Several adjustments because virtual methods in helpers are just normal methods and a VMT isn't generated for them either.
* $CPU/cgcpu.pas: disable the generation of VMT loading code
* dbgstabs.pas, dbgdwarf.pas: treat virtual methods of helpers as normal methods
* ncgcal.pas: don't register virtual helper methods for WPO 
* ncgrtti.pas: write virtual helper methods as normal methods to RTTI
* nobj.pas: correctly handle final and override cases in helpers
* pdecvar.pas: property getters
* rautils.pas: no VMT offset in records

git-svn-id: branches/svenbarth/classhelpers@17150 -
2011-03-20 10:41:45 +00:00
svenbarth
80e6498921 Rebase to revision 17096
git-svn-id: branches/svenbarth/classhelpers@17099 -
2011-03-09 16:29:47 +00:00
florian
26fbfaf5a7 + introduce the usage of asizeint/asizeuint for cpus with sizeof("alu")<>sizeof(pointer)
git-svn-id: trunk@17011 -
2011-02-26 20:10:03 +00:00
paul
915c412ae3 compiler: generate debug info for record methods:
- extended write_symtable_procdefs to handle record definitions
  - fix stabs info generator to use prefixed symbol names for record methods, also handle records static symbols the same way as for object types
  - fix dwarf info record generation: add visibility info and write methods, also prefix record members the same way as object members

git-svn-id: branches/paul/extended_records@16570 -
2010-12-16 06:12:05 +00:00
paul
289c9bd192 compiler: remove unneeded checks and typecasting caused by move of objectoptions into tabstractrecorddef
git-svn-id: branches/paul/extended_records@16542 -
2010-12-11 07:00:46 +00:00
paul
56bf42de57 compiler: implement record methods and class methods:
- rename tprocdef._class to tprocdef.struct and change the type from tobjectdef to tabstractrecorddef because methods can belong not to classes only now but to records too
  - replace in many places use of current_objectdef to current_structdef with typcast where is needed
  - add an argument to comp_expr, expr, factor, sub_expr to notify that we are searching type only symbol to solve the problem with records,objects,classes which contains fields with the same name as previosly declared type (like:
  HWND = type Handle;
  rec = record 
    hWnd: HWND;
  end;)
  - disable check in factor_read_id which was made for object that only static fields can be accessed as TObjectType.FieldName outside the object because it makes SizeOf(TObjectType.FieldName) imposible and since the same method was extended to handle records it also breaks a52 package compilation
  - rename tcallcandidates.collect_overloads_in_class to tcallcandidates.collect_overloads_in_struct and addapt the code to handle overloads in records too
  - fix searchsym_type to search also in object ancestors if we found an object symtable
  - add pd_record, pd_notrecord flags to mark procedure modifies which can or can't be used with records. Disallow the next modifiers for records: abstract, dynamic, export, external, far, far16, final, forward, internconst, internproc, interrupt, message, near, override, public, reintroduce, virtual, weakexternal,
Allow the next modifiers for records: static

git-svn-id: branches/paul/extended_records@16526 -
2010-12-09 02:24:46 +00:00
joost
07bf44517c * Merged XPCom branch into trunk, added support for constref and changed
the IInterface implementation to be XPCom-compatible
--- Merging r15997 through r16179 into '.':
U    rtl/inc/variants.pp
U    rtl/inc/objpash.inc
U    rtl/inc/objpas.inc
U    rtl/objpas/classes/persist.inc
U    rtl/objpas/classes/compon.inc
U    rtl/objpas/classes/classesh.inc
A    tests/test/tconstref1.pp
A    tests/test/tconstref2.pp
A    tests/test/tconstref3.pp
U    tests/test/tinterface4.pp
A    tests/test/tconstref4.pp
U    tests/webtbs/tw10897.pp
U    tests/webtbs/tw4086.pp
U    tests/webtbs/tw15363.pp
U    tests/webtbs/tw2177.pp
U    tests/webtbs/tw16592.pp
U    tests/tbs/tb0546.pp
U    compiler/sparc/cpupara.pas
U    compiler/i386/cpupara.pas
U    compiler/pdecsub.pas
U    compiler/symdef.pas
U    compiler/powerpc/cpupara.pas
U    compiler/avr/cpupara.pas
U    compiler/browcol.pas
U    compiler/defcmp.pas
U    compiler/powerpc64/cpupara.pas
U    compiler/ncgrtti.pas
U    compiler/x86_64/cpupara.pas
U    compiler/opttail.pas
U    compiler/htypechk.pas
U    compiler/tokens.pas
U    compiler/objcutil.pas
U    compiler/ncal.pas
U    compiler/symtable.pas
U    compiler/symsym.pas
U    compiler/m68k/cpupara.pas
U    compiler/regvars.pas
U    compiler/arm/cpupara.pas
U    compiler/symconst.pas
U    compiler/mips/cpupara.pas
U    compiler/paramgr.pas
U    compiler/psub.pas
U    compiler/pdecvar.pas
U    compiler/dbgstabs.pas
U    compiler/options.pas
U    packages/fcl-fpcunit/src/testutils.pp

git-svn-id: trunk@16180 -
2010-10-17 20:58:22 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
Jonas Maebe
daef2efa69 - removed tstoreddef.reset() and overrides, and the associated
reset_used_unit_defs()/reset_all_defs() calls:
    o removed resetting tprocdef.procstarttai/procendtai and
      instead check in the debug writers whether the def is
      in the current unit or not to determine whether we should
      write debug info for it
    o use the collected defs in the wpoinfo structure to reset
      the wpo flags in the defs, instead of iterating over all
      defs in the program and resetting them that way
  - removed now unused "is_reset" flag from tmodule

git-svn-id: trunk@15501 -
2010-06-30 19:00:40 +00:00
Jonas Maebe
356026f849 * use new_section() instead of tai_section.create() everywhere
- sort of reverted r14134, which is no longer required after the above
    change (new_section() inserts the alignment itself)
  * made the tai_section.create() constructor private so it cannot be
    called directly anymore

git-svn-id: trunk@15482 -
2010-06-26 10:50:14 +00:00
pierre
11d6509a56 Attempt to fix missing stabs definitions problem
git-svn-id: trunk@15238 -
2010-05-06 22:53:26 +00:00
paul
1b614b526a compiler:
- add own symbol table for enumeration to store enumeration elements
  - reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed
  - implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables
  - implement {$SCOPEDENUM ON/OFF} local switch
  + tests

git-svn-id: trunk@15051 -
2010-03-25 05:46:53 +00:00
Jonas Maebe
025ec34e4d + "CExtended" type that is the same as "extended", but conforming to the
properties/behaviour of the equivalent of Extended in C (i.e., to
    "long double" on i386 and x86_64 platforms that support a 10 byte
    long double, and to "double" elsewhere)

git-svn-id: trunk@14912 -
2010-02-14 13:45:58 +00:00
Jonas Maebe
b4c8c73e70 * changed tf_use_function_relative_addresses into an assembler flag (with
the opposite meaning, af_stabs_use_function_absolute_addresses), because it
    is different on Darwin for the internal and external assembler)

git-svn-id: trunk@14342 -
2009-12-06 13:21:28 +00:00
paul
ae52b19820 compiler: generate STABS debug info for Variant type
git-svn-id: trunk@14326 -
2009-12-04 17:06:17 +00:00
Jonas Maebe
da58a01ce6 * fixed stabs debug information for parameters copied into local variables
(fixes displaying value shortstring parameters on SPARC, as reported on
     fpc-devel mailing list on 20091005 by Mark Morgan Lloyd)

git-svn-id: trunk@13813 -
2009-10-06 13:51:16 +00:00
Jonas Maebe
80864ebf31 * made TDebugInfoDwarf3 inherit from TDebugInfoDwarf2 instead of from
TDebugInfoDwarf, so DWARFv2 and DWARFv3 generators can share protected
    methods.
  * fixed the debug info for sets whose language-level lower bound is not
    equal to the actual set base used when storing the data (e.g., a "set
    of 1..5" is actually stored as a "set of 0..7" or "set of 0..31")
    (mantis #13984)
  + interactive test for the above

git-svn-id: trunk@13302 -
2009-06-20 10:45:04 +00:00
yury
9c9462cd5a * Insert DW_AT_low_pc and DW_AT_high_pc attributes for modules on Windows also. It solves debugging problems on Windows with dwarf debug info.
git-svn-id: trunk@13098 -
2009-05-04 18:36:08 +00:00
yury
99917e034d * Fixed visibility notes of some overrode methods.
git-svn-id: trunk@13095 -
2009-05-04 10:24:47 +00:00
Jonas Maebe
36668a6ec5 * don't emit "include file search paths" for stabs since they don't exist
(and hence those directories were interpreted as source files themselves)
  + added -gostabsabsincludes option to make the compiler store absolute
    paths to include files in Stabs debugging information (since no
    search paths are used). This is not the default because it breaks
    when only the base path of an entire source tree changes (relative
    paths, which are the previous behaviour and the current default,
    work fine, but the absolute paths don't anymore; this can happen
    with shared network drives, and possibly with distros shipping
    external .dbg files)

git-svn-id: trunk@12933 -
2009-03-20 18:35:17 +00:00
Jonas Maebe
e36352bf9e * store path information for source files in stabs debug info
(mantis #13248)

git-svn-id: trunk@12812 -
2009-02-27 20:05:44 +00:00
Jonas Maebe
a3732f5cfc * changed debuginfo for dynamic arrays in stabs and dwarf2 into a pointer to
the array type, rather than an array type (since they are pointers)
  + fully implemented debug info for dynamic arrays using dwarf3 (as supported
    by the gdb "archer" project with the archer-jankratochvil-vla branch)
    (mantis #12789)

git-svn-id: trunk@12436 -
2008-12-24 19:59:44 +00:00
peter
a3a66ba74d * split tvisibility from tsymoptions
* replace current_object_option with symtable.currentvisibility

git-svn-id: trunk@12048 -
2008-11-11 09:05:39 +00:00
Jonas Maebe
bed6a0faa9 * fixed memory leaks
git-svn-id: trunk@11762 -
2008-09-13 12:20:23 +00:00
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
Jonas Maebe
c00108009d * insert vmt as hidden field in objectdefs
* don't output hidden fields in the debug info

git-svn-id: trunk@11334 -
2008-07-06 09:41:56 +00:00
Jonas Maebe
81ad9ea6e8 * fixed typo in r10602 causing the names of all record structures of
classes to be replaced with "sym_name" in the debuginfo

git-svn-id: trunk@10642 -
2008-04-13 09:36:31 +00:00
peter
95aaa7a74b * reorder code after r10602 so it is more clear
git-svn-id: trunk@10608 -
2008-04-06 12:47:05 +00:00
Jonas Maebe
39fa81d40e * fixed stabs debug info for webtbs/tw9766 again
git-svn-id: trunk@10602 -
2008-04-05 12:29:07 +00:00
peter
741b5a1df7 * fix writing procedure local type defs
* write type names once for types defined in the current compiled unit

git-svn-id: trunk@10541 -
2008-03-23 13:40:41 +00:00
florian
796f39a7a7 * force ansistring concatenation when building stabs
git-svn-id: trunk@10336 -
2008-02-16 08:53:54 +00:00
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +00:00
Jonas Maebe
84401d2226 * fixed debug info for enum types after r10189
git-svn-id: trunk@10197 -
2008-02-03 21:45:59 +00:00
peter
13f6396221 * generalize def and symbol handling
* stabs uses ansistring instead of pchars
  * write procdef in separate loop. this fixes debugging of nested/overloaded procs

git-svn-id: trunk@10189 -
2008-02-03 17:52:30 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
florian
cd4b05f3de * better detection of source file change while writing debug info
* set module index before replaying tokens of a generic

git-svn-id: trunk@9767 -
2008-01-15 21:36:58 +00:00
florian
5c96c4a671 + first part of support for an unicodestring type
git-svn-id: trunk@9382 -
2007-12-02 16:39:13 +00:00
Jonas Maebe
d2279d55d6 * restored outputting the stabs for local variables and parameters
which was accidentally disabled in r8878
  * move "end of function" stab past all stabs for the function (except
    for the Darwin "size" stab), like gcc does

git-svn-id: trunk@8905 -
2007-10-21 21:19:48 +00:00
Jonas Maebe
35cb2b9c2b * fixed placement of "size" stab for Darwin
git-svn-id: trunk@8878 -
2007-10-21 11:39:52 +00:00
Jonas Maebe
5a0a6d0d9e * fixed and enabled smartlinking on Darwin by adding more .reference
statements (some to work around linker bugs, most because they were
    really missing)

git-svn-id: trunk@8673 -
2007-09-28 22:48:41 +00:00
Jonas Maebe
83624822c3 * moved and changed format of N_OSO stab to be the same as under gcc
* no longer generate the DEBUGSTART/INFO/END/TABLE for Darwin as it
    is not needed there and those symbols sometimes confuse the linker

git-svn-id: trunk@8626 -
2007-09-23 21:00:30 +00:00
Jonas Maebe
9049f845f4 * avoid writing the stabs for a child class before those of a parent
class in case the parent class has a field with as type the (forward
    defined) child class, because this crashes gdb
  + (interactive) test for this

git-svn-id: trunk@8565 -
2007-09-19 16:37:49 +00:00
peter
fcfe1b24b4 * prevent overflow in record size
git-svn-id: trunk@8428 -
2007-09-11 18:12:28 +00:00
peter
67e16340be * revert r8118
git-svn-id: trunk@8139 -
2007-07-22 19:59:00 +00:00
daniel
21293f5818 + Add common type integer promotion.
- {$intpromotion common_type} or -CIcommon_type switches to common type promotion.
    - {$intpromotion native_integer} or -CIcommon_type switches to current behaviour.
    - Default in tp mode is common_type, native_integer in other modes
    - Compiler can cycle with -CIcommon_type
    - Still needs checking on other architectures than i386

git-svn-id: trunk@8118 -
2007-07-21 19:16:24 +00:00