From wsherman at gmail.com Sun Jan 1 02:29:57 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Sat, 31 Dec 2022 17:29:57 -0800 Subject: [Lazarus] Error building Lazarus Trunk Message-ID: System Xubuntu 20.04 64-bit with latest updates lazarus_2_2_4 (latest stable) builds successfully, but I am getting an error trying to build Lazarus trunk. The same error happens with both fpc stable and fpc trunk. Running this: git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git 2022-12-31_lazarus_trunk cd ./2022-12-31_lazarus_trunk make distclean [ok] make lazbuild [ok] make bigide [ok] make useride [fails] ./lazbuild --lazarusdir=. --build-ide= [fails] Build messages: Hint: (lazarus) Missing state file of DebuggerIntf 0.1: /home/wsherman/2022-12-31_lazarus_trunk/components/debuggerintf/lib/x86_64-linux/DebuggerIntf.compiled An unhandled exception occurred at $00000000009B6FB0: EAccessViolation: Access violation $00000000009B6FB0 DOCALLPACKAGEBUILDINGHANDLER, line 774 of lazideintf.pas $00000000005AFCAA COMPILEPACKAGE, line 4265 of ../packager/packagesystem.pas $00000000005AE928 COMPILEREQUIREDPACKAGES, line 3972 of ../packager/packagesystem.pas $000000000040366A COMPILEAUTOINSTALLPACKAGES, line 683 of lazbuild.lpr $00000000004032A9 BUILDLAZARUSIDE, line 621 of lazbuild.lpr $000000000040817F RUN, line 1503 of lazbuild.lpr $000000000040AA09 main, line 1879 of lazbuild.lpr There appears to be two problems: 1) Some state is not as lazbuild expects. 2) lazbuild should not generate an access violation. Can anyone confirm this issue? From lazarus at kluug.net Sun Jan 1 03:08:21 2023 From: lazarus at kluug.net (Ondrej Pokorny) Date: Sun, 1 Jan 2023 03:08:21 +0100 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: References: Message-ID: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> Am 01.01.2023 um 2:29 schrieb Wayne Sherman via lazarus: > System Xubuntu 20.04 64-bit with latest updates > > lazarus_2_2_4 (latest stable) builds successfully, but I am getting an > error trying to build Lazarus trunk. The same error happens with both > fpc stable and fpc trunk. > > Running this: > > git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git > 2022-12-31_lazarus_trunk > cd ./2022-12-31_lazarus_trunk > > make distclean [ok] > make lazbuild [ok] > make bigide [ok] > > make useride [fails] > ./lazbuild --lazarusdir=. --build-ide= [fails] > > Build messages: > Hint: (lazarus) Missing state file of DebuggerIntf 0.1: > /home/wsherman/2022-12-31_lazarus_trunk/components/debuggerintf/lib/x86_64-linux/DebuggerIntf.compiled > An unhandled exception occurred at $00000000009B6FB0: > EAccessViolation: Access violation > $00000000009B6FB0 DOCALLPACKAGEBUILDINGHANDLER, line 774 of lazideintf.pas > $00000000005AFCAA COMPILEPACKAGE, line 4265 of ../packager/packagesystem.pas > $00000000005AE928 COMPILEREQUIREDPACKAGES, line 3972 of > ../packager/packagesystem.pas > $000000000040366A COMPILEAUTOINSTALLPACKAGES, line 683 of lazbuild.lpr > $00000000004032A9 BUILDLAZARUSIDE, line 621 of lazbuild.lpr > $000000000040817F RUN, line 1503 of lazbuild.lpr > $000000000040AA09 main, line 1879 of lazbuild.lpr > > There appears to be two problems: > 1) Some state is not as lazbuild expects. > 2) lazbuild should not generate an access violation. > > Can anyone confirm this issue? Please update and retest. It should be fixed. Ondrej From wsherman at gmail.com Sun Jan 1 03:48:26 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Sat, 31 Dec 2022 18:48:26 -0800 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> References: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> Message-ID: > Ondrej Pokorny wrote: > Please update and retest. It should be fixed. Sorry, getting the same error: cd ~/2022-12-31_lazarus_trunk git fetch origin git reset --hard origin/main git log --name-status HEAD^..HEAD commit 09845999ff4ee6424b4cee11c589d7cfcbe45857 (HEAD -> main, origin/main, origin/HEAD) Author: Ondrej Pokorny Date: Sun Jan 1 03:06:58 2023 +0100 fix AV M components/ideintf/lazideintf.pas make distclean [ok] make lazbuild [ok] make bigide [ok] ./lazbuild --lazarusdir=. --build-ide= Hint: (lazarus) Compiler unit paths changed for DebuggerIntf 0.1 Old="/home/wsherman/2022-12-31_lazarus_trunk/packager/units/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/lazdebuggers/lazdebuggerintf/lib/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/lazutils/lib/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/freetype/lib/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/lcl/units/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/debuggerintf" Now="/home/wsherman/2022-12-31_lazarus_trunk/packager/units/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/lazdebuggers/lazdebuggerintf/lib/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/lazutils/lib/x86_64-linux;/home/wsherman/2022-12-31_lazarus_trunk/components/debuggerintf" State file="/home/wsherman/2022-12-31_lazarus_trunk/components/debuggerintf/lib/x86_64-linux/DebuggerIntf.compiled" An unhandled exception occurred at $00000000009B6FB0: EAccessViolation: Access violation $00000000009B6FB0 DOCALLPACKAGEBUILDINGHANDLER, line 774 of lazideintf.pas $00000000005AFCAA COMPILEPACKAGE, line 4265 of ../packager/packagesystem.pas $00000000005AE928 COMPILEREQUIREDPACKAGES, line 3972 of ../packager/packagesystem.pas $000000000040366A COMPILEAUTOINSTALLPACKAGES, line 683 of lazbuild.lpr $00000000004032A9 BUILDLAZARUSIDE, line 621 of lazbuild.lpr $000000000040817F RUN, line 1503 of lazbuild.lpr $000000000040AA09 main, line 1879 of lazbuild.lpr make useride ./lazbuild --lazarusdir=. --build-ide= Hint: (lazarus) Missing state file of DebuggerIntf 0.1: /home/wsherman/2022-12-31_lazarus_trunk/components/debuggerintf/lib/x86_64-linux/DebuggerIntf.compiled An unhandled exception occurred at $00000000009B6FB0: EAccessViolation: Access violation $00000000009B6FB0 DOCALLPACKAGEBUILDINGHANDLER, line 774 of lazideintf.pas $00000000005AFCAA COMPILEPACKAGE, line 4265 of ../packager/packagesystem.pas $00000000005AE928 COMPILEREQUIREDPACKAGES, line 3972 of ../packager/packagesystem.pas $000000000040366A COMPILEAUTOINSTALLPACKAGES, line 683 of lazbuild.lpr $00000000004032A9 BUILDLAZARUSIDE, line 621 of lazbuild.lpr $000000000040817F RUN, line 1503 of lazbuild.lpr $000000000040AA09 main, line 1879 of lazbuild.lpr make: *** [Makefile:3804: useride] Error 217 From wsherman at gmail.com Sun Jan 1 05:10:49 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Sat, 31 Dec 2022 20:10:49 -0800 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: References: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> Message-ID: > wayne wrote: > Sorry, getting the same error: Using git bisect, it seems the failure started happening with this commit: https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/ba918c5eb21b04bc00b7bb12909360f40ee738d4 #start a bisect procedure git bisect start git bisect bad 2fb475adfb2d124b8b3f6072bb924988150bf2af (* Instantsearch package) git bisect good eb59ad598f624f10b273c65630f021d5a9e3cf8c (JCF: regenerated translations and updated Russian translation) #repeat these steps make lazbuild make useride git bisect bad (if make useride runs correctly) git bisect good (if make useride fails) - iterate until we get this - Bisecting: 0 revisions left to test after this (roughly 0 steps) [ba918c5eb21b04bc00b7bb12909360f40ee738d4] TLazIDEInterface: add OnPackageBuilding handler From wsherman at gmail.com Sun Jan 1 05:19:57 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Sat, 31 Dec 2022 20:19:57 -0800 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: References: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> Message-ID: > Bisecting: 0 revisions left to test after this (roughly 0 steps) > [ba918c5eb21b04bc00b7bb12909360f40ee738d4] TLazIDEInterface: add > OnPackageBuilding handler Sorry, I did not actually test that last selected commit. After doing one more iteration it did turn out to be that commit: ba918c5eb21b04bc00b7bb12909360f40ee738d4 is the first bad commit commit ba918c5eb21b04bc00b7bb12909360f40ee738d4 Author: Ondrej Pokorny Date: Fri Dec 30 22:43:17 2022 +0100 TLazIDEInterface: add OnPackageBuilding handler components/ideintf/lazideintf.pas | 41 ++++++++++++++++++++++++++++++++++++++- packager/packagesystem.pas | 4 ++++ 2 files changed, 44 insertions(+), 1 deletion(-) From lazarus at kluug.net Sun Jan 1 10:51:46 2023 From: lazarus at kluug.net (Ondrej Pokorny) Date: Sun, 1 Jan 2023 10:51:46 +0100 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: References: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> Message-ID: <6537c675-be57-3347-a1f1-4485fb8752c4@kluug.net> Am 01.01.2023 um 3:48 schrieb Wayne Sherman: >> Ondrej Pokorny wrote: >> Please update and retest. It should be fixed. > Sorry, getting the same error: Ok , 2nd attempt :) https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/71ac105bc728824b849c027a016ad572226002c1 Ondrej From wsherman at gmail.com Sun Jan 1 16:15:41 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Sun, 1 Jan 2023 07:15:41 -0800 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: <6537c675-be57-3347-a1f1-4485fb8752c4@kluug.net> References: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> <6537c675-be57-3347-a1f1-4485fb8752c4@kluug.net> Message-ID: On Sun, Jan 1, 2023 at 1:51 AM Ondrej Pokorny wrote: > Ok , 2nd attempt :) > https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/71ac105bc728824b849c027a016ad572226002c1 Yes, that fixed it. Thank you. The build problem was not caught by any of the CI/CD jobs that ran. To catch failures with lazbuild, should a test be added to CI/CD jobs to build the Lazarus IDE with it? From nc-gaertnma at netcologne.de Sun Jan 1 17:20:11 2023 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 1 Jan 2023 17:20:11 +0100 Subject: [Lazarus] Error building Lazarus Trunk In-Reply-To: References: <94d886d0-9062-ae8e-e8ed-559bbe700f0a@kluug.net> <6537c675-be57-3347-a1f1-4485fb8752c4@kluug.net> Message-ID: <20230101172011.3474a45f@limapholos> On Sun, 1 Jan 2023 07:15:41 -0800 Wayne Sherman via lazarus wrote: > On Sun, Jan 1, 2023 at 1:51 AM Ondrej Pokorny wrote: > > Ok , 2nd attempt :) > > https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/71ac105bc728824b849c027a016ad572226002c1 > > > > Yes, that fixed it. Thank you. > > The build problem was not caught by any of the CI/CD jobs that ran. > To catch failures with lazbuild, should a test be added to CI/CD jobs > to build the Lazarus IDE with it? Yes, please. Mattias From markbass72 at zoho.com Thu Jan 5 09:58:21 2023 From: markbass72 at zoho.com (Marcello) Date: Thu, 5 Jan 2023 09:58:21 +0100 Subject: [Lazarus] Instantsearch package In-Reply-To: References: Message-ID: <810c89f5-678d-c396-1818-1ab866e3a707@zoho.com> Hi, I installed the InstantSearch package, really useful, thanks! Search works and is impressive :) While double clicking on fpc/lazarus sources the link works correctly, same action on my project sources fails with this message Source tree 6A01AF16-603C-4AF5-9193-8CB97726549B not found. Please refresh search results. Any idea to help me fix? Thanks nomorelogic Il 31/12/22 19:07, Michael Van Canneyt via lazarus ha scritto: > > Hello, > > As a late Christmas gift (and after some deliberation with Mattias > Gaertner > who provided many helpful remarks), I've added a package to the > lazarus IDE: InstantSearch. > > It provides as-you-type search possibilities, which is much faster > than the > current find-in-files. > > For it to work, it needs to index sources. The sources are organized in > source trees, and you can define as much "source trees" as you wish. > The RTL, FCL, compiler and LCL are added by default. > > Projects can be marked as 'indexable' and the current project can be > indexed & searched as well. > > Conceivably, other sources of info can be indexed: WIKI, Help, etc... > > It currently uses "Manticore Search" as a backend (because it has a > simple > install and interface), but other engines can be added if so desired. > > More help can be found here: > https://wiki.freepascal.org/Lazarus_InstantSearch > > Should you experience problems, don't hesitate to reach out. > > Enjoy ! > > Michael. From michael at freepascal.org Thu Jan 5 12:50:16 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 5 Jan 2023 12:50:16 +0100 (CET) Subject: [Lazarus] Instantsearch package In-Reply-To: <810c89f5-678d-c396-1818-1ab866e3a707@zoho.com> References: <810c89f5-678d-c396-1818-1ab866e3a707@zoho.com> Message-ID: On Thu, 5 Jan 2023, Marcello via lazarus wrote: > Hi, I installed the InstantSearch package, really useful, thanks! > > Search works and is impressive :) > > While double clicking on fpc/lazarus sources the link works correctly, same > action on my project sources fails with this message > > Source tree 6A01AF16-603C-4AF5-9193-8CB97726549B not found. > Please refresh search results. > > Any idea to help me fix? I looked at it, it should hopefully be fixed. If not, please give me steps to reproduce... Michael. From andrewd207 at aol.com Thu Jan 5 23:59:05 2023 From: andrewd207 at aol.com (Andrew Haines) Date: Thu, 5 Jan 2023 17:59:05 -0500 Subject: [Lazarus] SynEdit highlighter for Markdown References: <724b3c7b-125d-3303-4631-9ff48c68629e.ref@aol.com> Message-ID: <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> Hi, I attached a highlighter I made for Markdown. I like to use this in my projects to plan things. It seems to work fine with any attribute that only requires a single line. I tried and failed to make multiline fenced code work. I'm sure there is just something I wasn't understanding. ``` multiline code block ``` Indenting works though. If anyone has some clues I'd love to know what I did wrong :) Regards, Andrew Haines -------------- next part -------------- A non-text attachment was scrubbed... Name: synhighlightermarkdown.pas Type: text/x-pascal Size: 24726 bytes Desc: not available URL: From lazarus at mfriebe.de Fri Jan 6 00:23:07 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 6 Jan 2023 00:23:07 +0100 Subject: [Lazarus] SynEdit highlighter for Markdown In-Reply-To: <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> References: <724b3c7b-125d-3303-4631-9ff48c68629e.ref@aol.com> <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> Message-ID: Without yet having looked at it (currently got a bit of an incoming queue)... But there is a tutorial on how HL work: https://wiki.freepascal.org/SynEdit_Highlighter On 05/01/2023 23:59, Andrew Haines via lazarus wrote: > Hi, I attached a highlighter I made for Markdown. I like to use this > in my projects to plan things. > > It seems to work fine with any attribute that only requires a single > line. I tried and failed to make multiline fenced code work. I'm sure > there is just something I wasn't understanding. > > ``` > > multiline > > code > > block > > ``` > > > Indenting works though. > > > If anyone has some clues I'd love to know what I did wrong :) > > > Regards, > > Andrew Haines > From michael at freepascal.org Fri Jan 6 09:26:01 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Fri, 6 Jan 2023 09:26:01 +0100 (CET) Subject: [Lazarus] SynEdit highlighter for Markdown In-Reply-To: <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> References: <724b3c7b-125d-3303-4631-9ff48c68629e.ref@aol.com> <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> Message-ID: On Thu, 5 Jan 2023, Andrew Haines via lazarus wrote: > Hi, I attached a highlighter I made for Markdown. I like to use this in my > projects to plan things. > > It seems to work fine with any attribute that only requires a single line. I > tried and failed to make multiline fenced code work. I'm sure there is just > something I wasn't understanding. > > ``` > > multiline > > code > > block > > ``` > > > Indenting works though. Nice start, I will add it to my IDE, awaiting the 'official' addition to lazarus :-) Given the many dialects in markdown (specially for multiline/continuation things), it'll be interesting to see how it reacts on them :) Michael. From andrewd207 at aol.com Fri Jan 6 15:36:35 2023 From: andrewd207 at aol.com (Andrew Haines) Date: Fri, 6 Jan 2023 09:36:35 -0500 Subject: [Lazarus] SynEdit highlighter for Markdown In-Reply-To: References: <724b3c7b-125d-3303-4631-9ff48c68629e.ref@aol.com> <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> Message-ID: <32f52521-d74f-6c2d-1ffe-7219fd39a00e@aol.com> On 1/5/23 6:23 PM, Martin Frb via lazarus wrote: > Without yet having looked at it (currently got a bit of an incoming > queue)... > > But there is a tutorial on how HL work: > https://wiki.freepascal.org/SynEdit_Highlighter > > After some careful examination(I had already seen that page) I found the problem was in GetRange I was calling inherited at the start instead of at the end. Always little things :) Thanks for the hint. I'm hoping to include this in Lazarus if anyone is interested. I've got some further improvements I'm working on. Thanks Andrew Haines From michael at freepascal.org Fri Jan 6 18:05:43 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Fri, 6 Jan 2023 18:05:43 +0100 (CET) Subject: [Lazarus] Unicode RTL for FPC Message-ID: Hello, I'm currently working for a company (Tixeo.com) that is preparing to use FPC to recompile their flagship product (written in Delphi) for certain targets. As part of this work, we're striving to make the Free Pascal RTL and Packages more compatible with recent Delphis. That means: - String = UnicodeString, Char=WideChar - Dotted units. Before you all get a heart attack: Because backwards compatibility is important, FPC will of course continue to distribute a backwards-compatible RTL and packages, with single-byte string. All FPC modes will continue to function. To make this possible a feature called 'subtargets' has been implemented. This can be used for other things than the unicode RTL, but will be used for the unicode RTL. The RTL is compiled 'normally' and with subtarget=unicodertl; this will result in 2 separate sets of .o/.ppu files: The normal CPU-OS directory and a CPU-OS-unicodertl directory. The first part of the work has been pushed to gitlab in a branch called unicodertl (NOT the svn/unicodertl branch): - subtarget support is there - The rtl compiles with make SUB_TARGET=unicodertl with the compiler as it is in that branch. Needless to say, this is a major change that will need thorough testing. The earlier testing starts, the better. For those that wish to help in testing: - Update your git clone - switch to branch unicodertl. - in the toplevel FPC directory, do a make all - if that went well, next to your fpc.cfg, create a file fpc-unicodertl.cfg with the following contents: ---- -dUNICODERTL -Municodestrings ---- - to create a Unicode RTL, in the rtl directory do a make clean all SUB_TARGET=unicodertl PP=path/to/the/new/compiler - if that worked, you can try then a make install SUB_TARGET=unicodertl Note that this is NOT ready for production use: - The packages have not yet been converted (working on this now) and will certainly fail... - a private testsuite has been run and gives no failures, but the complete compiler testsuite still needs to be examined. - Dotted names will be created after the unicode transition is deemed complete. if you do wish to test and spot errors in the RTL or compiler, please file a bugreport. You can use a tag 'UnicodeRTL' to report bugs for this. Michael. From andrewd207 at aol.com Sat Jan 7 18:19:59 2023 From: andrewd207 at aol.com (Andrew Haines) Date: Sat, 7 Jan 2023 12:19:59 -0500 Subject: [Lazarus] SynEdit highlighter for Markdown In-Reply-To: <32f52521-d74f-6c2d-1ffe-7219fd39a00e@aol.com> References: <724b3c7b-125d-3303-4631-9ff48c68629e.ref@aol.com> <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> <32f52521-d74f-6c2d-1ffe-7219fd39a00e@aol.com> Message-ID: <249e96ef-ca30-beb4-b5a9-327b1778a723@aol.com> On 1/6/23 9:36 AM, Andrew Haines via lazarus wrote: > > On 1/5/23 6:23 PM, Martin Frb via lazarus wrote: >> Without yet having looked at it (currently got a bit of an incoming >> queue)... >> >> But there is a tutorial on how HL work: >> https://wiki.freepascal.org/SynEdit_Highlighter >> >> > > After some careful examination(I had already seen that page) I found > the problem was in GetRange I was calling inherited at the start > instead of at the end. Always little things :) Thanks for the hint. > > I'm hoping to include this in Lazarus if anyone is interested. I've > got some further improvements I'm working on. > > I've completed I think the most common markdown features and am installing it in the IDE. I did a search for JScript(another highlighter) to find the places in the IDE to modify. The highlighter loads if I open a *.md file. The default color I assigned in the source seem to be ignore but I was able to set new ones using Settings - Editor - Display? - Colors and selecting Markdown from the top. I attached my changes to lazarus and also the new highlighter unit. -------------- next part -------------- A non-text attachment was scrubbed... Name: markdown.zip Type: application/zip Size: 12020 bytes Desc: not available URL: From octopushole at gmail.com Sat Jan 7 19:17:36 2023 From: octopushole at gmail.com (duilio foschi) Date: Sat, 7 Jan 2023 19:17:36 +0100 Subject: [Lazarus] revamping a very old print Message-ID: I would like to give a new life to a very old application that was written in foxplus (a xbase dialect) in 1990 :) At that time, the display was 80 char per line and the printer was 132 char per line, so data was printed using the logics you will find at the bottom of this message. I wonder if I can still use the old code somehow. My idea is: 1. I get the printer PageWidth in pixel PageWidth:=Printer.PageWidth; 2. I get the printer PageHeight in pixel PageHeight:=Printer.PageHeight; 3. I get the height of a line LineHeight:=Printer.Canvas.TextHeight('M')+5; // I add a few pixels to prevent text lines to overlap; 4. I get the number of rows in a page MaxLinesNo:=PageHeight div LineHeight 5. now lets translate line @7,87 SAY "CITTA' PARTITA IVA" "7" --> translates into yPos:=LineHeight*7 "87" --> translates into xPos:= round (87/132*PageWidth); so I write Printer.Canvas.Textout(XPos, YPos, 'CITTA' PARTITA IVA'); 6. how do I set the size of the font? I am expecting not less than 56 lines in a page, so I shrink the font size until I get LineHeight <=Printer.PageHeight div 60 7. I am surely missing something. Any help? Thank you Peppe SET DEVI TO PRIN EJECT GO TOP TIT=.T. DO WHIL .NOT. EOF() * if current row >=max, jump to the new page and print header IF PROW()>=56 TIT=.T. EJECT ENDI IF TIT * print header @1,2 SAY "_______________________________________________________" @1,57 SAY "_______________________________________________________" @1,112 SAY "____________________" @2,1 SAY "|" @2,132 SAY "|" @3,1 SAY "| "+AZIENDA IF TA="C" @3,58 SAY "LISTATO CLIENTI ALLA DATA ; "+DTOC(DATE()) ELSE @3,58 SAY "LISTATO FORNITORI ALLA DATA ; "+DTOC(DATE()) ENDI @3,132 SAY "|" @4,1 SAY "|" @4,132 SAY "|" @5,1 SAY "|______________________________________________________" @5,56 SAY "_______________________________________________________" @5,111 SAY "_____________________|" @7,2 SAY "CODICE RAGIONE SOCIALE SEDE ; LEG." @7,87 SAY "CITTA' PARTITA IVA" @8,79 TIT=.F. ENDI * end print header @PROW()+1,1 SAY SUBS(COD_CL,1,2)+"."+SUBS(COD_CL,3,2)+"."+SUBS(COD_CL,; 5,5) @PROW(),16 SAY DES_CL @PROW(),48 SAY SEDE_LEG @PROW(),80 SAY CAP_CITTA @PROW(),112 SAY PART_IVA SKIP ENDD @PROW()+1,1 SAY " " SET DEVI TO SCRE RETU From nc-gaertnma at netcologne.de Sat Jan 7 19:28:35 2023 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sat, 7 Jan 2023 19:28:35 +0100 Subject: [Lazarus] revamping a very old print In-Reply-To: References: Message-ID: <20230107192835.7df8162e@limapholos> On Sat, 7 Jan 2023 19:17:36 +0100 duilio foschi via lazarus wrote: >[...] > 6. how do I set the size of the font? As normal: Printer.Canvas.Font.Size:= >[...] Mattias From alb42 at web.de Sun Jan 8 09:49:34 2023 From: alb42 at web.de (Marcus Sackrow) Date: Sun, 8 Jan 2023 09:49:34 +0100 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) Message-ID: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> Hi, make all for at least x86_64-linux does not compile since 319649fb https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/319649fbe62f9eb6798a7d3ffaf976f9f1d31082 the error message: (3104) Compiling ./frames/initialsetupdlgdebuggerframe.pas /var/lib/jenkins/workspace/LCL_off_x86_64-linux/ide/./frames/initialsetupdlgdebuggerframe.pas(11,3) Fatal: (10022) Can't find unit FpLldbDebugger used by InitialSetupDlgDebuggerFrame Fatal: (1018) Compilation aborted make[2]: *** [Makefile:4958: lazarus] Error 1 Full log: https://build.alb42.de:8081/job/LCL_off_x86_64-linux/12240/consoleFull Could please look someone into it? Greetings, Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From octopushole at gmail.com Sun Jan 8 10:13:12 2023 From: octopushole at gmail.com (duilio foschi) Date: Sun, 8 Jan 2023 10:13:12 +0100 Subject: [Lazarus] vanishing main menu wanted Message-ID: these images show what I have now: 1. https://ibb.co/CwKYdvv the main menu is attached to the form (standard behavior) 2. https://ibb.co/wghVxrp when I switch from Tab1 to Tab2, the main menu stays visible These images show what I would like: 3. https://ibb.co/TmDdcRB the menu is attached to Tab1 4. https://ibb.co/ngL5jnt when I switch from Tab1 to Tab2, the menu disappears Which is the best way to get this effect? Maybe a TFlowPanel with a number of TEdit controls inside? Maybe a simple TStringgrid? Any suggestion? Thank you Peppe From lazarus at kluug.net Sun Jan 8 10:18:21 2023 From: lazarus at kluug.net (Ondrej Pokorny) Date: Sun, 8 Jan 2023 10:18:21 +0100 Subject: [Lazarus] vanishing main menu wanted In-Reply-To: References: Message-ID: On 08.01.2023 10:13, duilio foschi via lazarus wrote: > Which is the best way to get this effect? Probably TToolBar. Ondrej From alb42 at web.de Sun Jan 8 18:06:19 2023 From: alb42 at web.de (Marcus Sackrow) Date: Sun, 8 Jan 2023 18:06:19 +0100 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> Message-ID: Am 08.01.23 um 09:49 schrieb Marcus Sackrow via lazarus: > > make all for at least x86_64-linux does not compile since 319649fb > thanks it compiles again Greetings, Marcus From mailinglists at geldenhuys.co.uk Sun Jan 8 20:51:09 2023 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Sun, 8 Jan 2023 19:51:09 +0000 Subject: [Lazarus] SynEdit highlighter for Markdown In-Reply-To: References: <724b3c7b-125d-3303-4631-9ff48c68629e.ref@aol.com> <724b3c7b-125d-3303-4631-9ff48c68629e@aol.com> Message-ID: <30457333-e079-9c54-baf8-aec162f21ed7@geldenhuys.co.uk> On 06/01/2023 8:26 am, Michael Van Canneyt via lazarus wrote: > Given the many dialects in markdown (specially for multiline/continuation things), > it'll be interesting to see how it reacts on them ? Hence I always recommend AsciiDoc over Markdown. ;-) There are many basic documentation concepts that MD simply doesn't support. Just to name a few: * Built-in comment support * Admonition blocks * More control over images * More control over lists * Better table handling * Auto table-of-content generation (not all MD dialects support this) * AsciiDoc is one standard and dialect * AsciiDoc never needs to embed HTML to accomplish something, because the target might not always be HTML. Just my 2? worth. :) Regards, - Graeme - From wsherman at gmail.com Sun Jan 8 23:11:32 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Sun, 8 Jan 2023 14:11:32 -0800 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> Message-ID: > > make all for at least x86_64-linux does not compile since 319649fb > thanks it compiles again About a week ago Lazarus was failing to build with "make useride". Are these two build targets being run as part of the CI / CD tests? From lazarus at mfriebe.de Mon Jan 9 00:12:12 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 9 Jan 2023 00:12:12 +0100 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> Message-ID: On 08/01/2023 23:11, Wayne Sherman via lazarus wrote: >>> make all for at least x86_64-linux does not compile since 319649fb >> thanks it compiles again > About a week ago Lazarus was failing to build with "make useride". > Are these two build targets being run as part of the CI / CD tests? I don't know, it will need to be checked... The CI config is part of the git repo. So it can be checked by anyone. Not sure though if running all make targets is the best idea. IMHO more important to run diff OS/Arch targets and compiler versions. From alb42 at web.de Mon Jan 9 17:50:40 2023 From: alb42 at web.de (Marcus Sackrow) Date: Mon, 9 Jan 2023 17:50:40 +0100 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> Message-ID: Hi, Am 08.01.23 um 23:11 schrieb Wayne Sherman: >>> make all for at least x86_64-linux does not compile since 319649fb >> thanks it compiles again > About a week ago Lazarus was failing to build with "make useride". > Are these two build targets being run as part of the CI / CD tests? these compilations (from this error report) are on m own Jenkins server and atm it does only a "make all" it's mainly focused on catching problems with latest FPC (because it uses always the latest FPC, compiled some minutes before that) and to check if the compilation for Amiga-style systems still work (and with it the MUI widget set) in other jobs Of course if there is interest in more tasks, it can be added, the server still has some resources. Greetings, Marcus From lazarus at mfriebe.de Mon Jan 9 18:01:19 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 9 Jan 2023 18:01:19 +0100 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> Message-ID: <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> On 09/01/2023 17:50, Marcus Sackrow via lazarus wrote: > Hi, > > Am 08.01.23 um 23:11 schrieb Wayne Sherman: >>>> make all for at least x86_64-linux does not compile since 319649fb >>> thanks it compiles again >> About a week ago Lazarus was failing to build with "make useride". >> Are these two build targets being run as part of the CI / CD tests? > > these compilations (from this error report) are on m own Jenkins server > and atm it does only a "make all" > > it's mainly focused on catching problems with latest FPC (because it > uses always the latest FPC, compiled some minutes before that) > > and to check if the compilation for Amiga-style systems still work (and > with it the MUI widget set) in other jobs > > > Of course if there is interest in more tasks, it can be added, the > server still has some resources. It needs to be discussed with other devs as well, what they think... We do still have free minutes at GitLab. But the amount of combinations for testing is (near) infinite. There is "make" (aka "make all" ?) and "make bigide". Afaik "make useride" depends on what packages are configured, so that is not just a single setting? But each of them may fail only for a specific OS/Arch, or for some other specific setting. (like compile time range check error for constant eval, with -Cr enabled). We already have builds for win, gtk2, qt, iirc some with 32bit, and fpc 3.2.2 and trunk. (not all variations though). I personally currently don't have the time to look into it. (I'll ping the others, if anyone wants to pick up) If I should find time eventually, my interest will be much more in adding some of the tests we have to be run. From nc-gaertnma at netcologne.de Mon Jan 9 19:14:16 2023 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Mon, 9 Jan 2023 19:14:16 +0100 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> Message-ID: <20230109191416.58a9c7c7@limapholos> On Mon, 9 Jan 2023 18:01:19 +0100 Martin Frb via lazarus wrote: >[...] > There is "make" (aka "make all" ?) and "make bigide". > Afaik "make useride" depends on what packages are configured, so that > is not just a single setting? Yes. But if you start with an empty config directory "make useride" should be reliable and is a good test for lazbuild. >[...] Mattias From ganmax at narod.ru Tue Jan 10 00:27:54 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Tue, 10 Jan 2023 02:27:54 +0300 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> Message-ID: 09.01.2023 20:01, Martin Frb via lazarus ?????: > On 09/01/2023 17:50, Marcus Sackrow via lazarus wrote: >> Hi, >> >> Am 08.01.23 um 23:11 schrieb Wayne Sherman: >>>>> make all for at least x86_64-linux does not compile since 319649fb >>>> thanks it compiles again >>> About a week ago Lazarus was failing to build with "make useride". >>> Are these two build targets being run as part of the CI / CD tests? >> >> these compilations (from this error report) are on m own Jenkins server >> and atm it does only a "make all" >> >> it's mainly focused on catching problems with latest FPC (because it >> uses always the latest FPC, compiled some minutes before that) >> >> and to check if the compilation for Amiga-style systems still work (and >> with it the MUI widget set) in other jobs >> >> >> Of course if there is interest in more tasks, it can be added, the >> server still has some resources. > > It needs to be discussed with other devs as well, what they think... > > We do still have free minutes at GitLab. But the amount of combinations > for testing is (near) infinite. Yes. > There is "make" (aka "make all" ?) and "make bigide". > Afaik "make useride" depends on what packages are configured, so that is > not just a single setting? > > But each of them may fail only for a specific OS/Arch, or for some other > specific setting. (like compile time range check error for constant > eval, with -Cr enabled). > We already have builds for win, gtk2, qt, iirc some with 32bit, and fpc > 3.2.2 and trunk. (not all variations though). Yes, details are here: https://wiki.freepascal.org/Lazarus_Team_-_Git_Workflows#Continuous_integration_.28CI.29_System There are too much variations and I don't think that it is feasible to define them all. I think that current set of jobs in CI is quite comprehensible, but if there is justified need, yet another job can be added indeed. > I personally currently don't have the time to look into it. > (I'll ping the others, if anyone wants to pick up) > > If I should find time eventually, my interest will be much more in > adding some of the tests we have to be run. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From ganmax at narod.ru Tue Jan 10 00:35:33 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Tue, 10 Jan 2023 02:35:33 +0300 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: <20230109191416.58a9c7c7@limapholos> References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> <20230109191416.58a9c7c7@limapholos> Message-ID: <46b49e2e-06e0-e8a3-dea8-314b8d1fd35b@narod.ru> 09.01.2023 21:14, Mattias Gaertner via lazarus ?????: > On Mon, 9 Jan 2023 18:01:19 +0100 > Martin Frb via lazarus wrote: > >> [...] >> There is "make" (aka "make all" ?) and "make bigide". >> Afaik "make useride" depends on what packages are configured, so that >> is not just a single setting? > > Yes. But if you start with an empty config directory "make useride" > should be reliable and is a good test for lazbuild. It is no problem to add some `make useride` job. In principle, we can even switch e. g. x86_64-win64 job to this (to avoid crowding even more our already huge job list). What do you think? -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From wsherman at gmail.com Tue Jan 10 01:37:50 2023 From: wsherman at gmail.com (Wayne Sherman) Date: Mon, 9 Jan 2023 16:37:50 -0800 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: <46b49e2e-06e0-e8a3-dea8-314b8d1fd35b@narod.ru> References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> <20230109191416.58a9c7c7@limapholos> <46b49e2e-06e0-e8a3-dea8-314b8d1fd35b@narod.ru> Message-ID: On Sun, Jan 8, 2023 Marcus Sackrow wrote: > make all for at least x86_64-linux does not compile since 319649fb On Mon, Jan 9, 2023 Martin Frb wrote: > There is "make" (aka "make all" ?) and "make bigide". If there is an automatic job for "make all", it apparently did not catch the build failure reported by Marcus. On Mon, Jan 9, 2023 at 3:35 PM Maxim Ganetsky via lazarus wrote: > It is no problem to add some `make useride` job. In principle, we can > even switch e. g. x86_64-win64 job to this (to avoid crowding even more > our already huge job list). Another option, if you don't want to create more jobs, is to string build tests together on the same job: #pseudocode make all || echo 'make all failed'; exit 1 make distclean || echo 'make distclean failed'; exit 2 make useride || echo 'make useride failed'; exit 3 From ganmax at narod.ru Tue Jan 10 01:43:34 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Tue, 10 Jan 2023 03:43:34 +0300 Subject: [Lazarus] make all compilation error after 319649fb (Attn: Martin) In-Reply-To: References: <82d8ce9a-826a-9eb5-8c3a-a545aa847072@web.de> <481b1897-2652-a2b7-bb94-c057397978f9@mfriebe.de> <20230109191416.58a9c7c7@limapholos> <46b49e2e-06e0-e8a3-dea8-314b8d1fd35b@narod.ru> Message-ID: 10.01.2023 3:37, Wayne Sherman ?????: > On Sun, Jan 8, 2023 Marcus Sackrow wrote: >> make all for at least x86_64-linux does not compile since 319649fb > > On Mon, Jan 9, 2023 Martin Frb wrote: >> There is "make" (aka "make all" ?) and "make bigide". > > If there is an automatic job for "make all", it apparently did not > catch the build failure reported by Marcus. We have only `make bigide` ones, otherwise it would have failed indeed. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From luca at wetron.es Tue Jan 10 16:39:17 2023 From: luca at wetron.es (Luca Olivetti) Date: Tue, 10 Jan 2023 16:39:17 +0100 Subject: [Lazarus] LazReport, how to mix data from multiple datasets? Message-ID: Hello, I see that I cannot use more than one dataset in a report (actually I can, the problem is that the second dataset show always the same line, repeated for how many rows there are in the first one i.e.: ds1 row1 ds1 row2 ds1 row3 ds2 row1 ds2 row1 ds2 row1 ) Previously I used two reports and combined them into a third one, i.e.: with CombinedReport do begin reports.clear; reports.add(FirstReport); reports.add(SecondReport); .... end; The problem is that the second report starts on a new page, while I need it to stay on the same page: *** Report header (or page header on subsequent pages) --- first dataset header ... first dataset data --- second dataset header ... second dataset data **** page footer The first dataset is supposed to occupy about half the page. Is there a way to do that? How? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Wed Jan 11 10:20:19 2023 From: luca at wetron.es (Luca Olivetti) Date: Wed, 11 Jan 2023 10:20:19 +0100 Subject: [Lazarus] LazReport, how to mix data from multiple datasets? In-Reply-To: References: Message-ID: El 10/1/23 a les 16:39, Luca Olivetti via lazarus ha escrit: For the record: in the report designer the band has a "Dataset" property and you can assign to it the name of a TRfDbDataset on the form. I tried that previously and it didn't seem to work. After some painful debugging (which involved a complete rebuild of the lazarus ide, don't ask me why, I'd like to know), I found out that the property value, in spite of being there in the lrf file, wasn't being read, but in the next debug session it was. Again, don't ask me why, but now everything seems to be ok. Bye > Hello, > > I see that I cannot use more than one dataset in a report (actually I > can, the problem is that the second dataset show always the same line, > repeated for how many rows there are in the first one i.e.: > > ??? ds1 row1 > ??? ds1 row2 > ??? ds1 row3 > > ??? ds2 row1 > ??? ds2 row1 > ??? ds2 row1 > ) > > > Previously I used two reports and combined them into a third one, i.e.: > > with CombinedReport do > begin > ? reports.clear; > ? reports.add(FirstReport); > ? reports.add(SecondReport); > ? .... > end; > > > The problem is that the second report starts on a new page, while I need > it to stay on the same page: > > > *** Report header (or page header on subsequent pages) > --- first dataset header > ... first dataset data > --- second dataset header > ... second dataset data > **** page footer > > > The first dataset is supposed to occupy about half the page. > > > Is there a way to do that? How? > > Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Wed Jan 11 10:37:14 2023 From: luca at wetron.es (Luca Olivetti) Date: Wed, 11 Jan 2023 10:37:14 +0100 Subject: [Lazarus] LazReport, how to mix data from multiple datasets? In-Reply-To: References: Message-ID: <63b46bea-a313-db0a-4dd5-b8d81ed50367@wetron.es> El 11/1/23 a les 10:20, Luca Olivetti via lazarus ha escrit: > El 10/1/23 a les 16:39, Luca Olivetti via lazarus ha escrit: > > For the record: > > in the report designer the band has a "Dataset" property and you can > assign to it the name of a TRfDbDataset on the form. > I tried that previously and it didn't seem to work. > After some painful debugging (which involved a complete rebuild of the > lazarus ide, don't ask me why, I'd like to know), I found out that the > property value, in spite of being there in the lrf file, wasn't being > read, but in the next debug session it was. Again, don't ask me why, but > now everything seems to be ok. Ouch, that last problem was my fault: since I embed the files as resources, and obviously without a rebuild it wouldn't work. Bye > > Bye > > >> Hello, >> >> I see that I cannot use more than one dataset in a report (actually I >> can, the problem is that the second dataset show always the same line, >> repeated for how many rows there are in the first one i.e.: >> >> ???? ds1 row1 >> ???? ds1 row2 >> ???? ds1 row3 >> >> ???? ds2 row1 >> ???? ds2 row1 >> ???? ds2 row1 >> ) >> >> >> Previously I used two reports and combined them into a third one, i.e.: >> >> with CombinedReport do >> begin >> ?? reports.clear; >> ?? reports.add(FirstReport); >> ?? reports.add(SecondReport); >> ?? .... >> end; >> >> >> The problem is that the second report starts on a new page, while I >> need it to stay on the same page: >> >> >> *** Report header (or page header on subsequent pages) >> --- first dataset header >> ... first dataset data >> --- second dataset header >> ... second dataset data >> **** page footer >> >> >> The first dataset is supposed to occupy about half the page. >> >> >> Is there a way to do that? How? >> >> Bye > -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From rolf.wetjen at mail.de Thu Jan 12 10:02:12 2023 From: rolf.wetjen at mail.de (Rolf Wetjen) Date: Thu, 12 Jan 2023 10:02:12 +0100 Subject: [Lazarus] Unicode RTL for FPC In-Reply-To: References: Message-ID: Hi Michael, I'm interested in this but I expect that I'm not the expert you are looking for. Some time ago ( Lazarus 1.8 or even earlier) I made a directory sync program for my own use for Windows which is aware of Unicode names in the file system. I tried to follow your instruction but I failed as git is a pain for me: ?- Update your git clone ??? git pull https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus. "lazarus" is my target folder. - switch to branch unicodertl ??? git branch --list gives only one branch: main Can you please show in detail what to do? Do you plan a full Unicode (up to four bytes per codepoint as far as I remember) or a DBCS (double byte character set) version? I don't know what Windows uses and what Delphi does. Thank you, Rolf From michael at freepascal.org Thu Jan 12 10:24:42 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 12 Jan 2023 10:24:42 +0100 (CET) Subject: [Lazarus] Unicode RTL for FPC In-Reply-To: References: Message-ID: On Thu, 12 Jan 2023, Rolf Wetjen via lazarus wrote: > Hi Michael, > > I'm interested in this but I expect that I'm not the expert you are > looking for. Some time ago ( Lazarus 1.8 or even earlier) I made a > directory sync program for my own use for Windows which is aware of > Unicode names in the file system. Free Pascal is already aware of these names ? If you use UnicodeString, all file system routines will use the native Windows unicode APIs. You don't need the unicode RTL for that, however you will need to convert the names to UTF8 for display in the lazarus GUI, as it uses UTF8. > > I tried to follow your instruction but I failed as git is a pain for me: > > ?- Update your git clone > ??? git pull https://gitlab.com/freepascal.org/lazarus/lazarus.git > lazarus. "lazarus" is my target folder. > > - switch to branch unicodertl > ??? git branch --list gives only one branch: main > > Can you please show in detail what to do? Lazarus itself at this point has not been adapted. The instructions were meant for Free Pascal itself, not lazarus. If you want nonetheless to try FPC: - Create .fpc-unicodertl.cfg as per instructions in my first mail. - update/clone fpc git clone https://gitlab.com/freepascal.org/fpc/source.git fpc - Switch to unicode branch: git switch unicodertl - Create FPC unicode-rtl-capable compiler cd fpc make all - Optionally, install this compiler: make install - Use the compiler to create unicode rtl: cd rtl make clean all SUB_TARGET=unicodertl PP=/path/to/newly/compiled/compiler > > Do you plan a full Unicode (up to four bytes per codepoint as far as I > remember) or a DBCS (double byte character set) version? I don't know > what Windows uses and what Delphi does. I'm just leveraging the existing UnicodeString support of FPC, which mimics the Delphi/Windows support. I'm not that much of a unicode expert, but as far as I understand it is UTF16, meaning that up to four bytes per codepoint can be used, which means that a full unicode codepoint can take up to 2 pascal characters: the pascal 'Char' can never specify all unicode codepoints. Michael. From michael at freepascal.org Thu Jan 12 10:42:08 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 12 Jan 2023 10:42:08 +0100 (CET) Subject: [Lazarus] Debugging the unicode RTL Message-ID: Hello, As written in other mails, I'm currently working on the Unicode RTL of FPC. Debugging programs using the unicode RTL is possible, but not comfortable: I have currently identified 2 problems in Lazarus which make debugging such programs difficult: - The IDE does now know the -tSUBTARGET option. This means that it does not correctly identify the IFDEF paths in source code, as it didn't correctly parse all config files. - Debugging programs works in general quite OK, except for displaying of some strings. Most notable, the exception message is affected: only the first character of the exception message is shown. It seems to me obvious that the IDE needs to be aware of the -t option. But for debugging this is not enough: I think the IDE debugger needs another mechanism to determine using whether a program uses a unicode RTL or not. The way this happens in code is {$IF SIZEOF(CHAR)=2} // unicode RTL code. {$ELSE} // Ansi rtl code. {$ENDIF} Obviously, this is of no use in the debugger. The subtarget name is also not usable, since any subtarget definition can specify that the RTL should be unicode. Questions: 1/ Should the compiler provide some symbol in - say - the system unit to deterine whether the RTL is compiled in unicode mode, or is another mechanism preferred to do this ? 2/ Where can I find the code that extracts the message from an exception object ? So I can have a shot at trying to fix the display. Michael. From pascaldragon at googlemail.com Thu Jan 12 11:09:53 2023 From: pascaldragon at googlemail.com (Sven Barth) Date: Thu, 12 Jan 2023 11:09:53 +0100 Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: Michael Van Canneyt via lazarus schrieb am Do., 12. Jan. 2023, 10:42: > 1/ Should the compiler provide some symbol in - say - the system unit to > deterine > whether the RTL is compiled in unicode mode, or is another mechanism > preferred to do this ? > "Char" already is such a symbol that the debugger can and must use to determine this. And if no debug information for aliases is created then *that* needs to be fixed instead. But the debugger also needs to be able to determine Unicode vs. ANSI if no debug information for the System unit is available thus it needs to rely on CodeTools then and what *that* provides for Char. Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Thu Jan 12 11:26:59 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 12 Jan 2023 11:26:59 +0100 (CET) Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: On Thu, 12 Jan 2023, Sven Barth via lazarus wrote: > Michael Van Canneyt via lazarus schrieb am > Do., 12. Jan. 2023, 10:42: > >> 1/ Should the compiler provide some symbol in - say - the system unit to >> deterine >> whether the RTL is compiled in unicode mode, or is another mechanism >> preferred to do this ? >> > > "Char" already is such a symbol that the debugger can and must use to > determine this. And if no debug information for aliases is created then > *that* needs to be fixed instead. In earlier discussions I was told Type Char = UnicodeChar; Var C : Char; means 'replace char with unicodechar'. So in the final binary only the effect of the declaration var C : unicodechar ; will be seen. Which is IMO the only correct behaviour. If you want a different type you need to do Type Char = Type Unicodechar; which creates 2 distinct types which are assignment compatible. This will lead to other problems. I also don't think the debugger needs to be able to determine the definition of "char". It needs to determine the definition of "string" which will be an array of unicodechar or ansichar. Once it knows that, the rest will follow, since the definition of unicodechar or ansichar will have the correct size. > But the debugger also needs to be able to determine Unicode vs. ANSI if no > debug information for the System unit is available thus it needs to rely on > CodeTools then and what *that* provides for Char. I don't think this is a very reliable method. In moderately difficult code, half of the time the codetools don't work properly, so relying on them to provide this info is a recipe for disaster. Hence my question... Michael. From donald at ziesig.org Sun Jan 15 04:03:07 2023 From: donald at ziesig.org (Don Ziesig) Date: Sat, 14 Jan 2023 22:03:07 -0500 Subject: [Lazarus] Minor annoyance in IDE Message-ID: Hi All! It's been years (unfortunately much ill health/hospitalization) but I'm back. I upgraded to Lazarus 2.2.4 before getting back to work and my memory of the annoyance from earlier versions may be erroneous (I don't remember it happening in the past). When I have a non-Lazarus window overlapping the main IDE window and I move the mouse over the main window the main window raises itself over everything else on the desktop.? This is exceedingly annoying.? My normal muscle-memory is that I am the only one who explicitly raises windows using a mouse click (too much MS Windows in the distant past?). Is there any way to disable this?? I have looked at all of the configuration menus/pages but didn't see any thing that looks appropriate. Or might it just be the OS (Linux Mint XFCE)? Thanks, Don Ziesig From zeljko at holobit.hr Sun Jan 15 09:12:56 2023 From: zeljko at holobit.hr (zeljko) Date: Sun, 15 Jan 2023 09:12:56 +0100 Subject: [Lazarus] Minor annoyance in IDE In-Reply-To: References: Message-ID: <653363eb-7a8d-cc09-f7a0-a44c2bf0c266@holobit.hr> On 15. 01. 2023. 04:03, Don Ziesig via lazarus wrote: > Hi All! > > It's been years (unfortunately much ill health/hospitalization) but I'm > back. > > I upgraded to Lazarus 2.2.4 before getting back to work and my memory of > the annoyance from earlier versions may be erroneous (I don't remember > it happening in the past). > > When I have a non-Lazarus window overlapping the main IDE window and I > move the mouse over the main window the main window raises itself over > everything else on the desktop.? This is exceedingly annoying.? My > normal muscle-memory is that I am the only one who explicitly raises > windows using a mouse click (too much MS Windows in the distant past?). > > Is there any way to disable this?? I have looked at all of the > configuration menus/pages but didn't see any thing that looks appropriate. > > Or might it just be the OS (Linux Mint XFCE)? Some window managers have such configuration, focus on mouse over or similar, so that could be your problem. Search for window focusing in xfce configuration. zeljko From rolf.wetjen at mail.de Sun Jan 15 13:42:21 2023 From: rolf.wetjen at mail.de (Rolf Wetjen) Date: Sun, 15 Jan 2023 13:42:21 +0100 Subject: [Lazarus] Unicode RTL for FPC In-Reply-To: References: Message-ID: <2bbb80dd-8e95-0dd3-44d0-132477ba0f95@mail.de> Hi Michael, - update/clone fpc: git clone https://gitlab.com/freepascal.org/fpc/source.git fpc ** ok - Switch to unicode branch: cd fpc **missing in the description git switch unicodertl ** ok - Create FPC unicode-rtl-capable compiler cd fpc ** already in fpc make all ** ok, beside of the fact that there's no make.exe (no bin) folder in the new fpc file tree. I used make.exe from lazarus fpc 3.2.2. ?- Create .fpc-unicodertl.cfg as per instructions in my first mail. ** There's no fpc.cfg in the new fpc file tree. In lazarus/fpc/3.2.2 it's in fpc\3.2.2\bin\x86_64-win64. Rolf From juha.manninen62 at gmail.com Sun Jan 15 16:52:13 2023 From: juha.manninen62 at gmail.com (Juha Manninen) Date: Sun, 15 Jan 2023 17:52:13 +0200 Subject: [Lazarus] Minor annoyance in IDE In-Reply-To: References: Message-ID: On Sun, Jan 15, 2023 at 5:03 AM Don Ziesig via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Or might it just be the OS (Linux Mint XFCE)? > As Zeljko mentioned it is a window manager issue. Not OS. My KDE also has such a setting but I don't have it enabled. I hope you recovered from your health issues whatever they were. Regards, Juha -------------- next part -------------- An HTML attachment was scrubbed... URL: From donald at ziesig.org Mon Jan 16 11:54:33 2023 From: donald at ziesig.org (Don Ziesig) Date: Mon, 16 Jan 2023 05:54:33 -0500 Subject: [Lazarus] Minor annoyance in IDE In-Reply-To: References: Message-ID: Zelkjo and Juha, You are both right.? I found the setting in the window manager with two choices:? ClickToFocus and FocusFollowsMouse.? It was set to FocusFollowsMouse.? Changing it made the annoyance go away. Now the question is "why did it change in the immediate past?"? I did not change it knowingly. Maybe it was a stray cosmic ray ? flipping the bit. Anyway I am back.? As for my health issues, next week I will celebrate my 80th birthday and the health issues all have to do with that.? At least I still have my mind and memory.? I can work around the physical problems. Thanks, Don On 1/15/23 10:52, Juha Manninen via lazarus wrote: > On Sun, Jan 15, 2023 at 5:03 AM Don Ziesig via lazarus > wrote: > > Or might it just be the OS (Linux Mint XFCE)? > > > As Zeljko mentioned it is a window manager issue. Not OS. > My KDE also has such a setting but I don't have it enabled. > > I hope you recovered from your health?issues whatever they were. > > Regards, > Juha > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Sun Jan 22 11:24:08 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 11:24:08 +0100 Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: On 12/01/2023 10:42, Michael Van Canneyt via lazarus wrote: > > - Debugging programs works in general quite OK, except for displaying of > ? some strings. Most notable, the exception message is affected: > ? only the first character of the exception message is shown. This is hardcoded, and may be change-able, if debug info is avail..... With a look at the next paragraph below.... If ? ? Exception = class .... end ?is available (ideally within the correct unit, so the debugger can distinguish it from some user declared type), then the debugger could use this. Ideally it will by in unit system/sysutils. NOTE: On Linux, such symbols are referenced cross units. But on Windows they are repeated in every unit using them. That again makes it harder to know if it is the correct type (since the user may have its own type by the name). > > But for debugging this is not enough: I think the IDE debugger needs > another mechanism to determine using whether a program uses a unicode > RTL or not. The way this happens in code is {$IF SIZEOF(CHAR)=2} I don't think the debugger should have or need such a "global" flag. Currently if it looks at a string (and there is dwarf debug info), then the dwarf contains the size-of-char: 1 or 2. And the debugger does utf8 or utf16 (the latter may be buggy). Joost even added code to read the hidden encoding field of strings. Though this relies on being able to detect ?? PChar? <>? String? <>? array of char which is a PITA. > > 1/ Should the compiler provide some symbol in - say - the system unit > to deterine > whether the RTL is compiled in unicode mode, or is another mechanism > preferred to do this ? I don't think that is useful. Better find the individual places that go wrong, and fix them. As I said, Exceptions are hardcoded (and IIRC not even in FpDebug, but in LazDebuggerFp). They could/should first search for the type "Exception" > > 2/ Where can I find the code that extracts the message from an exception > object ? So I can have a shot at trying to fix the display. unit FpDebugDebugger; procedure TFpDebugDebugger.HandleSoftwareException // Get address of object ? if not FDbgController.DefaultContext.ReadUnsignedInt(FDbgController.CurrentProcess.CallParamDefaultLocation(0), ??? SizeVal(SizeOf(AnExceptionObjectLocation)), AnExceptionObjectLocation) ? then .... ??? ExceptionMessage := ReadAnsiString(AnExceptionObjectLocation+DBGPTRSIZE[FDbgController.CurrentProcess.Mode]); That currently does not yet have the read of the "encoding" field. -------------------------------------------------------------------------------------------------------- What about: ?? TSomeClass.Classname is that utf16 too? Because the debugger reads it for automatic class casting Any other changes in the RTTI where things switched to 16 bit? From lazarus at mfriebe.de Sun Jan 22 11:29:45 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 11:29:45 +0100 Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> On 12/01/2023 11:26, Michael Van Canneyt via lazarus wrote: > > It needs to determine the definition of "string" which will be an > array of > unicodechar or ansichar. Once it knows that, the rest will follow, > since the definition of unicodechar or ansichar will have the correct > size. > The big issues is still, that dwarf does not make any (official/documented) diff between PChar, string and array of char. Except for internal encoding details .... > I don't think this is a very reliable method. In moderately difficult > code, > half of the time the codetools don't work properly, so relying on them > to provide this info is a recipe for disaster. Hence my question... The debugger does and should not relay on codetools. Well, there is a? case where codetool helps preparing.... If you add a watch (or hover for a hint), codetool will determine the boundaries of the expression. So?? "foo.bar"? will not just add bar, but the correct term. Or? "foo.bar[x.y]"?? if you hover on y, will get x.y, but if you hover on "]" will get the full term. And codetool will resolve "with" at that time. But that is it. And it should be it. Source can have changed in the mean time. From lazarus at mfriebe.de Sun Jan 22 11:38:24 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 11:38:24 +0100 Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: <880b3db0-0abb-9f8a-35db-9bed3bdec521@mfriebe.de> On 22/01/2023 11:24, Martin Frb via lazarus wrote: > >> >> 2/ Where can I find the code that extracts the message from an exception >> object ? So I can have a shot at trying to fix the display. > > unit FpDebugDebugger; > procedure TFpDebugDebugger.HandleSoftwareException .... Important: If you make any change is the FpDebug package itself, and code that is FPC specific must go into ? unit FpDbgDwarfFreePascal; All other units should be kept free from such knowledge (not 100% achieved yet, but...). After all, FpDebug is meant to be a generic debugger for any app that has dwarf. Exception may be semi-generic stuff like prologue detection based on fpc, but potentially working for other compilers too. --------------------------- Of course ?? LazDebuggerFp? (containing FpDebugDebugger) is in a diff package. And it can have as much FPC knowledge as it wants. From michael at freepascal.org Sun Jan 22 11:46:17 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 22 Jan 2023 11:46:17 +0100 (CET) Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: On Sun, 22 Jan 2023, Martin Frb via lazarus wrote: > On 12/01/2023 10:42, Michael Van Canneyt via lazarus wrote: >> >> - Debugging programs works in general quite OK, except for displaying of >> ? some strings. Most notable, the exception message is affected: >> ? only the first character of the exception message is shown. > > This is hardcoded, and may be change-able, if debug info is avail..... > > With a look at the next paragraph below.... > If > ? ? Exception = class .... end > ?is available (ideally within the correct unit, so the debugger can > distinguish it from some user declared type), then the debugger could > use this. > > Ideally it will by in unit system/sysutils. Sorry, I don't understand at all what you are saying here. > > > NOTE: > On Linux, such symbols are referenced cross units. But on Windows they > are repeated in every unit using them. That again makes it harder to > know if it is the correct type (since the user may have its own type by > the name). ? > > >> >> But for debugging this is not enough: I think the IDE debugger needs >> another mechanism to determine using whether a program uses a unicode >> RTL or not. The way this happens in code is {$IF SIZEOF(CHAR)=2} > > I don't think the debugger should have or need such a "global" flag. > > Currently if it looks at a string (and there is dwarf debug info), then > the dwarf contains the size-of-char: 1 or 2. > And the debugger does utf8 or utf16 (the latter may be buggy). I have meanwhile established that it has some problems: I have the impression that PChar is hardcoded in some places to mean UTF8. See below. > > Joost even added code to read the hidden encoding field of strings. > > Though this relies on being able to detect > ?? PChar? <>? String? <>? array of char > which is a PITA. > Important remark: Make it a habit not to use Char any more. It no longer exists as a type. It is an alias to AnsiChar or Wide/UnicodeChar. So be specific: use AnsiChar or UnicodeChar (and their pointer variants). For code that does not care whether it is 1 or 2-byte, you can still use char. But for such low-level things as a debugger, the use of "char" and "pchar" is IMO absolutely forbidden. >> 1/ Should the compiler provide some symbol in - say - the system unit >> to deterine >> whether the RTL is compiled in unicode mode, or is another mechanism >> preferred to do this ? > I don't think that is useful. > Better find the individual places that go wrong, and fix them. > > As I said, Exceptions are hardcoded (and IIRC not even in FpDebug, but > in LazDebuggerFp). > They could/should first search for the type "Exception" That seems prudent, yes :-) >> 2/ Where can I find the code that extracts the message from an exception >> object ? So I can have a shot at trying to fix the display. > > unit FpDebugDebugger; > procedure TFpDebugDebugger.HandleSoftwareException > > // Get address of object > > ? if not > FDbgController.DefaultContext.ReadUnsignedInt(FDbgController.CurrentProcess.CallParamDefaultLocation(0), > ??? SizeVal(SizeOf(AnExceptionObjectLocation)), AnExceptionObjectLocation) > ? then > > .... > ??? ExceptionMessage := > ReadAnsiString(AnExceptionObjectLocation+DBGPTRSIZE[FDbgController.CurrentProcess.Mode]); > > > That currently does not yet have the read of the "encoding" field. >From what I know, a unicode string does not have an encoding field. So this code will need some changes. > > > -------------------------------------------------------------------------------------------------------- > What about: > ?? TSomeClass.Classname > > is that utf16 too? No. It remains shortstring. > Because the debugger reads it for automatic class casting > > Any other changes in the RTTI where things switched to 16 bit? None spring to mind. Michael. From michael at freepascal.org Sun Jan 22 11:53:18 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 22 Jan 2023 11:53:18 +0100 (CET) Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> References: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> Message-ID: On Sun, 22 Jan 2023, Martin Frb via lazarus wrote: > On 12/01/2023 11:26, Michael Van Canneyt via lazarus wrote: >> >> It needs to determine the definition of "string" which will be an >> array of >> unicodechar or ansichar. Once it knows that, the rest will follow, >> since the definition of unicodechar or ansichar will have the correct >> size. >> > > The big issues is still, that dwarf does not make any > (official/documented) diff between PChar, string and array of char. > Except for internal encoding details .... Since the PChar/Char types are now an alias, logically the debug info should only have references to AnsiChar/UnicodeChar. But I have no idea how to test this assumption. >> I don't think this is a very reliable method. In moderately difficult >> code, >> half of the time the codetools don't work properly, so relying on them >> to provide this info is a recipe for disaster. Hence my question... > > The debugger does and should not relay on codetools. > > Well, there is a? case where codetool helps preparing.... > If you add a watch (or hover for a hint), codetool will determine the > boundaries of the expression. > > So?? "foo.bar"? will not just add bar, but the correct term. > Or? "foo.bar[x.y]"?? if you hover on y, will get x.y, but if you hover > on "]" will get the full term. > > And codetool will resolve "with" at that time. > > But that is it. > And it should be it. We are 100% agreed on that, hence my questions. So, if I understand you correctly: The problem is now to see if the debugger can determine from the available debug info/rtti whether the RTL uses AnsiChar or UnicodeChar. Which still leaves the question: What to do if there is no debug info for the system unit ? By default, FPC distributes units without debug info. As far as I know, TObject does not have any RTTI associated with it. Michael. From lazarus at mfriebe.de Sun Jan 22 12:17:58 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 12:17:58 +0100 Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: Message-ID: I may have to double check some details, just going from memory.... On 22/01/2023 11:46, Michael Van Canneyt wrote: > On Sun, 22 Jan 2023, Martin Frb via lazarus wrote: >> On 12/01/2023 10:42, Michael Van Canneyt via lazarus wrote: >>> >>> - Debugging programs works in general quite OK, except for >>> displaying of >>> ? some strings. Most notable, the exception message is affected: >>> ? only the first character of the exception message is shown. >> >> This is hardcoded, and may be change-able, if debug info is avail..... >> >> With a look at the next paragraph below.... >> If >> ? ? Exception = class .... end >> ?is available (ideally within the correct unit, so the debugger can >> distinguish it from some user declared type), then the debugger could >> use this. >> >> Ideally it will by in unit system/sysutils. > > Sorry, I don't understand at all what you are saying here. 1) If you look at the current code getting the message, it just hardcoded. Get pointer to instance, add hardcoded offset to FMessage field. Assume it is an AnsiString. Read it. But if it could find (the correct) type "Exception" describing the class, then it could evaluate: ???? Exception( instance_addr_from_reg ).FMessage And thus get the dwarf info for FMessage which includes the size-of-char. 2) However a user can define his own class name "Exception" that has nothing in common with the above. So if LazDebuggerFp could relay on finding this class in unit system or sysutils => then that would make it more fool proof. If the class is not found, the current behaviour can be used as fallback. 3) Looking up "char" is possible. But there can be a "char" definition in each unit.... (On Windows there almost certainly is) > >> NOTE: >> On Linux, such symbols are referenced cross units. But on Windows >> they are repeated in every unit using them. That again makes it >> harder to know if it is the correct type (since the user may have its >> own type by the name). > > ? If I use TFooList from unit Foo, then a dwarf definition of TFooList is expected in unit Foo. IIRC, on linux that is the case. And on linux any other unit has a reference to that unit. On Windows: There may be, if the type is actually used in unit Foo. On Windows, every other unit in which it is used, will repeat the entire dwarf. This may depend on the linker..... ?? >>> >>> But for debugging this is not enough: I think the IDE debugger needs >>> another mechanism to determine using whether a program uses a >>> unicode RTL or not. The way this happens in code is {$IF >>> SIZEOF(CHAR)=2} >> >> I don't think the debugger should have or need such a "global" flag. >> >> Currently if it looks at a string (and there is dwarf debug info), >> then the dwarf contains the size-of-char: 1 or 2. >> And the debugger does utf8 or utf16 (the latter may be buggy). > > I have meanwhile established that it has some problems: I have the > impression that PChar is hardcoded in some places to mean UTF8. Example? I did not find that " below" Anyway, what you might have seen, is not that the name "PChar" maps to utf8, but that the dwarf description of: ? ? ? pointer > basic-dwarf-type(char with size =1) Is interpreted as such. For such a type it is not known what the encoding is. (Eventually the user should be able to chose in the watch-properties). But in LCL apps, the above is most likely a PAnsiChar to a (sub-)string that is utf8 encoded. >> >> Joost even added code to read the hidden encoding field of strings. >> >> Though this relies on being able to detect >> ?? PChar? <>? String? <>? array of char >> which is a PITA. >> > .... > But for such low-level things as a debugger, the use of "char" and > "pchar" is IMO absolutely forbidden. For the debugger the name of the type is irrelevant. It looks up the dwarf definition. If the user's code contains a type name FooChar, then the debugger has no influence on that. Equally if the user enters a watch: ^char(xy)^ >>> 2/ Where can I find the code that extracts the message from an >>> exception >>> object ? So I can have a shot at trying to fix the display. >> >> unit FpDebugDebugger; >> procedure TFpDebugDebugger.HandleSoftwareException >> >> // Get address of object >> >> ? if not >> FDbgController.DefaultContext.ReadUnsignedInt(FDbgController.CurrentProcess.CallParamDefaultLocation(0), >> ??? SizeVal(SizeOf(AnExceptionObjectLocation)), >> AnExceptionObjectLocation) >> ? then >> >> .... >> ??? ExceptionMessage := >> ReadAnsiString(AnExceptionObjectLocation+DBGPTRSIZE[FDbgController.CurrentProcess.Mode]); >> >> >> That currently does not yet have the read of the "encoding" field. > > From what I know, a unicode string does not have an encoding field. So > this > code will need some changes. This code IIRC only acts, if it finds: ??? basic-dwarf-type(char with size =1) So that should be ok. It should be in the ? unit FpDbgDwarfFreePascal; From lazarus at mfriebe.de Sun Jan 22 12:34:09 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 12:34:09 +0100 Subject: [Lazarus] Debugging the unicode RTL In-Reply-To: References: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> Message-ID: <4fe8d94c-1f0e-8ac3-b1f1-a6b0410afd3f@mfriebe.de> On 22/01/2023 11:53, Michael Van Canneyt via lazarus wrote: > > Since the PChar/Char types are now an alias, logically the debug info > should only have references to AnsiChar/UnicodeChar. > > But I have no idea how to test this assumption. if adding a watch containing? "^char(x)" fails, then that will upset plenty of people. (including me) That alias should always be encoded as type, if it is used in the user's code. > So, if I understand you correctly: > > The problem is now to see if the debugger can determine from the > available debug info/rtti whether the RTL uses AnsiChar or UnicodeChar. Not really. Whenever the debugger accesses "char" or "sequence of char" data, it should have debug info for this. If it has, this debug info will contain the size-of for that/those chars. And that is enough to decide if that particular instance is utf8 or utf16. If the RTL (or user code) would be partly AnsiChar, and partly UnicodeChar... => no problem. The problem is, that the Exception.FMessage is not using dwarf info. (Because it is not always included) > > Which still leaves the question: What to do if there is no debug info > for the system unit ? By default, FPC distributes units without debug > info. Well if it is not possible to include ??? type sysutils.Exception in the dwarf info, then some other kind of flag needs to be agreed that is on top of the normal dwarf. The question is where to store this. - It could be some $$$char? type declaration (to make sure it can't clash with user names). But then should be in a specific unit, so the debugger knows where to look. - It could be an addition to the "producer" in the Compilation-unit (but that needs to be repeated in every CU) - It could be a "linker symbol" like FPC_RAISEEXCEPTION", ? where the compiler either includes FPC_CHAR_IS_ANSI or FPC_CHAR_IS_UNI Or, depending on how the whole stuff works with the linker.... Even if sysutils.o does not have debug info, the compiler could write and include a dummy .o file that has debug info and gets included. It may have to use a diff unit name for that: sysutils$$fpc.o Those are just ideas, I don't know the compiler/linker well enough.... Any "global" flag, will cause extra work when it comes to dll/libraries. Because then all FpDebug code needs to handle this per dll. From lazarus at mfriebe.de Sun Jan 22 12:39:05 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 12:39:05 +0100 Subject: [Lazarus] OFF-TOPIC: Naming of char [[[Re: Debugging the unicode RTL]]] In-Reply-To: References: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> Message-ID: <0bdf8c20-6b21-a0b6-8f79-8184f92f1b80@mfriebe.de> On 22/01/2023 11:53, Michael Van Canneyt via lazarus wrote: > Since the PChar/Char types are now an alias, logically the debug info > should only have references to AnsiChar/UnicodeChar. Well technically neither of them is (always) an actual character. They should be called AnsiCodepoint UniCodeCodePoint So people will be reminded that they do not contain characters (they may by coincidence, but software should not be build on coincidence) But that is just my personal 2cent. From lazarus at mfriebe.de Sun Jan 22 12:58:23 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 12:58:23 +0100 Subject: [Lazarus] To be a string or not to be a string (bitness independent?) [[[Re: Debugging the unicode RTL]]] In-Reply-To: References: Message-ID: On 22/01/2023 11:24, Martin Frb via lazarus wrote: > Though this relies on being able to detect > ?? PChar? <>? String? <>? array of char > which is a PITA. Example: ? FPC 3.3.1 (but IIRC also 3.2.x) ? tested on Win, but similar on other OS ? dwarf-3 var ? s1: AnsiString; ? s2: array of char; Both are encoded as ? ? DW_TAG_array_type The name is not relevant, since the user could have done "type Foo = type AnsiString" The debugger can only make the difference by looking at "current implementation in fpc" For an array, FPC adds - a stride - a type for the subrange. Both are not guaranteed, and could change any day. If they do, a string may suddenly be shown as ? s1:?? ('H','e','l','l','o',' ','W','o','r','l','d') ---------------- With DWARF-2? string are using the same dwarf as "PChar" (independent of its new name). So for the watch "s1[2]" you get the value PChar 'l'; String 'e' Because the debugger simply can't tell if the index is 1 or 0 based. From fpc at pascalprogramming.org Sun Jan 22 13:12:28 2023 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Sun, 22 Jan 2023 13:12:28 +0100 Subject: [Lazarus] OFF-TOPIC: Naming of char [[[Re: Debugging the unicode RTL]]] In-Reply-To: <0bdf8c20-6b21-a0b6-8f79-8184f92f1b80@mfriebe.de> References: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> <0bdf8c20-6b21-a0b6-8f79-8184f92f1b80@mfriebe.de> Message-ID: On 22-1-2023 12:39, Martin Frb via lazarus wrote: > > They should be called > > AnsiCodepoint > UniCodeCodePoint No, since in the case of a surrogate it is not a codepoint either. It is the unit of encoding granularity, nothing more. But anyway, that ship sailed in (D)2009.? It is probably the ever lasting tension between easier transition and long term best nomenclature. > So people will be reminded that they do not contain characters (they > may by coincidence, but software should not be build on coincidence) I have some doubts about such simple nomenclature really explaining something as complex as unicode. It will never be intuitive and always need study. From lazarus at mfriebe.de Sun Jan 22 13:47:40 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 22 Jan 2023 13:47:40 +0100 Subject: [Lazarus] OFF-TOPIC: Naming of char [[[Re: Debugging the unicode RTL]]] In-Reply-To: References: <8b917a48-852f-5011-fefd-1b4a4047544a@mfriebe.de> <0bdf8c20-6b21-a0b6-8f79-8184f92f1b80@mfriebe.de> Message-ID: On 22/01/2023 13:12, Marco van de Voort via lazarus wrote: > > On 22-1-2023 12:39, Martin Frb via lazarus wrote: >> >> They should be called >> >> AnsiCodepoint >> UniCodeCodePoint > > No, since in the case of a surrogate it is not a codepoint either. It > is the unit of encoding granularity, nothing more. Ouch, yes got me there. And in utf8 it is also not a codepoint. I should have use "CodeUnit". > > I have some doubts about such simple nomenclature really explaining > something as complex as unicode. It will never be intuitive and always > need study. > Agreed. But I couldn't resist. From bo.berglund at gmail.com Mon Jan 23 09:49:30 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 23 Jan 2023 09:49:30 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? Message-ID: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> I have a number of "older" applications developed on Windows using Delphi7-2007-XE5, which use ADODB for database accesses. The database is Microsoft SQLSERVER. Now I no longer have the old Borland software installed (issues with Windows 10 etc) so I want to port the projects to FPC/Lazarus. I have ported some other non-database applications which (with some effort) seems to have worked out OK. Now I am facing the challenge of doing it on an adodb database enabled application and I would like to know if there is some "compatible" way of doing it, which is described somewhere? -- Bo Berglund Developer in Sweden From michael at freepascal.org Mon Jan 23 09:59:14 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 23 Jan 2023 09:59:14 +0100 (CET) Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? In-Reply-To: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> Message-ID: On Mon, 23 Jan 2023, Bo Berglund via lazarus wrote: > I have a number of "older" applications developed on Windows using > Delphi7-2007-XE5, which use ADODB for database accesses. > The database is Microsoft SQLSERVER. > > Now I no longer have the old Borland software installed (issues with Windows 10 > etc) so I want to port the projects to FPC/Lazarus. > I have ported some other non-database applications which (with some effort) > seems to have worked out OK. > > Now I am facing the challenge of doing it on an adodb database enabled > application and I would like to know if there is some "compatible" way of doing > it, which is described somewhere? Yes. You need to use SQLDB, and the TMSSQLConnection. See https://wiki.freepascal.org/SQLdb_Tutorial1 for a simple explanation. The page https://wiki.freepascal.org/SQLdb_Package also contains some explanations for setup. There are some other pages in the wiki. A more in-depth explanation is in the lazarus book. Or you can look at https://www.freepascal.org/~michael/articles/ several articles discuss SQLDB, in particular: https://www.freepascal.org/~michael/articles/lazviddb/lazviddb.pdf That should be enough to get you started. Michael. From bo.berglund at gmail.com Mon Jan 23 17:53:26 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 23 Jan 2023 17:53:26 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> Message-ID: On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus wrote: >That should be enough to get you started. > >Michael. Thanks! I will go there and check what I can do. I believe that I have isolated the DB stuff fairly well so hopefully only a few procedures need be touched. I have NOT dropped components onto a Dataform for example.... (I think that was the name used in Delphi where you could drop invisible components to get them into the RAD system. Long time ago now, though...) -- Bo Berglund Developer in Sweden