Commit Graph

424 Commits

Author SHA1 Message Date
Károly Balogh
83cf14d5dd removed unnecessary masking in Swap() calls
git-svn-id: trunk@28613 -
2014-09-07 23:17:52 +00:00
Jonas Maebe
6e1d370417 * split off the texceptaddr declaration into rtl/inc/excepth.inc, so it can
be included at the start of the implementation of the system unit (before
    the rest of except.inc)
  * catch declarations in/loading from the system unit of the TExceptAddr type
  * use this type instead of hardcoded size constants in the compiler
  * in generic code that is active for all targets, puts its use in a virtual
    method since it's only valid for targets using setjmp/longjmp-style
    exception handling (and the record is not defined at all in the JVM RTL)

git-svn-id: branches/hlcgllvm@28376 -
2014-08-10 19:40:29 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
fb20791cbe * replaced all the remaining uses of nativeint in the rtl with either sizeint
or objpasint

git-svn-id: trunk@27237 -
2014-03-23 13:38:16 +00:00
nickysn
a176c2d4f5 + add overloaded versions of HexStr(pointer) for i8086 near and far pointers
- rm ifdefs for i8086 far code memory model when doing stack traces. The
  compiler will now choose the correct overload of HexStr according to the
  CodePointer type.

git-svn-id: trunk@27163 -
2014-03-16 17:40:31 +00:00
nickysn
3ec4c378aa + added the ObjpasInt type (an integer type equivalent to Objpas.Integer) to the
system unit implementation part.

git-svn-id: trunk@27142 -
2014-03-15 12:19:04 +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
3a55c4301e * Since StackTop=StackBottom+StackLength, any two variables are sufficient to describe stack, the third one is redundant.
* As a first part of cleanup, replaced StackTop with function returning StackBottom+StackLength.
* On Win32 and Win64, StackTop returns the stack base from TIB instead.

git-svn-id: trunk@27119 -
2014-03-12 19:48:03 +00:00
sergei
2f05e8b389 * PushExceptObject and dump_stack: use get_caller_stackinfo instead of get_caller_addr and get_caller_frame.
git-svn-id: trunk@27094 -
2014-03-11 12:51:46 +00:00
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
Jeppe Johansen
9b79f2f68d Added support for 8-bit CPU's in RTL. Mostly for missing implementations of int<->string conversion and console/text output.
git-svn-id: trunk@26958 -
2014-03-04 20:00:03 +00:00
nickysn
0d1342a791 * don't call FinalizeHeap from InternalExit if FPC_NO_DEFAULT_HEAP is defined.
This reduces i8086-msdos executable sizes by 1.5-1.7k depending on the memory
  model.

git-svn-id: trunk@26919 -
2014-03-02 11:38:11 +00:00
nickysn
73e6ffe675 * the TableCount and InitCount fields in the INITFINAL table changed to
nativeint (generates smaller and more efficient code on i8086)

git-svn-id: trunk@26913 -
2014-03-01 14:33:10 +00:00
Jonas Maebe
9e6764e443 * converted program termination to compilerproc/hlcg
git-svn-id: branches/hlcgllvm@26029 -
2013-11-11 11:14:43 +00:00
Jonas Maebe
cd92791d09 * converted unit initialization to compilerproc/hlcg
git-svn-id: branches/hlcgllvm@26028 -
2013-11-11 11:14:38 +00:00
sergei
f2a4d1bbbc - Do not compile generic threadvar code if tf_section_threadvars flag is enabled for target (currently there are no such targets).
git-svn-id: trunk@25736 -
2013-10-10 12:55:30 +00:00
Károly Balogh
c108a24cc8 reverted r25622 which was an accidental commit of some highly experimental debug code (sorry)
git-svn-id: trunk@25623 -
2013-10-02 18:31:28 +00:00
Károly Balogh
d004b44406 really fixed FillChar and fixed FillWord. fixes 8 tests.
git-svn-id: trunk@25622 -
2013-10-02 14:11:09 +00:00
pierre
22e9cb48dd Fix get_caller_stackinfo function: Addr parameter must also be by var
git-svn-id: trunk@25537 -
2013-09-23 09:51:20 +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
de56f909d5 * synchronized with trunk up to and including r25430
git-svn-id: branches/cpstrrtl@25431 -
2013-09-06 10:09:26 +00:00
florian
a240e74591 * check cputhumb/cputhumb2 to detect instruction set
git-svn-id: trunk@25417 -
2013-09-04 21:00:44 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
197b949dfa * fixed chdir/rmdir/mkdir(rawbytestring) on FPCRTL_FILESYSTEM_SINGLE_BYTE_API
when the passed in string has an encoding that is not a subset of
    DefaultFileSystemCodePage

git-svn-id: branches/cpstrrtl@25139 -
2013-07-19 16:31:47 +00:00
Jonas Maebe
df6a2dce00 + unicodestring support for assign/erase/rename
+ codepage support for textrec/filerec and the above routines
  * textrec/filerec now store the filename by default using widechar. It is
    possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
    In that case, from now on the filename will always be stored in
    DefaultFileSystemEncoding
  * fixed potential buffer overflows and non-null-terminated file names in
    textrec/filerec
  + dodirseparators(pwidechar), changed the dodirseparators(pchar/pwidechar)
    parameters into var-parameters and gave those routines an extra parameter
    that indicates whether the p(wide)char can be changed in place if
    necessary or whether a copy must be made first (avoids us having to make
    all strings always unique everywhere, because they might be changed on
    some platforms via a pchar)
  * do_open/do_erase/do_rename got extra boolean parameters indicating whether
    the passed pchars point to data that can be freely changed (to pass on to
    dodirseparators() if applicable)
  * objects.pp: force assign(pchar) to be called, because
    assign(array[0..255]) cannot choose between pchar and rawbytestring
    versions (and removing the pchar version means that assign(pchar) will
    be mapped to assign(shortstring) in {$h-})
  * fixed up some routines in other units that depend on the format of
    the textrec/filerec.name field

