[Lldb-commits] [lldb] [lldb] Fix crash when adding members to an "incomplete" type (PR #102116)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 6 06:10:31 PDT 2024


================
@@ -0,0 +1,23 @@
+// RUN: %clangxx --target=x86_64-pc-linux -o %t -c %s -g
----------------
labath wrote:

> This would only crash with -flimit-debug-info right?
Correct. The type definition needs to be absent from the binary and the ~only way to achieve that is to compile at least a part of it with -flimit-debug-info. I will add that explicitly.

> Not sure what the intent behind the x86 directory is but it would be nice to get the coverage when running this on ARM machines too

The x86 directory is conditionalized on the x86 target, so it will run whenever the local build supports the x86 architecture (ie `X86` is in `LLVM_TARGETS_TO_BUILD`), regardless of the actual host architecture. (i.e., it works the same as as `x86` directories in llvm)

The goal here isn't so much to hardcode the architecture (to x86), as much it is to hardcode the file format (to non-windows). We don't support working with unlinked object files on windows, and if I tried to link things then I'd need to depend on the linker and pull in other platform-specific stuff, which would make the test non-minimal.

The thing I like about a test like this is that it (again, like the llvm tests) runs the same way everywhere, so there's little risk of needing to scrable to find a freebsd-mips (I'm exaggerating, I know) machine to reproduce a problem somewhere. (And I would totally love if we had more tests hardcoding aarch64-macosx triples so I can get more macos coverage without switching to a mac machine)

https://github.com/llvm/llvm-project/pull/102116


More information about the lldb-commits mailing list