[Lazarus] Possible Codetools issue for embedded targets in main branch

Michael Ring mail at michael-ring.org
Thu Oct 6 22:47:19 CEST 2022


While investigating further I suddenly saw that the unit was detected.

So I did a complete fresh install via fpcupdeluxe, opened a project for 
rp2040, saw the error.

Then I selected 'rescan fpc source directory' and the issue was gone.

So not sure if this is an issue or not, it definitely does not fully 
work as expected.


Michael


Am 06.10.22 um 21:59 schrieb Michael Ring via lazarus:
> I today looked at an issue posted in the lazarus forum:
>
> https://forum.lazarus.freepascal.org/index.php/topic,60790.0.html
>
> the user is unable to use ctrl-space for help because codetools cannot 
> find the required unit rp2040.
>
> I could not reproduce the issue with my older installation of 
> lazarus-trunk but when I upgraded to latest trunk from today I saw the 
> same issue.
>
>
> Possible reason is that lazarus cannot extract the info about the unit 
> source file from the output of the -ix format of fpc
>
>
> I commented out a few log entries and got this result:
>
> TFindDeclarationTool.FindUnitSource 
> Self="/Users/ring/devel/pico-fpcexamples/blinky/blinky.lpr" 
> AnUnitName="RP2040" AnUnitInFilename=""
> TCTDirectoryCache.FindUnitSourceInCompletePath AUnitName="RP2040" 
> InFilename="" Directory="/Users/ring/devel/pico-fpcexamples/blinky/"
> TCTDirectoryCache.FindUnitSourceInCompletePath unit RP2040 not found 
> in 
> SrcPath="/Users/ring/devel/pico-fpcexamples/blinky;/Users/ring/devel/pico-fpcexamples/units" 
> Directory="/Users/ring/devel/pico-fpcexamples/blinky/" searchin in 
> unitset ...
> TCTDirectoryCache.FindUnitInUnitSet 
> Directory="/Users/ring/devel/pico-fpcexamples/blinky/" 
> UnitSet="CompilerFilename=/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/fpc.sh
> TargetOS=embedded
> TargetCPU=arm
> Options=
> FPCSrcDir=/Users/ring/fpcupdeluxe/fpcsrc/
> Stamp=1" AUnitName="RP2040"
> TFPCUnitSetCache.GetUnitSrcFile Unit="RP2040" 
> SrcSearchRequiresPPU=False SkipPPUCheckIfTargetIsSourceOnly=True
> TFPCUnitSetCache.GetUnitSrcFile Unit="RP2040" Result=
> TCTDirectoryCache.FindUnitInUnitSet 
> Directory="/Users/ring/devel/pico-fpcexamples/blinky/" 
> UnitSet="CompilerFilename=/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/fpc.sh#10TargetOS=embedded#10TargetCPU=arm#10Options=#10FPCSrcDir=/Users/ring/fpcupdeluxe/fpcsrc/#10Stamp=1" 
> AUnitName="RP2040" Result=""
> TCTDirectoryCache.FindUnitSourceInCompletePath unit RP2040 not found 
> in unitlinks. Directory="/Users/ring/devel/pico-fpcexamples/blinky/"
> TCTDirectoryCache.FindCompiledUnitInUnitSet 
> Directory="/Users/ring/devel/pico-fpcexamples/blinky/" 
> UnitSet="CompilerFilename=/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/fpc.sh
> TargetOS=embedded
> TargetCPU=arm
> Options=
> FPCSrcDir=/Users/ring/fpcupdeluxe/fpcsrc/
> Stamp=1" AUnitName="RP2040.ppu"
> TCTDirectoryCache.FindCompiledUnitInUnitSet 
> Directory="/Users/ring/devel/pico-fpcexamples/blinky/" 
> UnitSet="CompilerFilename=/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/fpc.sh#10TargetOS=embedded#10TargetCPU=arm#10Options=#10FPCSrcDir=/Users/ring/fpcupdeluxe/fpcsrc/#10Stamp=1" 
> AUnitName="RP2040.ppu" Result=""
> ### TCodeToolManager.HandleException: [20170421200056] "unit not 
> found: RP2040" in "/Users/ring/devel/pico-fpcexamples/blinky/blinky.lpr"
>
>
> when I manually run the -ix command with my fpc I receive the hits I 
> would expect:
>
>
> ~/fpcupdeluxe/fpc/bin/x86_64-darwin/fpc -Tembedded -Parm -ix | grep -i 
> rp2040
>       <controllertype name="RP2040" controllerunit="RP2040"/>
>       <controllertype name="RASPI_PICO" controllerunit="RP2040"/>
>       <controllertype name="FEATHER_RP2040" controllerunit="RP2040"/>
>       <controllertype name="ITZYBITZY_RP2040" controllerunit="RP2040"/>
>       <controllertype name="QTPY_RP2040" controllerunit="RP2040"/>
>       <controllertype name="TINY_2040" controllerunit="RP2040"/>
>
>
> and I also find the unit in my fpcsrc directory:
>
>
> find /Users/ring/fpcupdeluxe/fpcsrc -name "rp2040*"
> /Users/ring/fpcupdeluxe/fpcsrc/rtl/embedded/arm/rp2040.pp
>
>
> I am stuck because I cannot find the correct implementation for 
> TCTGetCompiledUnitFromSet althoug I searched through all sources for 
> (const UnitSet, AnUnitName: string)
>
>
> Michael
>
>
> Please note that you will not find unit rp2040 in official trunk, only 
> in my version but the same issue should be there for any other 
> existing embedded comtrollerunit
>
>
>
>
>
>
>


More information about the lazarus mailing list