git-svn-id: branches/cpstrrtl@25137 -
2013-07-19 16:30:51 +00:00
Jonas Maebe
0ef0206417 * fixed off-by-one error in the optimised rawbytestring/unicodestring
dodirseparators() routines + added test (only testable under Windows)

git-svn-id: branches/cpstrrtl@25089 -
2013-07-12 17:18:16 +00:00
Jonas Maebe
d66d15aad3 + added mkdir/chdir/rmdir(rawbytestring) and (unicodestring) to the system unit
* renamed platform-specific pchar versions of those rouines to do_*() and
    changed them to either rawbytestring or unicodestring depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API setting
  * implemented generic shortstring versions of those routines on top of either
    rawbytestring or unicodestring depending on the API-kind (in case of the
    embedded target, if ansistring are not supported they will map directly
    to shortstring routines instead)
  * all platform-specific *dir() routines with rawbytestring parameters now
    receive their parameters in DefaultFileSystemCodePage
  - removed no longer required ansistring variants from the objpas unit
  - removed no longer required FPC_SYS_MKDIR etc aliases
  * factored out empty string and inoutres<>0 checks from platform-specific
    *dir() routines to generic ones
  o platform-specific notes:
   o amiga/morphos: check new pathconv(rawbytestring) function
   o macos TODO: convert PathArgToFSSpec (and the routines it calls) to
     rawbytestring
   o nativent: added SysUnicodeStringToNtStr() function
   o wii: convert dirio callbacks to use rawbytestring to avoid conversion
  + test for unicode mk/ch/rm/getdir()

git-svn-id: branches/cpstrrtl@25048 -
2013-07-04 22:28:37 +00:00
Jonas Maebe
62ee16278b * changed getdir(ansistring):ansistring to
getdir(rawbytestring):rawbytestring so it can accept strings in any
    encoding and cleanly return results in DefaultRTLFileSystemCodePage
  + getdir(unicodestring):unicodestring
  * renamed the getdir implementation of all platforms except for embedded-
    without-ansistring-support to do_getdir(), and depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API define
    changed its shortstring parameter to ansistring or unicodestring. The
    do_getdir(rawbytestring) routine should just set the code page of the
    return value to DefaultFileSystemCodePage without conversion (not
    DefaultRTLFileSystemCodePage with conversion, that conversion is performed
    in getdir if necessary; this avoids double conversions in case
    getdir(unicodestring) is called)
  + generic getdir(shortstring) for platforms supporting either ansistrings or widestrings
  o platform maintainers:
   o OS/2: adjust code to supports paths > 255 characters if those are supported
   o Wii: adjust used callback to use rawbytestring to support paths > 255 characters and
     avoid shortstring->rawbytestring conversion overhead
   o Windows: GetCurrentDirectoryW is now always used (to prevent data loss)

git-svn-id: branches/cpstrrtl@24993 -
2013-06-27 21:37:47 +00:00
Jonas Maebe
679785f90c + rawbytestring and unicodestring versions of DoDirSeparators (optimised to
prevent calling uniquestring multiple times)

git-svn-id: branches/cpstrrtl@24992 -
2013-06-27 21:37:43 +00:00
florian
844806cb19 * renamed parameter bp (x86 ism) into fp for dump_stack
* more sanity checks if fp really points into the stack

git-svn-id: trunk@24975 -
2013-06-25 19:46:08 +00:00
Jonas Maebe
5a72bc3656 * export filerec/textrec from the system unit and use them in the compiler
to determine their size, rather than hardcoding the size for all possible
    configurations

