[Lldb-commits] [PATCH] D128268: [lldb] Fix reading i686-windows executables with GNU environment

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 21 06:58:26 PDT 2022


DavidSpickett added a comment.

> However, after this commit, if the object file is advertised with the different environment (either when built in a mingw environment, or if that setting is set), the fat binary validation won't accept the file any longer.

Is "this commit" referring to https://reviews.llvm.org/rG25c8a061c5739677d2fc0af29a8cc9520207b923 or to the change we're reviewing here?

I'm struggling to think through what this is actually fixing. Is the issue that one half of a fat binary can have a different ABI? Wouldn't both sides of the fat binary be loaded as the ABI chosen in the setting, or is that exactly what you're fixing.



================
Comment at: lldb/source/Utility/ArchSpec.cpp:986
+
+  if (lhs_triple_vendor != rhs_triple_vendor) {
+    // On Windows, the vendor field doesn't have any practical effect, but
----------------
You could use `isOSWindows` if you want. Maybe use an intermediate bool to clear up the if statement.
```
bool both_windows = lhs_triple.isOSWindows() && rhs_triple.isOSWindows();
if ((lhs_triple_vendor != rhs_triple_vendor) && 
(exact_match || !both_windows)) {
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128268



More information about the lldb-commits mailing list