Hopefully the first issue has now been resolved, although it may require refactoring later.

https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/691

The main issue is that, for some reason, trying to dereference from a code section instead of a data section raises an access violation, although I'm not sure if it's a permissions issue or a subtle fault with the pointers.  This may require refactoring later on or if bugs manifest in larger projects.

Kit

On 26/05/2024 21:33, J. Gareth Moreton via fpc-devel wrote:

Thank you for all your assistance with this Sven.

One trick I have been doing is writing equivalent programs in C/C++ to see how Clang and MSVC convert them into equivalent assembly language.  It's providing some insights at least in regards to what works.  My first attempted fix (putting the jump table in the same section as the actual code) unfortunately didn't work, so it's something more subtle.

Kit

On 26/05/2024 11:55, Sven Barth via fpc-devel wrote:
J. Gareth Moreton via fpc-devel <fpc-devel@lists.freepascal.org> schrieb am Sa., 25. Mai 2024, 22:18:

    Indeed - I'm not giving up!  I installed Clang via LLVM.  Which
    of the EXE files is actually the assembler?  It's not entirely
    clear (no "clang-as", for example).  (Although I trust it works!)


Simply check what FPC calls. ;)

    I've got some ideas as to how to start debugging. I will solve
    this puzzle!

There is a tool that converts DWARF to CodeView, you can use that to debug with WinDBG.

Regards,
Sven


_______________________________________________
fpc-devel maillist  -fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to