Re: [fpc-pascal] Building FPC with gdb support for SPARC
Mark Morgan Lloyd wrote: > The build worked and I appear to have an intact fpc and fp. However fp's > disassembly window is very fragile- SEGV at the drop of a hat. > > I find I can't transfer the compiled bundle to another machine- I get "fp: > /lib/libc.so.6: version `GLIBC_2.3' not found (required by fp)" which I > presume > is telling me that it can't find the library version it was built against. > I'm > going to drop that as an experiment since that machine is too ponderous to > build > the compiler in less than a day, and upgrading anything on it isn't > feasible. I guess that you could still use the cross-compilation trick - bring the library from the target machine to your build machine and change the search paths (probably manually - using "-s" option and playing with the generated script.res before running the created ppas.sh) before linking. Some more tips (just ideas): Only IDE (fp) should be using libc (assuming we talk about Linux target), so only building that one on the target machine (make all in the IDE directory) should reduce the building time. Finally, it might be possible to build everything on the build machine (again use -s option when building, remove all "rm" commands from the generated ppas.sh before running it and possibly skip the linker too), transfer everything to target machine and relink there. > Going back to the SEGV problem, is there any way that somebody with my > minimal > experience can tackle this? Possibly. You might try it with debug info (and line info) enabled binary to get backtrace. That might possibly help to shed some light on what's happening there at least; of course it doesn't automatically mean that it gets resolved, but there's a chance. Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Building FPC with gdb support for SPARC
Mark Morgan Lloyd wrote: The build worked and I appear to have an intact fpc and fp. However fp's disassembly window is very fragile- SEGV at the drop of a hat. I find I can't transfer the compiled bundle to another machine- I get "fp: /lib/libc.so.6: version `GLIBC_2.3' not found (required by fp)" which I presume is telling me that it can't find the library version it was built against. Usual unix library mess. Transfering binaries from one machine to another is often a problem. I'm going to drop that as an experiment since that machine is too ponderous to build the compiler in less than a day, and upgrading anything on it isn't feasible. Going back to the SEGV problem, is there any way that somebody with my minimal experience can tackle this? Compile the IDE with GDB support (make clean all OPT=-g) run it inside GDB and post the stack trace: gdb ./fp r where ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Building FPC with gdb support for SPARC
Tomas Hajny wrote: > I guess that you could still use the cross-compilation trick - bring the > library from the target machine to your build machine and change the > search paths (probably manually - using "-s" option and playing with the > generated script.res before running the created ppas.sh) before linking. > > Some more tips (just ideas): Only IDE (fp) should be using libc (assuming > we talk about Linux target), so only building that one on the target > machine (make all in the IDE directory) should reduce the building time. > Finally, it might be possible to build everything on the build machine > (again use -s option when building, remove all "rm" commands from the > generated ppas.sh before running it and possibly skip the linker too), > transfer everything to target machine and relink there. I'm going to drop working on the larger machine for the moment, I've just checked and a basic "Hello World" works on it which is obviously a good starting point. I will need to use it if I get as far as testing against Solaris 8 (I hope to have Solaris 10 running on newer hardware, but am still trying to fit in time to go collect it). I mean let's face it- what relevance is something with 8x 50MHz CPUs these days? :-) > > Going back to the SEGV problem, is there any way that somebody with my > > minimal > > experience can tackle this? > > Possibly. You might try it with debug info (and line info) enabled binary > to get backtrace. That might possibly help to shed some light on what's > happening there at least; of course it doesn't automatically mean that it > gets resolved, but there's a chance. OK, that looks pretty good but any suggestions as to how I get the compiler options in? Can I give make a -D, or do I need to break into the make process in some way I don't yet understand, and how can I check that the generated binary is in the intended state once it's built? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Building FPC with gdb support for SPARC
Florian Klaempfl wrote: > Compile the IDE with GDB support (make clean all OPT=-g) run it inside GDB and > post the stack trace: > > gdb ./fp > r > where Ah- OK, I think I get that. Back in a few hours... :-) -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] for n:=0 to
I have a program like below, and if the control variable (nr) is defined as a byte/word it fails (the count goes from 1..14) But if I use an Integer as control variable it works. Is this an error in the compiler? If I use the Windows compiler (fpc) it works. Carsten Free Pascal Compiler version 2.0.2 [2006/02/28] for arm Copyright (c) 1993-2005 by Florian Klaempfl Target OS: Linux for ARM - Function I2CLaesRecord(recNr:word16;Var dat:ByteArray16_typ):Boolean; Var ChipNr,nr:Byte; adr:word16; Label 1; Begin For nr:=0 to 14 do dat[nr]:=I2C_LaesByte(True); ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Building FPC with gdb support for SPARC
Florian Klaempfl wrote: > Compile the IDE with GDB support (make clean all OPT=-g) run it inside GDB and > post the stack trace: > > gdb ./fp > r > where OK, I think it's reproducible. Simple program, to build and step, open disassembly window, close and SEGV. First few lines of output, slightly truncated (can I redirect this without messing up the IDE?). Program received signal SIGSEGV, Segmentation fault. 0x000322d4 in TRY_CONCAT_FREE_CHUNK (MC=0x502b3880) at heap.inc:679 679 heap.inc: No such file or directory. in heap.inc (gdb) where #0 0x000322d4 in TRY_CONCAT_FREE_CHUNK (MC=0x502b3880) at heap.inc:679 #1 0x00033114 in SYSFREEMEM_VAR (PCURR=0x502b3880) at heap.inc:1023 #2 0x000331c8 in SYSFREEMEM (P=0x502b3888) at heap.inc:1043 #3 0x0003134c in FREEMEM (P=0x502b3888) at heap.inc:325 #4 0x00015a54 in fpc_help_destructor (_SELF=0x502b3888, _VMT=0x538b8c, VMT_POS=0) at generic.inc:419 #5 0x000a6c00 in TLINE__DONE (vmt=0x538b8c, this={ = { = {_vptr$ = {0x505fd320, 0x0}}, }, TEXT = 0x0, DEFAULTEDITORINFO = 0x0, EDITORINFOS = 0x0, FLAGS = 0, OWNER = 0x502c2d48}) at wcedit.pas:366 #6 0x0004f628 in TCOLLECTION__FREEITEM (ITEM=0x502b3888, this={ = {_vptr$ = {0x55015c, 0x505fbb38}}, ITEMS = 0x505fbb38, COUNT = 50, LIMIT = 500, DELTA = 1000}) at objects.pp:2018 #7 0x0004f498 in TCOLLECTION__FREEALL (this={ = {_vptr$ = {0x55015c, 0x505fbb38}}, ITEMS = 0x505fbb38, COUNT = 50, LIMIT = 500, DELTA = 1000}) at objects.pp:1963 #8 0x0004ef38 in TCOLLECTION__DONE (vmt=0x55015c, this={ = {_vptr$ = {0x55015c, 0x505fbb38}}, ITEMS = 0x505fbb38, COUNT = 50, LIMIT = 500, DELTA = 1000}) at objects.pp:1862 #9 0x000a84f8 in TCODEEDITORCORE__DONE (vmt=0x538bbc, this= { = { = {_vptr$ = {0x538bbc, 0x0}}, BINDINGS = 0x0, LOCKFLAG = 0, CHANGEDLINE = 0, CONTENTSCHANGEDCALLED = false, LIMITSCHANGEDCALLED = false, MODIFIEDCHANGEDCALLED = false, TABSIZECHANGEDCALLED = false, STOREUNDOCHANGEDCALLED = false, LASTSYNTAXEDLINE = 49, SY2 #10 0x000abe1c in TCODEEDITOR__DONE (vmt=0x0, this={ = { = { = { = {_vptr$ = {0x55018c, 0xc20}}, GROWMODE = 12, DRAGMODE = 32, TABMASK = 0, COLOUROFS = 0, HELPCTX = 0, STATE = 2, OPTIONS = 1, EVENTMASK = 785, ORIGIN = {X = 1, Y = 1}, SIZE = {X = 130, Y = 145}, CURSOR = {X = 0, Y = 20}, NEXT = 5 #11 0x000ee250 in TDISASSEMBLYEDITOR__DONE (vmt=0x55018c, this={ ={ = { = { = { = { = { = {_vptr$ = {0x55018c, 0xc20}}, GROWMODE = 12, DRAGMODE = 32, TABMASK = 0, COLOUROFS = 0, HELPCTX = 0, STATE = 2, OPTIONS = 1, EVENTMASK = 785, ORIGIN = {X = 1, Y = 1}, SIZE = 9 -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal