diff options
author | Greg Clayton <gclayton@apple.com> | 2011-05-19 03:54:16 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-05-19 03:54:16 +0000 |
commit | af247d7b98c9bfac07602907c34a4bf5bac806b0 (patch) | |
tree | 050933809c9aac94fd63199d49b32621993baad6 /lldb/source/Target/ThreadPlanCallFunction.cpp | |
parent | 41025dc95bd215cf5aeb5e3eb675f835183e1f7e (diff) | |
download | bcm5719-llvm-af247d7b98c9bfac07602907c34a4bf5bac806b0.tar.gz bcm5719-llvm-af247d7b98c9bfac07602907c34a4bf5bac806b0.zip |
Fixed a crasher that was happened when a log shared pointer wasn't valid.
Fixed ThreadPlanCallFunction::ReportRegisterState(...) to only dump when
verbose logging is enabled and fixed the function to use the new
RegisterValue method of reading registers.
Fixed the GDB remote client to not send a continue packet after receiving
stdout or stderr from the inferior process.
llvm-svn: 131628
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanCallFunction.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 7d798fc6b20..40ee45f749b 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -197,8 +197,9 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, m_start_addr = objectFile->GetEntryPointAddress(); if (!m_start_addr.IsValid()) { - log->Printf ("Could not find entry point address for executable module \"%s\".", - executableModuleSP->GetFileSpec().GetFilename().AsCString()); + if (log) + log->Printf ("Could not find entry point address for executable module \"%s\".", + executableModuleSP->GetFileSpec().GetFilename().AsCString()); return; } } @@ -247,22 +248,28 @@ ThreadPlanCallFunction::~ThreadPlanCallFunction () void ThreadPlanCallFunction::ReportRegisterState (const char *message) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP | LIBLLDB_LOG_VERBOSE)); if (log) { + StreamString strm; RegisterContext *reg_ctx = m_thread.GetRegisterContext().get(); log->PutCString(message); - for (uint32_t register_index = 0, num_registers = reg_ctx->GetRegisterCount(); - register_index < num_registers; - ++register_index) + RegisterValue reg_value; + + for (uint32_t reg_idx = 0, num_registers = reg_ctx->GetRegisterCount(); + reg_idx < num_registers; + ++reg_idx) { - const char *register_name = reg_ctx->GetRegisterName(register_index); - uint64_t register_value = reg_ctx->ReadRegisterAsUnsigned(register_index, LLDB_INVALID_ADDRESS); - - log->Printf(" %s = 0x%llx", register_name, register_value); + const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx); + if (reg_ctx->ReadRegister(reg_info, reg_value)) + { + reg_value.Dump(&strm, reg_info, true, false, eFormatDefault); + strm.EOL(); + } } + log->PutCString(strm.GetData()); } } |