summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-04-18 11:56:21 +0000
committerPavel Labath <labath@google.com>2018-04-18 11:56:21 +0000
commitacebc4379988237f16c7c1167651756b1ac29a90 (patch)
treec6c8187848167601fc3a77a176297a1a2ba84c46 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent90d141a295e2c48505d6c37eca18384803c9f652 (diff)
downloadbcm5719-llvm-acebc4379988237f16c7c1167651756b1ac29a90.tar.gz
bcm5719-llvm-acebc4379988237f16c7c1167651756b1ac29a90.zip
Report more precise error message when attach fails
Summary: If the remote stub sends a specific error message instead of just a E?? code, we can use this to display a more informative error message instead of just the generic "unable to attach" message. I write a test for this using the SB API. On the console this will show up like: (lldb) process attach ... error: attach failed: <STUB-MESSAGE> if the stub supports error messages, or: error: attach failed: Error ?? if it doesn't. Reviewers: jingham, JDevlieghere Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D45573 llvm-svn: 330247
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 9d549ff491b..eafc2eef5b7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -3804,11 +3804,9 @@ thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
response.GetError() == 0x87) {
process->SetExitStatus(-1, "cannot attach to process due to "
"System Integrity Protection");
- }
- // E01 code from vAttach means that the attach failed
- if (::strstr(continue_cstr, "vAttach") != NULL &&
- response.GetError() == 0x1) {
- process->SetExitStatus(-1, "unable to attach");
+ } else if (::strstr(continue_cstr, "vAttach") != NULL &&
+ response.GetStatus().Fail()) {
+ process->SetExitStatus(-1, response.GetStatus().AsCString());
} else {
process->SetExitStatus(-1, "lost connection");
}
OpenPOWER on IntegriCloud