git-svn-id: branches/cpstrrtl@24957 -
2013-06-24 09:39:50 +00:00
nickysn
10f7f0231e * TExitProcInfo.SaveExit changed to CodePointer
git-svn-id: trunk@24852 -
2013-06-09 20:19:28 +00:00
nickysn
fe404d2891 + rtl implementation of ptr(seg,ofs) for i8086
git-svn-id: trunk@24565 -
2013-05-24 12:11:55 +00:00
paul
d90445e5ee compiler, rtl, tests: write Delphi compatible (more or less) type information for Class Reference and Pointer types (mantis #0024367)
git-svn-id: trunk@24421 -
2013-05-04 12:47:05 +00:00
florian
0e41df598e * merge i8086 branch by Nikolay Nikolov
git-svn-id: trunk@24324 -
2013-04-25 20:23:51 +00:00
nickysn
5f5402f479 * changed ifdef, so that HandleErrorAddrFrame uses the default calling convention on i8086 (whatever that may be), instead of register
git-svn-id: branches/i8086@24257 -
2013-04-16 08:20:51 +00:00
nickysn
ceb76808e7 + implemented the CSeg, DSeg and SSeg functions on the i8086
git-svn-id: branches/i8086@24041 -
2013-03-28 21:29:14 +00:00
pierre
503b8c73c2 Avoid infinite loops with RTE 204 if heap is corrupted
git-svn-id: trunk@23845 -
2013-03-15 15:40:23 +00:00
nickysn
3768914a3d slight rtl update for i8086-msdos
git-svn-id: branches/i8086@23777 -
2013-03-10 16:57:15 +00:00
florian
21c154d60a Merged r22903
git-svn-id: trunk@23757 -
2013-03-09 20:56:07 +00:00
florian
1eeeb309c7 * intial armv6m support, it is not working yet, constant pool insertation and conditional branch fixup is not working yet
git-svn-id: trunk@23682 -
2013-03-03 12:20:10 +00:00
pierre
6e5be15087 Add PT convinience variable to ba able to debug InitFinalTable
git-svn-id: trunk@23558 -
2013-02-01 21:13:55 +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
24f518f232 + redirect calls to empty virtual methods to FPC_EMPTYMETHOD
* do empty subroutine/method optimization only for O2 and higer

git-svn-id: trunk@23276 -
2013-01-01 16:43:27 +00:00
Jeppe Johansen
3ee29eb219 Fixed ARMv7-EM code generation and RTL compilation
Added LM4F120H5 controller type and startup code

git-svn-id: branches/laksen/arm-embedded@22903 -
2012-11-01 17:25:01 +00:00
tom_at_work
f252fd369e Tried to reorganize the ARM define mess in rtl/arm/arm.inc. Instead of requiring to enumerate all possible ARM variants each time a CPU feature is used, add a define of the format CPUARM_HAS_XXX and use that. Note that a better solution would be to properly implement the compiler cpuinfo infrastructure, however that is much more work.
+ CPUARM_HAS_BX is defined if the CPU supports the BX* instruction
  + CPUARM_HAS_REV is defined if the CPU supports the REV instruction. Note that you still have to check for compiler versions > 2.6.0 since the assembler reader of 2.6.0 does not understand that instruction.
  + CPUARM_HAS_IDIV is defined if the CPU supports the sdiv, udiv instructions. Use of this fixes a bug where previously these instruction were only used for armv7-m, while cortex3m cpus also support it.
  + CPUARM_HAS_LDREX is defined if the CPU supports the ldrex/strex instructions. Use of this fixes a bug with armv7(-a) cpus where this path has not been used.
  + SYSTEM_HAS_KUSER_CMPXCHG is defined if the system (mainly OS) support the kuser_cmpxchg functions. Use of this fixes a bug where ARMHF systems did not use it for synchronization (although ARMHF is armv7+ only, i.e. the LDREX path is used anyway)

git-svn-id: trunk@22081 -
2012-08-14 19:45:03 +00:00
pierre
a311c53167 Replace HandleErrorFrame calls by HandleErrorAddrFrameInd where possible in common code (to allow correct backtrace for mips cpu)
git-svn-id: trunk@21900 -
2012-07-12 11:53:59 +00:00
pierre
ca8cc759ac Add HandleErrorAddrFrameInd to restore same behavior for RTEs as for 2.6.0, i.e. avoid an additional line at fpc_XXX level in stack dump
git-svn-id: trunk@21899 -
2012-07-12 10:19:58 +00:00
Jonas Maebe
aba6923187 * moved g_test_self() from cgobj to hlcgobj
git-svn-id: trunk@21861 -
2012-07-11 08:25:51 +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
8469741700 + Added additional addr pointer parameter to
get_caller_frame, get_caller_addr and dump_stack
  with default NIL value to systemh.inc.
  + Added new get_addr function.
  system.inc: Use get_addr and get_frame to call
  HandleErrorAddrFrame instead of HandleErrorFrame
  in several error functions.
  Modify dump_stack to use frame and addr parameters.
  Provide a dummy get_addr function returning nil.
  i386/i386.inc, x86_64./x86_64.inc: Provide real
  implementation of get_addr function.

git-svn-id: trunk@21697 -
2012-06-24 21:22:09 +00:00
pierre
be67af4374 * Adapt to mipsel compiler defining cpumipsel and cpumipsel32 but not cpumips anymore
git-svn-id: trunk@21541 -
2012-06-08 09:33:03 +00:00
Jonas Maebe
baa8fa39a8 * converted code to trash variables (-gt) to operate at the node tree level,
and also use this code to trash local variables in inlined routines
   o fixes mantis #22088
   o makes it possible to also implement it for the jvm target in the future

git-svn-id: trunk@21393 -
2012-05-26 11:32:39 +00:00
florian
6c8eed21c4 + implement auto inlining (-Ooautoinline)
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used

git-svn-id: trunk@21335 -
2012-05-19 13:30:02 +00:00
Jonas Maebe
7aa3b99fb5 + -CN/{$CHECKLOWADDRLOADS+/-} switch to enable explicit checks for accesses
to low addresses in case the target cpu/OS does not support this (enabled
    for reads on AIX/PPC because on AIX the first 16KB are readable)

git-svn-id: trunk@20832 -
2012-04-11 18:05:50 +00:00
svenbarth
bd19a16be9 Add support for Default() intrinsic. For now this is only (fully) supported
in code and not in constants. In the case of primitive types constant nodes
are used while complex types like arrays, records and objects use a local
variable which is initialized to zero once at the entry of the method (the
variable is reused if Default() is used for the same type multiple times in
the same method). For this a new compilerproc was added which uses FillChar
to initialize the given memory area to zero.
This fixes Mantis #9420.

+ psystem.pas: Added Default symbol to system unit
+ htypechk.pas: Added function "is_valid_for_default" which checks recursively
                whether the given type can be used with Default at all. 
                Forbidden types are files, helpers, ObjC and C++ types. This
                check is used for records, arrays and objects only if the mode
                is a non-Delphi one, as Delphi ignores these types on lower
                levels.
+ msg/errore.msg: Added error message for unsupported types for Default()
+ symconst.pas: Added a new enum value vo_is_default_var which is used for the
                local variables utilized by Default() so their initalization
                and finalization can be avoided.
+ pexpr.pas: Add handling of Default() intrinsic to "statement_syssym"
+ ninl.pas: Extended tinlinenode by a method which returns the correct node for
            a Default() and used that method in handle_typecheck.
* ncgutil.pas: Check for new flag "vo_is_default_var" when initializing and
               finalizing local variables.
* ppu.pas: increase PPU version
+ psub.pas: 
  * Added a new routine which zeros defaultvars of a symtable.
  * Use this routine inside "initializevars".
  * Also use this routine to initialize the staticsymtable of the unit/program.
* Adjusted ppudump, because of the new enum value.
+ Added implementation of fpc_zeromem to system unit.
+ Added tests for Default()

git-svn-id: trunk@20629 -
2012-03-25 16:02:27 +00:00
pierre
b058593b53 * Fix compilation for cpu i386
git-svn-id: trunk@20264 -
2012-02-05 18:51:23 +00:00
florian
a2009af76e * updated MIPS code so the compiler gets through the system unit
git-svn-id: trunk@20259 -
2012-02-05 08:14:46 +00:00
florian
6a1a2d3464 * get rid of some feature checks, probably the whole feature stuff is plainly the wrong way, embedded rtl compiles again, resolves #20913
git-svn-id: trunk@19907 -
2011-12-29 14:06:30 +00:00
sergei
ebe1d74d6e * Moved multiple similar checks for FPC_HAS_FEATURE_EXITCODE and FPC_LIMITED_EXITCODE to Halt() procedure. Now these checks appear only once.
git-svn-id: trunk@19597 -
2011-11-05 16:48:12 +00:00
florian
d7f7a9bb76 * patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
florian
375f83c874 * moved heap manager on embedded systems into a separate unit
* moved console io on embedded systems into a seperate unit, this unit might setup input/output e.g. to be redirected to a serial port
* cleanup of the embedded system unit

git-svn-id: trunk@19168 -
2011-09-21 20:57:37 +00:00
florian
e3e1e4b7c6 * fpc_LibInitializeUnits can be empty if the target has no shared lib support
git-svn-id: trunk@18871 -
2011-08-27 22:45:49 +00:00
sergei
d9c399f6a1 * Partially reverted rev.17798: printing the runtime error message must remain in InternalExit.
Moving it to SysFlushStdIo causes a multithreaded program to print several messages with meaningless stack traces.

git-svn-id: trunk@17944 -
2011-07-06 17:40:34 +00:00
pierre
2d5ca71a06 + New procedure SysFlushStdIO (code taken from InternalExit).
* InternalExit: now calls new procedure SysFlushStdIO
 * DoneThread: Also calls SysFlushStdIO to avoid loosing output
 if standard files are redirected.

git-svn-id: trunk@17798 -
2011-06-22 16:16:27 +00:00
pierre
0af77f8957 * Clean up mswindows/os2 ARGV release in InternalExit to avoid crash if called twice
git-svn-id: trunk@17702 -
2011-06-09 08:22:21 +00:00
florian
7f0d245ac2 * reintegrate avr branch into trunk, work on avr is less invasive than I thought so it can be continued in trunk
git-svn-id: trunk@17348 -
2011-04-19 20:17:52 +00:00
florian
fb84cb865b * rebase to trunk@17295
git-svn-id: branches/avr@17296 -
2011-04-10 19:20:48 +00:00
svenbarth
d0705a1779 Rebase to revision 17236
git-svn-id: branches/svenbarth/classhelpers@17241 -
2011-04-03 17:24:35 +00:00
svenbarth
b0b051ae83 Introduce a new type kind for helpers in the RTTI. This is Delphi incompatible, but it's cleaner than Delphi's "let's extend some magic class". This might not matter much though, because according to Google the RTTI for class helpers seems to be rarely used.
* compiler/ncgrtti.pas:
- objectdef_rtti_class_full:
 - don't write the VMT data for helpers
 - write the typeinfo of the extended type (something that Delphi does definitely not support :P )
- objectdef_rtti: write the new type kind for helpers instead that of classes
* compiler/symconst.pas: introduce new type kind constant "tkHelper" before "tkFile" (what is that used for btw?)
* rtl/inc/system.inc: add the constant here as well (why wasn't tkUChar added here?)
* objpas/typinfo.pp: 
- add tkHelper to the TTypeKind enum (but here tkUChar was added?!)
- extend the TTypeData record with the data of helpers

git-svn-id: branches/svenbarth/classhelpers@17240 -
2011-04-03 14:13:00 +00:00
sergei
f7dcad6f92 * Rewrote those insane {$ifdef FPC_HAS_INDIRECT_MAIN_INFORMATION} into somewhat more readable form.
git-svn-id: trunk@17163 -
2011-03-21 21:12:46 +00:00
florian
2e22090451 * ifdef'ed textrec and filerec usage completely depending on the features set
git-svn-id: branches/avr@17022 -
2011-02-26 20:57:09 +00:00
florian
f15141a6f3 - removes 2.2.x bootstrapping stuff
git-svn-id: trunk@16465 -
2010-11-28 17:29:15 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
florian
7acdfa8932 - removed overseen overleft from iso goto implementation experiments
git-svn-id: trunk@15716 -
2010-08-06 07:42:34 +00:00
florian
24fea58b92 + initial implementation of iso style gotos in iso mode
* made setjmp/longjmp accessible to the compiler by compiler proc, they are used by the iso goto code

git-svn-id: trunk@15711 -
2010-08-05 19:20:46 +00:00
florian
e01e4e5719 * optimized copy(<dyn. array> ...) by checking if the elements are really ref. counted
git-svn-id: trunk@15228 -
2010-05-05 13:49:06 +00:00
Jonas Maebe
1b58fcc877 * set moduleislib to true for libraries. Differences with islibrary:
a) is also set to true for packages (when packages will beimplemented)
     b) exists for each package/library/application separately, instead of
        being stored in the package containing the system unit (when packages
        will be implemented)
    (mantis #15701)

git-svn-id: trunk@14880 -
2010-02-10 16:10:23 +00:00
Jonas Maebe
3138093fdf * changed errnum parameter of halt() from byte to longint to match the
definition of exitcode (mantis #15231)

git-svn-id: trunk@14339 -
2009-12-06 10:02:05 +00:00
Jonas Maebe
184d0d6a64 * use full precision in random():extended calculation
git-svn-id: trunk@14280 -
2009-11-27 19:14:28 +00:00
marco
4104d9f481 * More pluggability of the RTL. Mantis 15124
git-svn-id: trunk@14212 -
2009-11-18 21:16:12 +00:00
marco
17062d667c * ansistring versions of mk/rm/chdir in objpas, Mantis 15010. The os-dependant routines of *nix/os2/win/dos have been converted
git-svn-id: trunk@14211 -
2009-11-18 18:04:51 +00:00
florian
515774b864 * merged armthum branch
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U    rtl/arm/setjump.inc
A    rtl/arm/thumb2.inc
U    rtl/arm/divide.inc
A    rtl/embedded/arm/stm32f103.pp
U    rtl/inc/system.inc
U    compiler/alpha/cgcpu.pas
U    compiler/sparc/cgcpu.pas
U    compiler/i386/cgcpu.pas
U    compiler/ncgld.pas
U    compiler/powerpc/cgcpu.pas
U    compiler/avr/cgcpu.pas
U    compiler/aggas.pas
U    compiler/powerpc64/cgcpu.pas
U    compiler/x86_64/cgcpu.pas
U    compiler/cgobj.pas
U    compiler/psystem.pas
U    compiler/aasmtai.pas
U    compiler/m68k/cgcpu.pas
U    compiler/ncgutil.pas
U    compiler/rautils.pas
U    compiler/arm/raarmgas.pas
U    compiler/arm/armatts.inc
U    compiler/arm/cgcpu.pas
U    compiler/arm/armins.dat
U    compiler/arm/rgcpu.pas
U    compiler/arm/cpubase.pas
U    compiler/arm/agarmgas.pas
U    compiler/arm/cpuinfo.pas
U    compiler/arm/armop.inc
U    compiler/arm/narmadd.pas
U    compiler/arm/aoptcpu.pas
U    compiler/arm/armatt.inc
U    compiler/arm/aasmcpu.pas
U    compiler/systems/t_embed.pas
U    compiler/psub.pas
U    compiler/options.pas

git-svn-id: trunk@13801 -
2009-10-04 09:03:44 +00:00
florian
a5f3cd9b1d * take random feature switch into account
git-svn-id: trunk@13300 -
2009-06-19 15:26:06 +00:00
Jonas Maebe
0597c300f4 * applied feature dependencies patch by Sven Barth from mantis #13673 :
o i386/i386.inc used a function (fpc_truely_ansistr_unique) is now
     only included if FPC_HAS_FEATURE_ANSISTRINGS is enabled (all other
     platforms use the Pascal-only implementations)
   o inc/heap.inc relied on threading
   o inc/threads.inc relied on exceptions, consoleio and stackcheck
   o inc/system.inc: just a feature-related "variable not used"-hint

git-svn-id: trunk@13121 -
2009-05-09 20:08:57 +00:00
florian
2510af64d1 * fixed compilation of embedded system unit: path helper functions depend now on the avaibility of the textio/fileio feature
git-svn-id: trunk@12599 -
2009-01-26 08:23:38 +00:00
Jonas Maebe
b7d461d0f0 * fixed generic stack checking code (the stack pointer is already decreased
before FPC_STACKCHECK is called, so don't subtract the allocated size
    again when checking)

git-svn-id: trunk@12525 -
2009-01-08 18:05:11 +00:00
Jonas Maebe
d3923b315a * generic support for setting islibrary to true for libraries (+ changed
tlibrary1 to test this)

git-svn-id: trunk@12377 -
2008-12-17 17:49:16 +00:00
florian
b178b08ba7 Merged revisions 11665-11738 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/unicodestring

........
  r11665 | florian | 2008-08-30 13:30:17 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * continued to work on unicodestring type support
........
  r11666 | florian | 2008-08-30 19:02:26 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * expectloc for wide/ansi/unicode strings is LOC_CONSTANT or LOC_REGISTER now
........
  r11667 | florian | 2008-08-30 20:42:37 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * more unicodestring stuff fixed, test results on win32 are already good
........
  r11670 | florian | 2008-08-30 23:21:48 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * first fixes for unix bootstrapping
........
  r11683 | ivost | 2008-09-01 12:46:39 +0200 (Mon, 01 Sep 2008) | 2 lines
  
      * fixed 64bit bug in iconvenc.pas
........
  r11689 | florian | 2008-09-01 23:12:34 +0200 (Mon, 01 Sep 2008) | 1 line
  
  * fixed several errors when building on unix
........
  r11694 | florian | 2008-09-03 20:32:43 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * fixed unix compilation
........
  r11695 | florian | 2008-09-03 21:01:04 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * bootstrapping fix
........
  r11696 | florian | 2008-09-03 21:07:18 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * more bootstrapping fixed
........
  r11698 | florian | 2008-09-03 22:47:54 +0200 (Wed, 03 Sep 2008) | 1 line
  
  + two missing compiler procs exported
........
  r11701 | florian | 2008-09-04 16:42:34 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + lazarus project for the linux rtl
........
  r11702 | florian | 2008-09-04 16:43:27 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + set unicode string procedures
........
  r11707 | florian | 2008-09-04 23:23:02 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  * fixed several type casting stuff
........
  r11712 | florian | 2008-09-05 22:46:03 +0200 (Fri, 05 Sep 2008) | 1 line
  
  * fixed unicodestring compilation on windows after recent unix changes
........
  r11713 | florian | 2008-09-05 23:35:12 +0200 (Fri, 05 Sep 2008) | 1 line
  
  + UnicodeString support for Variants
........
  r11715 | florian | 2008-09-06 20:59:54 +0200 (Sat, 06 Sep 2008) | 1 line
  
  * patch by Martin Schreiber for UnicodeString streaming
........
  r11716 | florian | 2008-09-06 22:22:55 +0200 (Sat, 06 Sep 2008) | 2 lines
  
  * fixed test
........
  r11717 | florian | 2008-09-07 10:25:51 +0200 (Sun, 07 Sep 2008) | 1 line
  
  * fixed typo when converting tunicodestring to punicodechar
........
  r11718 | florian | 2008-09-07 11:29:52 +0200 (Sun, 07 Sep 2008) | 3 lines
  
  * fixed writing of UnicodeString properties
  * moved some helper routines to unicode headers
........
  r11734 | florian | 2008-09-09 22:38:55 +0200 (Tue, 09 Sep 2008) | 1 line
  
  * fixed bootstrapping
........
  r11735 | florian | 2008-09-10 11:25:28 +0200 (Wed, 10 Sep 2008) | 2 lines
  
  * first fixes for persisten unicodestrings
........
  r11736 | florian | 2008-09-10 14:31:00 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  Initialized merge tracking via "svnmerge" with revisions "1-11663" from 
  http://svn.freepascal.org/svn/fpc/trunk
........
  r11737 | florian | 2008-09-10 21:06:57 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  * fixed unicodestring <-> variant handling
  * fixed unicodestring property reading
........

git-svn-id: trunk@11739 -
2008-09-10 20:14:31 +00:00
Jonas Maebe
7b467fa2a0 * Don't inline ioresult. It's not speed critical and inlining it causes
code bloat.

git-svn-id: trunk@11596 -
2008-08-16 20:51:52 +00:00
yury
0d12d51690 * Fixed warnings on non x86 targets.
git-svn-id: trunk@11201 -
2008-06-05 08:14:27 +00:00
Jonas Maebe
f00beea41c * fixed i386/linux rtl compilation and functionality when compiled
without regcall

git-svn-id: trunk@11024 -
2008-05-21 15:20:13 +00:00
florian
ff9273bf0d * flush standard files only if they are opend for output, resolves #11170
git-svn-id: trunk@10866 -
2008-05-02 18:42:28 +00:00
Jonas Maebe
95637dea75 * fixed swapendian(smallint) (bug found by Joost van der Sluis)
* based swap(smallint) and swap(word) on swapendian(smallint/word),
    since the same bug was already fixed in swap(smallint) in r6752
    (so these routines now share the same code)
  * fixed potential range error in swapendian(word)
  + added basic test for the above four routines

git-svn-id: trunk@10840 -
2008-04-29 22:14:43 +00:00
yury
9472825478 * Fixed warnings.
git-svn-id: trunk@10630 -
2008-04-12 11:46:04 +00:00
yury
5dc6e54925 * Removed inline for procedures with assembler or formal parameters, since inline is not supported for them (compiler warns about that now). Even if there is no inline modifier in interface declaration of procedure, it is possible to specify inline in procedure implementation if needed (e.g. for generic implementations) and inlining will work for them.
git-svn-id: trunk@10629 -
2008-04-12 11:37:49 +00:00
michael
174de3eab1 Merged revisions 9693-10480 via svnmerge from
svn+ssh://svn.freepascal.org/FPC/svn/fpc/branches/resources

........
  r9694 | michael | 2008-01-09 21:31:18 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * Initial check-in
........
  r9695 | michael | 2008-01-09 21:35:58 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * New version from Giulio Bernardi
........
  r9697 | michael | 2008-01-09 21:41:54 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * Patch from Giulio Bernardi with resource support
........
  r9698 | michael | 2008-01-09 21:46:33 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * Patch from Giulio Bernardi to add more resource testing
........
  r9699 | michael | 2008-01-09 21:57:26 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * New tool from Giulio Bernardi
........
  r9700 | michael | 2008-01-09 21:58:23 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * New tool from Giulio Bernardi
........
  r9701 | michael | 2008-01-09 22:01:54 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * Added fcl-res
........
  r9702 | michael | 2008-01-09 22:01:58 +0100 (Wed, 09 Jan 2008) | 1 line
  
  * Added fcl-res
........
  r9703 | michael | 2008-01-10 08:54:26 +0100 (Thu, 10 Jan 2008) | 1 line
  
  * Fixed double code
........
  r9704 | jonas | 2008-01-10 10:59:20 +0100 (Thu, 10 Jan 2008) | 2 lines
  
    - removed duplicate code
........
  r9705 | jonas | 2008-01-10 11:25:21 +0100 (Thu, 10 Jan 2008) | 2 lines
  
    + added missing fcl-res dependencies
........
  r9706 | jonas | 2008-01-10 11:58:30 +0100 (Thu, 10 Jan 2008) | 2 lines
  
    + dependencies for fpintres and fpextres
........
  r9707 | yury | 2008-01-10 12:47:51 +0100 (Thu, 10 Jan 2008) | 3 lines
  
  * Fixed compilation of resource, which is included in a unit located in different folder than main source.
  * .res files must be copied to units output folder, otherwise .res files will not be found when only compiled units path is available and compiler does not know anything about sources folder.
  * Improved resource related error messages.
........
  r9708 | michael | 2008-01-10 12:52:13 +0100 (Thu, 10 Jan 2008) | 1 line
  
  * Removed double source after end.
........
  r9709 | michael | 2008-01-10 12:52:48 +0100 (Thu, 10 Jan 2008) | 1 line
  
  * No longer needed
........
  r9710 | tom_at_work | 2008-01-10 22:09:08 +0100 (Thu, 10 Jan 2008) | 1 line
  
  * properly align FPC_RESLOCATION so that linking does not fail on some architectures (e.g. ppc64)
........
  r9711 | tom_at_work | 2008-01-10 23:53:12 +0100 (Thu, 10 Jan 2008) | 1 line
  
  * fix splitting of 64 bit load/stores from/to unaligned memory locations into multiple load/stores, which in some cases generated wrong code
........
  r9712 | michael | 2008-01-11 11:00:08 +0100 (Fri, 11 Jan 2008) | 1 line
  
  * Fixed bug in BSS section on 64-bit platforms
........
  r9720 | giulio | 2008-01-12 10:02:04 +0100 (Sat, 12 Jan 2008) | 1 line
  
  Updated fcl-res documentation: occurrences of reslib changed to fcl-res.
........
  r9740 | giulio | 2008-01-13 19:36:44 +0100 (Sun, 13 Jan 2008) | 3 lines
  
   - Don't try to compile resources on systems with a non windows-like resource support.
   - Don't add the .or file to the list of object files if resource compiling failed.
........
  r10201 | giulio | 2008-02-04 11:35:44 +0100 (Mon, 04 Feb 2008) | 5 lines
  
  * resource compiling supported on OS/2 via wrc
  * CompileResourceFiles and CollectResourceFiles don't do target-specific checks anymore
  * refactored a bit
........
  r10389 | giulio | 2008-02-25 21:32:52 +0100 (Mon, 25 Feb 2008) | 2 lines
  
  Deleted test file which was committed by mistake
........
  r10472 | giulio | 2008-03-10 12:22:18 +0100 (Mon, 10 Mar 2008) | 2 lines
  
  changed define FPC_HAS_RESOURCES to FPC_HAS_WINLIKERESOURCES
........

git-svn-id: trunk@10481 -
2008-03-12 21:33:48 +00:00
micha
83b7f81f81 + add no-fpu support to compiler/rtl for powerpc-linux (-Cfnone)
git-svn-id: trunk@10422 -
2008-03-02 12:59:02 +00:00
florian
c05d4912f4 + basic system unit for avr-embedded
* fixed several compiler stuff to be able to start system unit compilation on avr

git-svn-id: trunk@10318 -
2008-02-13 20:35:16 +00:00
peter
f4f3ae84d0 * AllowDirectorySeparators and AllowDriveSeparators typed constants
added to allow customization of path and directory parsing in the rtl
  * Use the new sets instead of the hardcoded / and \

git-svn-id: trunk@10105 -
2008-01-29 23:04:56 +00:00
peter
73871b64ce * BeOS/Haiku updates from Olivier Coursière
git-svn-id: trunk@9880 -
2008-01-23 15:37:25 +00:00
yury
c4e60fd1a5 - Removed systhrd.inc from targets where thread manager is stub by default. Stub is installed in common thread.inc file if DISABLE_NO_THREAD_MANAGER is not defined.
git-svn-id: trunk@9558 -
2007-12-28 15:21:02 +00:00
yury
e00bacdcef * Removed HAS_MT_MEMORYMANAGER define, since it is obsolete now.
git-svn-id: trunk@9556 -
2007-12-28 11:30:46 +00:00
daniel
823432146a * Only overload findresource with an ansistring variant if
FPC_HAS_FEATURE_ANSISTRINGS is defined.

git-svn-id: trunk@9542 -
2007-12-27 15:31:35 +00:00
yury
a2daf2e86d * Activated again workaround of dead code warnings on (errorcode > maxExitCode) condition.
git-svn-id: trunk@9537 -
2007-12-26 16:20:08 +00:00
yury
e7918b9411 * Fixed compilation on some targets. It seems to be a bug in finding variables in expressions like that: {$if sizeof(my_var) = 4}
git-svn-id: trunk@9516 -
2007-12-22 17:39:49 +00:00
yury
99ea98c7b1 * Workaround dead code warnings by using preprocessor.
git-svn-id: trunk@9497 -
2007-12-21 21:49:47 +00:00
peter
43c446e742 * add DumpExceptionBackTrace
git-svn-id: trunk@9071 -
2007-11-02 22:08:17 +00:00
florian
b2b0e749bb * win32 system unit doesn't depend anymore directly on the main program, this is necessary to be able to keep it in a dll
git-svn-id: trunk@9052 -
2007-11-01 21:59:43 +00:00
florian
78ca6925ba * don't care about __stklen anymore
git-svn-id: trunk@9028 -
2007-11-01 10:18:05 +00:00
florian
90af7ebf72 * use only windows exceptions for stack checking on win32/win64, resolves #9166
git-svn-id: trunk@9020 -
2007-10-31 23:19:48 +00:00
peter
cd35804502 * cache inoutres threadvar address
git-svn-id: trunk@8824 -
2007-10-16 19:12:29 +00:00
Jonas Maebe
6121df1f67 * moved inclusion of sysos.inc higher up in system.inc, so that
cgeneric.inc can use the C types
  * imports of C routines in cgeneric.inc now use C types

git-svn-id: trunk@8816 -
2007-10-15 13:51:51 +00:00
Jonas Maebe
33c4197f43 * changed FPC_EMPTYCHAR into a widechar because it's also used for
widestring -> pwidechar conversions (mantis #9897)

git-svn-id: trunk@8756 -
2007-10-09 17:52:25 +00:00
peter
e8322a83e4 * optimized generic implementations to use pointers instead of
array accesses. This also allows better register variable
    optimizations

git-svn-id: trunk@8742 -
2007-10-07 18:36:18 +00:00
Tomas Hajny
58bca68e6a + infrastructure for CtrlBreakHandler added
git-svn-id: trunk@8691 -
2007-09-30 14:14:33 +00:00
Jonas Maebe
fd98a0cc5b * don't call runerror if a unix threading error occurs (because this
immediately terminates the whole application), but instead call
    handleerrorframe (which can be converted into an exception) (#7954)

git-svn-id: trunk@8248 -
2007-08-08 13:59:17 +00:00
Jonas Maebe
c630797934 * fixed swap(integer) due to counter-intuitive TP/Delphi compatible
shr-behaviour

git-svn-id: trunk@6752 -
2007-03-08 22:30:12 +00:00
daniel
7c5d3f69ac * hexstr can handle pointers
git-svn-id: trunk@6526 -
2007-02-17 16:39:02 +00:00
daniel
984191ef0e * Also add symteminline condition.
git-svn-id: trunk@5691 -
2006-12-23 15:48:28 +00:00
daniel
29ee556451 * Make real48 operators inline
git-svn-id: trunk@5690 -
2006-12-23 15:44:46 +00:00
florian
fd2032dab2 + start of embedded rtl
+ feature support in the compiler

git-svn-id: trunk@5628 -
2006-12-17 18:40:36 +00:00
yury
4bfe0e6819 * Optimization for code size.
git-svn-id: trunk@5331 -
2006-11-11 14:19:33 +00:00
daniel
de001ec4ad * Free hidden cmdline instead of cmdline property.
git-svn-id: trunk@4968 -
2006-10-18 20:32:45 +00:00
florian
86cc5ec31b * more debugging
git-svn-id: trunk@4564 -
2006-09-07 20:07:41 +00:00
yury
4e9ca8c0f0 * Note was fixed.
git-svn-id: trunk@4533 -
2006-09-02 08:15:35 +00:00
oro06
d1dc6efeea *fix rtl compile : HAS_MEMORYMANAGER/HAS_MT_MEMORYMANAGER
git-svn-id: trunk@4431 -
2006-08-17 09:39:01 +00:00
Jonas Maebe
ec1d8a139f * fixed for non-Windows and non-OS/2
git-svn-id: trunk@4411 -
2006-08-12 12:23:19 +00:00
florian
d337c3ca6a * clean up heap at exit, fixes #7183
git-svn-id: trunk@4410 -
2006-08-11 22:09:29 +00:00
michael
5ef20e6215 + Added delphi compatibility Error procedure
git-svn-id: trunk@3610 -
2006-05-21 09:57:47 +00:00
florian
acc016c9ec * finished safecall support
git-svn-id: trunk@3417 -
2006-05-04 20:40:31 +00:00
peter
2d3c01d83a * basic work to make Move() and FillChar() internal under ifdef INTERNALMOVEFILLCHAR
git-svn-id: trunk@3021 -
2006-03-24 17:32:39 +00:00
peter
9381c9360e * Flush all StdIO output files
git-svn-id: trunk@2985 -
2006-03-20 09:56:00 +00:00
Vincent Snijders
cfcbd77133 * write caller address, even if no caller frame was found
git-svn-id: trunk@2897 -
2006-03-12 21:30:06 +00:00
peter
4c56a87d59 * integrate loaders in system unit
git-svn-id: trunk@2695 -
2006-02-26 18:21:35 +00:00
Jonas Maebe
1bcde3436d * random(int64(0)) now return 0 instead of division by zero
* random(negative_longint) now returns values between -l+1 and 0
    instead of between -l and 0

git-svn-id: trunk@2422 -
2006-02-03 20:57:32 +00:00
peter
94f2b1d941 * add initialstkptr to get the stackpointer at startup before
PASCALMAIN is called so the main body framepointer is seen as
    a valid pointer with backtracing

git-svn-id: trunk@2266 -
2006-01-12 09:29:57 +00:00
Jonas Maebe
5b9f58ef73 * reverted r2037 because of braindead "out" semantics for refcounted
types

git-svn-id: trunk@2045 -
2005-12-24 01:06:05 +00:00
Jonas Maebe
84aab46550 * changed formal "var" paramters of move, movechar0 and fill* into
"out" parameters to avoid wrong "uninitialized" warnings

git-svn-id: trunk@2037 -
2005-12-23 20:59:08 +00:00
tom_at_work
1b4b42fdd6 * added CheckInitialStkLen() function which checks whether the given stack size value is valid on the OS when creating a thread, fixing stack checking
git-svn-id: trunk@1722 -
2005-11-11 12:16:08 +00:00
tom_at_work
367df58016 * stack related things (sizes, calculations, etc.) are now 64 bit on 64 bit platforms
* default stack size is now also 32k for Windows (allows the use of stack checking when using threads)

git-svn-id: trunk@1718 -
2005-11-10 17:06:25 +00:00
yury
2332eae403 * prevent endless stack dump if an exception occured during the dump itself.
git-svn-id: trunk@1427 -
2005-10-16 17:17:50 +00:00
tom_at_work
f7f0f9c426 * makefile adaption to be able to cycle compiler and RTL on PowerPC64 target
* some fixes for PowerPC64 target in the code generator and the RTL
* stabs generation for PowerPC64 is okay now (untested)

git-svn-id: trunk@1337 -
2005-10-08 15:48:39 +00:00
michael
c15d1b280f + Initial implementation of RTL resource support
git-svn-id: trunk@991 -
2005-08-31 15:54:30 +00:00
florian
25b79e9db3 * patch from Yury Sidorov to make simply exception handling without sysutils possible
git-svn-id: trunk@595 -
2005-07-07 18:53:21 +00:00
michael
5cafc069b5 + Removed NOSAVEREGISTERS define
git-svn-id: trunk@307 -
2005-06-09 17:58:20 +00:00
michael
3a2eaa94b1 + Removed INTERNCONSTINTF define
git-svn-id: trunk@267 -
2005-06-07 22:04:18 +00:00
michael
93ba0409be + Removed HASCOMPILERPROC define
git-svn-id: trunk@265 -
2005-06-07 21:41:02 +00:00
michael
a20556e62d + Removed INTERNLENGTH/INTERNSETLENGTH defines
git-svn-id: trunk@257 -
2005-06-07 21:07:21 +00:00
michael
21425e303c + Removed HASVARIANT define
git-svn-id: trunk@244 -
2005-06-07 20:48:31 +00:00