[Lldb-commits] [PATCH] D80755: Support build-ids of other sizes than 16 in UUID::SetFromStringRef

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 1 02:05:48 PDT 2020

labath added a reviewer: friss.
labath added inline comments.

Comment at: lldb/source/Utility/UUID.cpp:93-94
+bool UUID::SetFromStringRef(llvm::StringRef str) {
+  const size_t max_uuid_size = 20;
+  const size_t min_uuid_size = 4;
I don't think we should be restricting the size here in any way. It is possible to produce larger build-ids already (-Wl,--build-id=0xlonghexstring), and the rest of the UUID class does support arbitrary sizes. Some tools (e.g. llvm-readelf) will choke on them, but let's try to not make lldb one of those tools.

Using super-short uuids is most likely a bad idea, and will result in a lot of collisions, but if someone really wants to use a 3-byte "uuid", I don't see a reason to stop him here.



More information about the lldb-commits mailing list