llvm-project/lldb/source/Target
Raphael Isemann bbea361039 [lldb][NFC] Remove all uses of StringRef::withNullAsEmpty in LLDB
A long time ago LLDB wanted to start using StringRef instead of
C-Strings/ConstString but was blocked by the fact that the StringRef constructor
that takes a C-string was asserting that the C-string isn't a nullptr. To
workaround this, D24697 introduced a special function called `withNullAsEmpty`
and that's what LLDB (and only LLDB) started to use to build StringRefs from
C-strings.

A bit later it seems that `withNullAsEmpty` was declared too awkward to use and
instead the assert in the StringRef constructor got removed (see D24904). The
rest of LLDB was then converted to StringRef by just calling the now perfectly
usable implicit constructor.

However, all the calls to `withNullAsEmpty` just remained and are now just
strange artefacts in the code base that just look out of place. It's also
curiously a LLDB-exclusive function and no other project ever called it since
it's introduction half a decade ago.

This patch removes all uses of `withNullAsEmpty`. The follow up will be to
remove the function from StringRef.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D102597
2021-05-18 09:41:20 +02:00
..
ABI.cpp Make the error condition in Value::ValueType explicit (NFC) 2021-02-12 16:12:31 -08:00
AssertFrameRecognizer.cpp The AssertRecognizer used the module from a frames SC without checking it was non-null. 2020-11-13 11:41:32 -08:00
CMakeLists.txt [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
ExecutionContext.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
InstrumentationRuntime.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
InstrumentationRuntimeStopInfo.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
JITLoader.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
JITLoaderList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Language.cpp Rename human-readable name for DW_LANG_Mips_Assembler 2021-05-12 19:13:58 -07:00
LanguageRuntime.cpp Add setting to disable LanguageRuntime UnwindPlans 2021-04-08 13:28:59 -07:00
Memory.cpp [LLDB] Fix AddressSanitizer failure in MemoryCache 2020-02-27 11:17:10 -08:00
MemoryHistory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
MemoryRegionInfo.cpp [lldb][AArch64/Linux] Show memory tagged memory regions 2020-11-20 11:21:59 +00:00
ModuleCache.cpp [lldb] Use std::make_unique<> (NFC) 2020-06-24 17:48:40 -07:00
OperatingSystem.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
PathMappingList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Platform.cpp [lldb] "target create" shouldn't save target if the command failed 2020-12-12 16:40:58 +03:00
Process.cpp Revert "Reset the wakeup timeout when we re-enter the continue wait." 2021-05-17 15:37:26 -07:00
ProcessTrace.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
Queue.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
QueueItem.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
QueueList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContext.cpp LanguageRuntime for 0th frame unwind, simplify getting pc-for-symbolication 2021-03-03 19:29:40 -08:00
RegisterContextUnwind.cpp [lldb] Fixup more code addresses 2021-05-13 10:27:22 -07:00
RegisterNumber.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RemoteAwarePlatform.cpp [lldb] Move PlatformPOSIX::ConnectToWaitingProcesses to RemoteAwarePlatform 2021-03-14 22:43:52 +01:00
SectionLoadHistory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SectionLoadList.cpp [lldb] Switch Section-dumping code to raw_ostream 2020-05-14 11:59:18 +02:00
StackFrame.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
StackFrameList.cpp [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
StackFrameRecognizer.cpp [lldb] Make deleting frame recognizers actually work 2020-07-23 17:43:37 +02:00
StackID.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
StopInfo.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
StructuredDataPlugin.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SystemRuntime.cpp [lldb] Have LanguageRuntime and SystemRuntime share a base class (NFC) 2020-07-24 16:28:34 -07:00
Target.cpp Change Target::ReadMemory to ensure the amount of memory read from the file-cache is the amount requested. 2021-05-11 13:07:11 -03:00
TargetList.cpp [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
TargetProperties.td Revert "Reset the wakeup timeout when we re-enter the continue wait." 2021-05-17 15:37:26 -07:00
Thread.cpp [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
ThreadCollection.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadList.cpp Allow the ThreadPlanStackMap to hold the thread plans for threads 2020-04-03 14:56:28 -07:00
ThreadPlan.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanBase.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanCallFunction.cpp [lldb] Minor refinements to ThreadPlan::RestoreThreadState (NFC) 2021-02-15 17:57:13 -08:00
ThreadPlanCallFunctionUsingABI.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanCallOnFunctionExit.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadPlanCallUserExpression.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanPython.cpp Add a setting to force stepping to always run all threads. 2020-08-07 14:47:31 -07:00
ThreadPlanRunToAddress.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanShouldStopHere.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ThreadPlanStack.cpp [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC) 2021-03-04 21:46:49 -08:00
ThreadPlanStepInRange.cpp [lldb][NFC] Remove all uses of StringRef::withNullAsEmpty in LLDB 2021-05-18 09:41:20 +02:00
ThreadPlanStepInstruction.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOut.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOverBreakpoint.cpp [lldb] Remove duplicated ThreadPlanStepOverBreakpoint comment 2021-03-08 22:34:56 -08:00
ThreadPlanStepOverRange.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanStepRange.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
ThreadPlanStepThrough.cpp [lldb] Remove very old misleading comment (NFC) 2021-02-15 18:14:57 -08:00
ThreadPlanStepUntil.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanTracer.cpp [lldb] Remove unused ThreadPlan tracer utilities (NFC) 2021-02-15 17:59:25 -08:00
ThreadPostMortemTrace.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
ThreadSpec.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Trace.cpp [trace] Dedup different source lines when dumping instructions + refactor 2021-05-04 19:40:52 -07:00
TraceSessionFileParser.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
UnixSignals.cpp [lldb] Format remaining signal table (NFC) 2020-10-08 21:51:41 -07:00
UnwindAssembly.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
UnwindLLDB.cpp LanguageRuntime for 0th frame unwind, simplify getting pc-for-symbolication 2021-03-03 19:29:40 -08:00