[Lldb-commits] [PATCH] D82297: [lldb] Replace StringConvert with llvm::to_integer when parsing integer values in CommandObjects

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 22 06:57:43 PDT 2020


teemperor created this revision.
teemperor added a reviewer: LLDB.
Herald added subscribers: JDevlieghere, abidh.

This replaces the current use of LLDB's own `StringConvert` with LLVM's `to_integer` which
has a less error-prone API and doesn't use special 'error values' to designate parsing problems.

Where needed I also added missing error handling code that prints a parsing error instead of continuing
with the error value returned from `StringConvert` (which either gave a cryptic error message or just took
the error value performed an incorrect action with it. For example, `frame recognizer delete -1`
just deleted the frame recognizer at index 0).


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D82297

Files:
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectPlatform.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py
  lldb/test/API/commands/platform/file/close/TestPlatformFileClose.py
  lldb/test/API/commands/platform/file/read/TestPlatformFileRead.py
  lldb/test/API/commands/process/signal/Makefile
  lldb/test/API/commands/process/signal/TestProcessSignal.py
  lldb/test/API/commands/process/signal/main.cpp
  lldb/test/API/commands/target/modules/search-paths/insert/Makefile
  lldb/test/API/commands/target/modules/search-paths/insert/TestTargetModulesSearchpathsInsert.py
  lldb/test/API/commands/target/modules/search-paths/insert/main.cpp
  lldb/test/API/commands/target/select/TestTargetSelect.py
  lldb/test/API/commands/target/stop-hook/delete/TestTargetStopHookDelete.py
  lldb/test/API/commands/target/stop-hook/disable/TestTargetStopHookDisable.py
  lldb/test/API/commands/target/stop-hook/enable/TestTargetStopHookEnable.py
  lldb/test/API/commands/thread/select/Makefile
  lldb/test/API/commands/thread/select/TestThreadSelect.py
  lldb/test/API/commands/thread/select/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82297.272401.patch
Type: text/x-patch
Size: 24833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200622/c4a31ea3/attachment-0001.bin>


More information about the lldb-commits mailing list