[fpc-pascal] Problems with FP-IDE with xterm
Hi, I've just started using fpc and I noticed that xterm does not show the IDE very well. I'm using xterm X.Org 6.8.99.903(236) and fpc 2.2.2 Here are 2 examples http://xoomer.alice.it/enodetti/log/fp1.png http://xoomer.alice.it/enodetti/log/fp2.png I can see that all non standard ASCII character are missing (e.g. stressed vowel). Other times the windows appear diagonal (like the length of the line was wrong). Should I use some flags, a different character set or a different X terminal? I've tried fp -F and it does not change much. I've read the man page, but I did not understand much. Andrea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Debugger support for FP (issues with libgdb.a)
Hi, I've tried to use the debugger in FP 2.2.2 and I got this error "No debugger support available" The I read online and found that I need to get libgdb.a from a build of gdb and copy it in fpc. I've done that and copied to /fpcsrc/libgdb/linux/libgdb.a Now I get this linker error (+ many more similar) make[3]: Entering directory `/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/ide' /home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/compiler/ppc386 -di386 -Fl/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux -Ur -Xs -O2 -n -Sg -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/rtl/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/fv/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/gdbint/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/regexpr/units/i386-linux -FE. -FUunits/i386-linux -Fl/usr/lib/gcc/i386-redhat-linux/4.3.0 -Flinclude -Flld.so.conf.d/*.conf -k"--build-id -z noexecstack" -gl -dRELEASE fp.pas /home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux/libgdb.a(exec.o): In function `generic_skip_trampoline_code': /home/andrea/rpmbuild/BUILD/gdb-6.8/build-i386-redhat-linux-gnu/gdb/../../gdb/arch-utils.c:58: multiple definition of `generic_skip_trampoline_code' /home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux/libgdb.a(arch-utils.o):/home/andrea/rpmbuild/BUILD/gdb-6.8/build-i386-redhat-linux-gnu/gdb/../../gdb/arch-utils.c:58: first defined here Have I done it correctly? I was wondering if there is a documentation about that. Andrea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problems with FP-IDE with xterm
Marco van de Voort wrote: > In our previous episode, Andrea said: > >> I can see that all non standard ASCII character are missing (e.g. stressed >> vowel). Other times the windows appear diagonal (like the length of the >> line was wrong). > > Sounds like ascii output is interpreted as something else (UTF perhaps?) > >> Should I use some flags, a different character set or a different X >> terminal? > >> I've tried fp -F and it does not change much. >> I've read the man page, but I did not understand much. > > There is some doc here: > > http://wiki.freepascal.org/Terminal_%26_Fonts > I've tried to add VGA font as explained for Mac OS X The font has definitely changed, but it is actually worse. http://xoomer.alice.it/enodetti/log/fp3.png Andrea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Debugger support for FP (issues with libgdb.a)
Joost van der Sluis wrote: > Op zondag 21-12-2008 om 17:29 uur [tijdzone +], schreef Andrea: > >> I've tried to use the debugger in FP 2.2.2 and I got this error > >> "No debugger support available" > > I see below that you used the Fedora/RHEL fpc-rpm's? Yes. I amended the spec to copy the lib. > >> The I read online and found that I need to get libgdb.a from a build of gdb >> and copy it in fpc. >> I've done that and copied to >> >> /fpcsrc/libgdb/linux/libgdb.a > > I don't know if this helps, but you do not only need libgdb.a, but also > some other files. You can download them here: > ftp://ftp.freepascal.org/fpc/contrib/libgdb/v6.2.1 > > Further you have to make sure that there are no other copies of those > files somewhere on your system so that the linker may find them. I could not find my version of GDB there. I will take note of which libraries were used and replicate them. And I think you are right, I will first start with the easy compilation procedure and later extend it to rpmbuild. > > You tried to re-build the rpm, there's no documentation about that. > Maybe it's easier to build then ide manually. Extract the source, copy > the libgdb-files, go to the ide directory and do a 'make clean all' > > But the rpm-approach should also work. Thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Debugger support for FP (issues with libgdb.a)
Joost van der Sluis wrote: > Op zondag 21-12-2008 om 17:29 uur [tijdzone +], schreef Andrea: > > You tried to re-build the rpm, there's no documentation about that. > Maybe it's easier to build then ide manually. Extract the source, copy > the libgdb-files, go to the ide directory and do a 'make clean all' > > But the rpm-approach should also work. Apparently it cannot work due to some incompatibility with gdb-6.8 http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=12636 will try again in the future. Andrea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Debugger support for FP (issues with libgdb.a)
Joost van der Sluis wrote: > Op maandag 22-12-2008 om 23:17 uur [tijdzone +], schreef Andrea: >> Joost van der Sluis wrote: >>> Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: >>> >> Apparently it cannot work due to some incompatibility with gdb-6.8 > > There is a reason I said that the linker may not find the wrong libgdb.a > files. > >> http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=12636 >> >> will try again in the future. > > Or download the right libgdb-version from the link I gave you, place it > in the right directory, remove any other libgdb.a etc. files and try > again. > > Thereafter it will work with your newer version of gdb. > > Or did you do this and did it still not work? My gdb is version 6.8, on your link I can only find 6.2.1 Will that be a problem when it runs? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Debugger support for FP (issues with libgdb.a)
Jonas Maebe wrote: > > On 04 Jan 2009, at 16:51, Andrea wrote: > >> My gdb is version 6.8, on your link I can only find 6.2.1 >> Will that be a problem when it runs? > > No: libgdb.a basically contains a complete gdb implementation in that > library, and the IDE will use that. It's not an interface to your > system-installed gdb > Now I understand. > Maybe: that older gdb (6.2.1) may not fully support your system. > will try and let you know Andrea ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Debugger support for FP (issues with libgdb.a)
Jonas Maebe wrote: > > On 04 Jan 2009, at 16:51, Andrea wrote: > >> My gdb is version 6.8, on your link I can only find 6.2.1 >> Will that be a problem when it runs? > > No: libgdb.a basically contains a complete gdb implementation in that > library, and the IDE will use that. It's not an interface to your > system-installed gdb > > Maybe: that older gdb (6.2.1) may not fully support your system. > Ok, I have finally built fpc with gdb support as suggested by you. Now, whenever I try to use the debugger (e.g. F8) fp crashes "Program generated a signal 11. Save your sources and restart the IDE" and "The IDE generated an internal error and will now be closed" Do you have any more ideas? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] splitting string into array
I used this, check it. // Returns an array with the parts of "str" separated by "separator" function Split(const str: string; const separator: string): array of string; var i, n: integer; strline, strfield: string; begin n:= Occurs(str, separator); SetLength(Result, n + 1); i := 0; strline:= str; repeat if Pos(separator, strline) > 0 then begin strfield:= Copy(strline, 1, Pos(separator, strline) - 1); strline:= Copy(strline, Pos(separator, strline) + 1, Length(strline) - pos(separator,strline)); end else begin strfield:= strline; strline:= ''; end; Result[i]:= strfield; Inc(i); until strline= ''; if Result[High(Result)] = '' then SetLength(Result, Length(Result) -1); end; andrea Wolfram Kläger ha scritto: Here is a Delphi implementation of the common PHP function 'explode'. http://www.michael-puff.de/Developer/Delphi/Code-Snippets/Explode.html Your example then becomes to .. A := Explode('-', 'ab-cd-ef'); writeln(A[1]); // expect 'cd' .. The inverse is accomplished by using PHP like 'implode', which glues all splitted parts back to a single string. Wolfram -Ursprüngliche Nachricht- Von: FPC-Pascal users discussions Gesendet: 10.07.07 13:04:31 An: FPC-Pascal users discussions Betreff: [fpc-pascal] splitting string into array Hi, is there any function in the libraries of fpc for splitting a string into an array naming the separator? In awk for eample if you do this: split("ab-cd-ef", x, "-") print x[2] it would split up the first string using "-" as separator and print cd to the output. That's what I'm searching for. In pascal. ;) TIA, Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] splitting string into array
occurs is: function Occurs(const str, separator: string): integer; var i, nSep: integer; begin nSep:= 0; for i:= 1 to Length(str) do if str[i] = separator then Inc(nSep); Result:= nSep; end; Andrea Mauri ha scritto: I used this, check it. // Returns an array with the parts of "str" separated by "separator" function Split(const str: string; const separator: string): array of string; var i, n: integer; strline, strfield: string; begin n:= Occurs(str, separator); SetLength(Result, n + 1); i := 0; strline:= str; repeat if Pos(separator, strline) > 0 then begin strfield:= Copy(strline, 1, Pos(separator, strline) - 1); strline:= Copy(strline, Pos(separator, strline) + 1, Length(strline) - pos(separator,strline)); end else begin strfield:= strline; strline:= ''; end; Result[i]:= strfield; Inc(i); until strline= ''; if Result[High(Result)] = '' then SetLength(Result, Length(Result) -1); end; andrea Wolfram Kläger ha scritto: Here is a Delphi implementation of the common PHP function 'explode'. http://www.michael-puff.de/Developer/Delphi/Code-Snippets/Explode.html Your example then becomes to .. A := Explode('-', 'ab-cd-ef'); writeln(A[1]); // expect 'cd' .. The inverse is accomplished by using PHP like 'implode', which glues all splitted parts back to a single string. Wolfram -Ursprüngliche Nachricht- Von: FPC-Pascal users discussions Gesendet: 10.07.07 13:04:31 An: FPC-Pascal users discussions Betreff: [fpc-pascal] splitting string into array Hi, is there any function in the libraries of fpc for splitting a string into an array naming the separator? In awk for eample if you do this: split("ab-cd-ef", x, "-") print x[2] it would split up the first string using "-" as separator and print cd to the output. That's what I'm searching for. In pascal. ;) TIA, Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ? (GMP)
But someone tried to reproduce the example with other programming languages? mm ha scritto: Tom Verhoeff a écrit : In fact, the GMP (GNU Multiple Precision Arithmetic Library ) offers this and more. Unfortunately, there does not seem to be a complete FreePascal interface for it. Maybe it is easy to adapt (if necessary?) the GNU Pascal interface for GMP <http://www.gnu-pascal.de/gpc/GMP.html>. I would be interested. But there are multi-precision libraries for Free Pascal. The one I am writing: "NX" (big integers, big reals, big complexes, big polynomials over GF(2)) at http://www.ellipsa.net/ An other one: "MPINT" (big integers, big rationals) at http://home.netsurf.de/wolfgang.ehrhardt/misc_en.html#mpint And there are others. mm ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Andrea Mauri PhD student - Chemical Sciences Milano Chemometrics and QSAR Research Group Department of Environmental Sciences University of Milano-Bicocca P.zza della Scienza, 1 20126 Milano - Italy Tel: ++39 02 64482801 mailto:[EMAIL PROTECTED] http://www.disat.unimib.it/chm/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal]nCrt Window resize problem
Hi, I'm porting an old DOS program to Linux as a console app. So far I'm using the nCrt replacement, because it allows me to determine the terminal size at startup and so I can adjust the output correspondingly, which works fine. What I'd like to do is somehow disallow the resize of that terminal window. Is that possible at all? The only possibility I could think of so far is to handle the SIGWINCH signal and 'redraw' the window, but that would require a major rewrite, so I want to consider other possibilities first. I'd appreciate any help as to how this can be done. -- Andrea ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal