[Lldb-commits] [PATCH] D82382: [lldb][NFC] Replace most uses of StringConvert in LLDB with LLVM's to_integer

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 23 07:58:34 PDT 2020


teemperor marked an inline comment as done.
teemperor added inline comments.


================
Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:1508
     // thread in big endian hex
-    tid = StringConvert::ToUInt64(value.c_str(), LLDB_INVALID_THREAD_ID, 16);
-    if (tid != LLDB_INVALID_THREAD_ID)
+    if (llvm::to_integer(value.c_str(), tid, 16))
       m_thread_ids.push_back(tid);
----------------
Just to get ahead of people pointing this `c_str()` call out: This is just used as we keep inserting null terminators into the `value` string (as a replacement for doing `substr()`), so we actually only want to pass this new substring to `to_integer` and not all of `value`. I'll clean this (and the similar code below) up in a follow-up patch.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D82382





More information about the lldb-commits mailing list