jasonmolenda created this revision.
jasonmolenda added a reviewer: JDevlieghere.
jasonmolenda added a project: LLDB.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.
debugserver is sometimes run in bringup environments, where debugserver doesn't
yet recognize its platform code. debugserver will crash shortly after when
strlen() is run on the nullptr returned, creating a std::string.
Instead, have debugserver return an empty platform name back up to lldb. lldb
is in a better position to handle a triple with a missing component and surface
an error message to the user, instead of having debugserver cease to be running.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D136719
Files:
lldb/tools/debugserver/source/MacOSX/MachProcess.mm
Index: lldb/tools/debugserver/source/MacOSX/MachProcess.mm
===================================================================
--- lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -743,7 +743,10 @@
case PLATFORM_DRIVERKIT:
return "driverkit";
}
- return nullptr;
+ DNBLogError(
+ "Unknown platform %u found for one binary, returning empty string",
+ platform);
+ return "";
}
static bool mach_header_validity_test(uint32_t magic, uint32_t cputype) {
Index: lldb/tools/debugserver/source/MacOSX/MachProcess.mm
===================================================================
--- lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -743,7 +743,10 @@
case PLATFORM_DRIVERKIT:
return "driverkit";
}
- return nullptr;
+ DNBLogError(
+ "Unknown platform %u found for one binary, returning empty string",
+ platform);
+ return "";
}
static bool mach_header_validity_test(uint32_t magic, uint32_t cputype) {
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits