[Lldb-commits] [PATCH] D49207: Get rid of the C-string parameter in DoExecute

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 11 16:22:29 PDT 2018


teemperor created this revision.
teemperor added a reviewer: davide.

This patch gets rid of the C-string parameter in the RawCommandObject::DoExecute function,
making the code simpler and less memory unsafe.

There seems to be a assumption in some command objects that this parameter could be a nullptr,
but from what I can see the rest of the API doesn't actually allow this (and other command
objects and related code pieces dereference this parameter without any checks).

Especially CommandObjectRegexCommand has error handling code for a nullptr that is now gone.


https://reviews.llvm.org/D49207

Files:
  include/lldb/Interpreter/CommandObject.h
  include/lldb/Interpreter/CommandObjectRegexCommand.h
  include/lldb/Interpreter/ScriptInterpreter.h
  source/Commands/CommandObjectCommands.cpp
  source/Commands/CommandObjectExpression.cpp
  source/Commands/CommandObjectExpression.h
  source/Commands/CommandObjectPlatform.cpp
  source/Commands/CommandObjectSettings.cpp
  source/Commands/CommandObjectThread.cpp
  source/Commands/CommandObjectType.cpp
  source/Commands/CommandObjectWatchpoint.cpp
  source/Interpreter/CommandObjectRegexCommand.cpp
  source/Interpreter/CommandObjectScript.cpp
  source/Interpreter/CommandObjectScript.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
  source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
  source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49207.155079.patch
Type: text/x-patch
Size: 35533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180711/dd6514f9/attachment-0001.bin>


More information about the lldb-commits mailing list