26 July, 2023

Does EurekaLog support CLang/LLVM/64-bit?

Short Answer

Yes, EurekaLog supports CLang and LLVM in both 32 and 64 bits - with some limitations.

Long Answer


The 64-bit Delphi is build on the classic Borland toolchain. EurekaLog 7 supported 64-bit Delphi since the very begining: the original release of EurekaLog in 2012. Since many of our clients were using the new 64-bit platform, we were also able to improve its support over time. It was feature-complete in somewhere near 2014. Currently it does not have any limitations.

On the other hand, the 64-bit C++ Builder is build on entirely different toolchain: LLVM. Classic toolchain is not used for 64-bit C++ Builder. The CLang is LLVM's frontend for C++. Initially EurekaLog 7 did not have support for LLVM.

While 32-bit C++ Builder was also originally build on the classic Borland toolchain, Embarcadero has released RAD Studio 10 Seattle in 2015 with an option to use the LLVM-based toolchain for 32-bit C++ Builder. In other words, starting with RAD Studio 10 Seattle (2015+):
  • 32-bit Delphi: classic only
  • 64-bit Delphi: classic only
  • 32-bit C++ Builder: classic OR LLVM - your choice
  • 64-bit C++ Builder: LLVM only

Since now CLang was accessible in 32-bit, we also started implementing support for LLVM and CLang. However, not many of our clients use C++ Builder. And very few clients immediately switched to CLang/LLVM. Therefore, we also couldn't polish our CLang/LLVM support as quickly as Delphi's 64-bit support. However, a lot of time has passed and we can say with confidence that many of our clients use EurekaLog for CLang/LLVM today.

Support for 64-bit C++ Builder is a relatively recent addition. It was enabled in 2020. EurekaLog doesn't track usage statistics, so we don't know exactly how many of our clients are using 64-bit C++ Builder. But we can judge this indirectly: by the number of questions to our technical support. And judging by it: almost none of our clients use 64-bit C++ Builder. This means we don't get a lot of feedback and improvements to our 64-bit C++ Builder support are VERY slow.

In summary: while EurekaLog does support CLang, LLVM and 64-bit, you must understand that some aspects had more time to polish and evolve. For these historical reasons, the levels of maturnity (in order from high to low) are:
  1. 32-bit Delphi
  2. 32-bit C++ Builder on classic toolchain
  3. 64-bit Delphi
  4. 32-bit C++ Builder on LLVM toolchain (CLang)
  5. 64-bit C++ Builder

Technical details and limitations

As mentioned above, 32-bit and 64-bit Delphi support and 32-bit C++ Builder on classic toolchain are feature-complete and have no limitations.

Unfortunately, using LLVM (CLang) for 32 or 64-bits means that some exception info is missing. LLVM (or its implementation in C++ Builder) is very unpolished for exception tracing. Specifically, it does not set an exception address, it does not set a valid stack pointer and a frame - all those necessary and important values are just zeros. We really got into the wilds of workarounds and hacks, only to extract the address of the exception. Everything really hangs on straws and assumptions.

Classic C++ Builder is much better in this aspect. We are improving diagnostic as much as possible, so newer versions of EurekaLog should provide better info. But there may be something that is impossible to implement from our side. We highly recommend that you don't use LLVM on 32-bit, use classic compiler. Naturally, you are limited to LLVM only for 64-bit C++ Builder as there is no option to use classic compiler.

Therefore, stack frames based methods will not work if you are using LLVM/CLang compiler (in other words: "Use classic compiler" option is disabled). Select any RAW method for LLVM/CLang.

One other point to consider is the debug information. Delphi, C++ Builder and RAD Studio has an option to generate a text .map file, which contains debug information about the compiled module - such as unit, class, function names and line numbers. Such .map file is used by EurekaLog to compose debug information in EurekaLog's own format - designed for maximum access speed or minimum space. The issue is that .map files produced by the C++ Builder do not have line numbers - just names of units, classes, and functions:
  1. EurekaLog is also able to read debug information in Turbo Debugger (TD32, TDS) format. If it is enabled for C++ Builder - EurekaLog will use it to extract line numbers. So, when using 32-bit C++ Builder on the classic toolchain - EurekaLog will be able to show line numbers in bug reports.
  2. If you would use LLVM/CLang on Win32 (e.g. "Use Classic compiler" option is disabled) or 64-bit C++ Builder (which is LLVM/CLang-only) - then no TD32/TDS debug information will be available, as LLVM/clang generates DWARF debug information, not TD32/TDS. Currently EurekaLog is unable to read DWARF debug information, so there will be no line numbers in bug reports.

You can help us to fix this issue by voting for this entry: [RSP-27359] No line numbers in map files for LLVM-based compilers.