[PATCH] D143760: [Codeview] Fix incorrect size determination for complex types.

Steve Merritt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 07:12:31 PST 2023


smerritt added a comment.

Unfortunately, neither the Visual Studio debugger (no extensions installed) nor WinDbg appear to be capable of displaying the value of variables encoded with one of the complex numeric leaves, even for C code.  Given that the MS C compiler doesn't emit these and they no longer have a Fortran compiler, its not completely surprising.  The Visual Studio debugger will display these values for Fortran variables if the Intel Fortran Expression Evaluator extension is installed into VS.  I don't know of any other Windows debuggers still in production that will display these variables.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1798
+    // an individual component.
     switch (ByteSize) {
+    case 4:  STK = SimpleTypeKind::Complex16;  break;
----------------
hans wrote:
> What happens if ByteSize is 2 here now? Should we assert?
Any unrecognized sizes coming through this routine for any of the basic types will result in the type of the associated variable being "None".  This means the variable will still be present in the debug info but it's type will be unknown so a debugger won't know how to display its value.  A user still be able to see the variable exists and might be able to use a typecast in the debugger to inspect that value.


================
Comment at: llvm/test/DebugInfo/COFF/fortran-basic.ll:1
 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
 ;
----------------
hans wrote:
> I assume the file mode change is unintentional?
Yes, I'll fix that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143760/new/

https://reviews.llvm.org/D143760



More information about the llvm-commits mailing list