[Lldb-commits] [PATCH] D11455: [MIPS] Create Unix Signals based on target architecture

Greg Clayton clayborg at gmail.com
Thu Jul 23 14:21:59 PDT 2015


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Fix logic as suggested in the second inline code snippet.


================
Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:827
@@ -827,1 +826,3 @@
+        SetUnixSignals(std::make_shared<GDBRemoteSignals>(
+            GetTarget().GetPlatform()->GetUnixSignals()->Create(GetTarget().GetArchitecture())));
 
----------------
UnixSignals::Create() is a static function. If this is really what you are intending to do this should be:

```
if (error.Success())
    SetUnixSignals(UnixSignals::Create(GetTarget().GetArchitecture());
```

But this ins't the intention here. We need to ask if the platform is connected and if so, use the unix signals returned by the platform. It is isn't use UnixSignals::Create(<arch>). So this code should be:

```
if (error.Success())
{
    PlatformSP platform_sp = GetTarget().GetPlatform():
    if (platform_sp && platform_sp->IsConnected())
        SetUnixSignals(platform_sp->GetUnixSignals());
    else
        SetUnixSignals(UnixSignals::Create(GetTarget().GetArchitecture());
}
````


Repository:
  rL LLVM

http://reviews.llvm.org/D11455







More information about the lldb-commits mailing list