summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-07-17 10:27:42 +0000
committerPavel Labath <labath@google.com>2015-07-17 10:27:42 +0000
commite4fc4ef4635b696a7933bc1dcc748f500a9128b2 (patch)
tree7f72f1e39cbc2855017f423f54bdd958007b3e63 /lldb/source/Plugins/Process/gdb-remote
parent15ef9475492dd4218281d4b5ea70319896e356f8 (diff)
downloadbcm5719-llvm-e4fc4ef4635b696a7933bc1dcc748f500a9128b2.tar.gz
bcm5719-llvm-e4fc4ef4635b696a7933bc1dcc748f500a9128b2.zip
[LLGS] Limit jThreadsInfo to only the most important registers for now
Summary: It seems that reading of register data is the biggest bottleneck in LLGS at the moment. Sending four registers instead of the full GPR set increases the jThreadsInfo processing time about 6-fold. Until we figure out where is this time going, this commit limits the amount of data we send to provide a more fluid debugging experience. Reviewers: tberghammer, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11264 llvm-svn: 242517
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index fc3361ee97d..a64b7def8b8 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -468,19 +468,34 @@ GetRegistersAsJSON(NativeThreadProtocol &thread)
return nullptr;
JSONObject::SP register_object_sp = std::make_shared<JSONObject>();
+
+#ifdef LLDB_JTHREADSINFO_FULL_REGISTER_SET
// Expedite all registers in the first register set (i.e. should be GPRs) that are not contained in other registers.
const RegisterSet *reg_set_p = reg_ctx_sp->GetRegisterSet(0);
if (! reg_set_p)
return nullptr;
-
for (const uint32_t *reg_num_p = reg_set_p->registers; *reg_num_p != LLDB_INVALID_REGNUM; ++reg_num_p)
{
- const RegisterInfo *const reg_info_p = reg_ctx_sp->GetRegisterInfoAtIndex(*reg_num_p);
+ uint32_t reg_num = *reg_num_p;
+#else
+ // Expedite only a couple of registers until we figure out why sending registers is
+ // expensive.
+ static const uint32_t k_expedited_registers[] = {
+ LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_SP, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_RA
+ };
+ for (uint32_t generic_reg: k_expedited_registers)
+ {
+ uint32_t reg_num = reg_ctx_sp->ConvertRegisterKindToRegisterNumber(eRegisterKindGeneric, generic_reg);
+ if (reg_num == LLDB_INVALID_REGNUM)
+ continue; // Target does not support the given register.
+#endif
+
+ const RegisterInfo *const reg_info_p = reg_ctx_sp->GetRegisterInfoAtIndex(reg_num);
if (reg_info_p == nullptr)
{
if (log)
log->Printf("%s failed to get register info for register index %" PRIu32,
- __FUNCTION__, *reg_num_p);
+ __FUNCTION__, reg_num);
continue;
}
@@ -493,7 +508,7 @@ GetRegistersAsJSON(NativeThreadProtocol &thread)
{
if (log)
log->Printf("%s failed to read register '%s' index %" PRIu32 ": %s", __FUNCTION__,
- reg_info_p->name ? reg_info_p->name : "<unnamed-register>", *reg_num_p,
+ reg_info_p->name ? reg_info_p->name : "<unnamed-register>", reg_num,
error.AsCString ());
continue;
}
@@ -501,7 +516,7 @@ GetRegistersAsJSON(NativeThreadProtocol &thread)
StreamString stream;
WriteRegisterValueInHexFixedWidth(stream, reg_ctx_sp, *reg_info_p, &reg_value);
- register_object_sp->SetObject(std::to_string(*reg_num_p),
+ register_object_sp->SetObject(std::to_string(reg_num),
std::make_shared<JSONString>(stream.GetString()));
}
OpenPOWER on IntegriCloud