diff options
author | Konrad Kleine <kkleine@redhat.com> | 2019-05-23 11:14:47 +0000 |
---|---|---|
committer | Konrad Kleine <kkleine@redhat.com> | 2019-05-23 11:14:47 +0000 |
commit | 248a13057a4adbdb8d511b1458daf39d01a4b520 (patch) | |
tree | 1209fb0822f0c14237eb9935e30da465014a6eda /lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | |
parent | 32d976bac194d78656974e3e05bf52997a06f509 (diff) | |
download | bcm5719-llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.tar.gz bcm5719-llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.zip |
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.
This is the command I ran and I to fix and format the code base:
```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```
NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
Diffstat (limited to 'lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index dea7ccf0422..9c52b59e2b0 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -109,7 +109,8 @@ Status PlatformRemoteGDBServer::ResolveExecutable( if (resolved_module_spec.GetArchitecture().IsValid() || resolved_module_spec.GetUUID().IsValid()) { error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp, - module_search_paths_ptr, NULL, NULL); + module_search_paths_ptr, nullptr, + nullptr); if (exe_module_sp && exe_module_sp->GetObjectFile()) return error; @@ -123,7 +124,8 @@ Status PlatformRemoteGDBServer::ResolveExecutable( idx, resolved_module_spec.GetArchitecture()); ++idx) { error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp, - module_search_paths_ptr, NULL, NULL); + module_search_paths_ptr, nullptr, + nullptr); // Did we find an executable using one of the if (error.Success()) { if (exe_module_sp && exe_module_sp->GetObjectFile()) @@ -333,7 +335,7 @@ Status PlatformRemoteGDBServer::DisconnectRemote() { const char *PlatformRemoteGDBServer::GetHostname() { m_gdb_client.GetHostname(m_name); if (m_name.empty()) - return NULL; + return nullptr; return m_name.c_str(); } @@ -469,11 +471,11 @@ lldb::ProcessSP PlatformRemoteGDBServer::DebugProcess( error.SetErrorStringWithFormat("unable to launch a GDB server on '%s'", GetHostname()); } else { - if (target == NULL) { + if (target == nullptr) { TargetSP new_target_sp; error = debugger.GetTargetList().CreateTarget( - debugger, "", "", eLoadDependentsNo, NULL, new_target_sp); + debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp); target = new_target_sp.get(); } else error.Clear(); @@ -484,7 +486,7 @@ lldb::ProcessSP PlatformRemoteGDBServer::DebugProcess( // The darwin always currently uses the GDB remote debugger plug-in // so even when debugging locally we are debugging remotely! process_sp = target->CreateProcess(launch_info.GetListener(), - "gdb-remote", NULL); + "gdb-remote", nullptr); if (process_sp) { error = process_sp->ConnectRemote(nullptr, connect_url.c_str()); @@ -555,11 +557,11 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach( error.SetErrorStringWithFormat("unable to launch a GDB server on '%s'", GetHostname()); } else { - if (target == NULL) { + if (target == nullptr) { TargetSP new_target_sp; error = debugger.GetTargetList().CreateTarget( - debugger, "", "", eLoadDependentsNo, NULL, new_target_sp); + debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp); target = new_target_sp.get(); } else error.Clear(); @@ -569,8 +571,9 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach( // The darwin always currently uses the GDB remote debugger plug-in // so even when debugging locally we are debugging remotely! - process_sp = target->CreateProcess( - attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL); + process_sp = + target->CreateProcess(attach_info.GetListenerForProcess(debugger), + "gdb-remote", nullptr); if (process_sp) { error = process_sp->ConnectRemote(nullptr, connect_url.c_str()); if (error.Success()) { |