summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-11-22 01:42:44 +0000
committerJim Ingham <jingham@apple.com>2014-11-22 01:42:44 +0000
commit893c932acf365b99298de2ac6017454af961fb84 (patch)
treea32cbc3f70e1e1c93f21c6b639bf2e419d002da0 /lldb/source/Commands
parent0f17c5570d2541a90cb963e740cd20b19adcbc67 (diff)
downloadbcm5719-llvm-893c932acf365b99298de2ac6017454af961fb84.tar.gz
bcm5719-llvm-893c932acf365b99298de2ac6017454af961fb84.zip
This is the first step of making lldb able to create target-specific things
(e.g. breakpoints, stop-hooks) before we have any targets - for instance in your ~/.lldbinit file. These will then get copied over to any new targets that get created. So far, you can only make stop-hooks. Breakpoints will have to learn to move themselves from target to target for us to get them from no-target to new-target. We should also make a command & SB API way to prime this ur-target. llvm-svn: 222600
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp16
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp8
3 files changed, 13 insertions, 13 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 13bf1278c78..fb8a1814c64 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -367,8 +367,8 @@ protected:
DoExecute (Args& command,
CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
- if (target == NULL)
+ Target *target = GetSelectedOrDummyTarget();
+ if (target == nullptr)
{
result.AppendError ("Invalid target. Must set target before setting breakpoints (see 'target create' command).");
result.SetStatus (eReturnStatusFailed);
@@ -925,7 +925,7 @@ protected:
virtual bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target == NULL)
{
result.AppendError ("Invalid target. No existing target or breakpoints.");
@@ -1055,7 +1055,7 @@ protected:
virtual bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target == NULL)
{
result.AppendError ("Invalid target. No existing target or breakpoints.");
@@ -1175,7 +1175,7 @@ protected:
virtual bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target == NULL)
{
result.AppendError ("Invalid target. No existing target or breakpoints.");
@@ -1356,7 +1356,7 @@ protected:
virtual bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target == NULL)
{
result.AppendError ("Invalid target. No current target or breakpoints.");
@@ -1540,7 +1540,7 @@ protected:
virtual bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target == NULL)
{
result.AppendError ("Invalid target. No existing target or breakpoints.");
@@ -1671,7 +1671,7 @@ protected:
virtual bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target == NULL)
{
result.AppendError ("Invalid target. No existing target or breakpoints.");
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index d36e3dbbc5d..b4c559c81cc 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -281,7 +281,7 @@ CommandObjectExpression::EvaluateExpression
Target *target = exe_ctx.GetTargetPtr();
if (!target)
- target = Host::GetDummyTarget(m_interpreter.GetDebugger()).get();
+ target = GetDummyTarget();
if (target)
{
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index e46cf70697c..150fff7f37d 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -5019,7 +5019,7 @@ protected:
{
m_stop_hook_sp.reset();
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target)
{
Target::StopHookSP new_hook_sp = target->CreateStopHook();
@@ -5171,7 +5171,7 @@ protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target)
{
// FIXME: see if we can use the breakpoint id style parser?
@@ -5247,7 +5247,7 @@ protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (target)
{
// FIXME: see if we can use the breakpoint id style parser?
@@ -5317,7 +5317,7 @@ protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ Target *target = GetSelectedOrDummyTarget();
if (!target)
{
result.AppendError ("invalid target\n");
OpenPOWER on IntegriCloud