summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-05-18 02:38:05 +0000
committerGreg Clayton <gclayton@apple.com>2012-05-18 02:38:05 +0000
commitfa559e5c6e939c7c1570eb2cde3b86aff12abdc7 (patch)
treee81c4c86521f48c02f8a8111fd6ffeb26ec56a1c /lldb/source/Commands
parentf34358e90bf0fa114ff54c488331605ec0627c9c (diff)
downloadbcm5719-llvm-fa559e5c6e939c7c1570eb2cde3b86aff12abdc7.tar.gz
bcm5719-llvm-fa559e5c6e939c7c1570eb2cde3b86aff12abdc7.zip
<rdar://problem/11386214>
<rdar://problem/11455913> "target symbol add" should flush the cached frames "register write" should flush the thread state in case registers modifications change stack llvm-svn: 157042
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp16
2 files changed, 15 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index c34e6eee2e4..37ebb786af9 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -425,6 +425,9 @@ public:
{
if (reg_ctx->WriteRegister (reg_info, reg_value))
{
+ // Toss all frames and anything else in the thread
+ // after a register has been written.
+ exe_ctx.GetThreadRef().Flush();
result.SetStatus (eReturnStatusSuccessFinishNoResult);
return true;
}
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index c7b644f9087..a38f143eb22 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -3585,21 +3585,21 @@ public:
Execute (Args& args,
CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+ Target *target = exe_ctx.GetTargetPtr();
if (target == NULL)
{
result.AppendError ("invalid target, create a debug target using the 'target create' command");
result.SetStatus (eReturnStatusFailed);
- return false;
}
else
{
+ bool flush = false;
const size_t argc = args.GetArgumentCount();
if (argc == 0)
{
result.AppendError ("one or more symbol file paths must be specified");
result.SetStatus (eReturnStatusFailed);
- return false;
}
else
{
@@ -3633,13 +3633,14 @@ public:
ModuleList module_list;
module_list.Append (old_module_sp);
target->ModulesDidLoad (module_list);
+ flush = true;
}
}
else
{
result.AppendError ("one or more executable image paths must be specified");
result.SetStatus (eReturnStatusFailed);
- return false;
+ break;
}
result.SetStatus (eReturnStatusSuccessFinishResult);
}
@@ -3661,6 +3662,13 @@ public:
}
}
}
+
+ if (flush)
+ {
+ Process *process = exe_ctx.GetProcessPtr();
+ if (process)
+ process->Flush();
+ }
}
return result.Succeeded();
}
OpenPOWER on IntegriCloud