diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-07-20 03:41:06 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-07-20 03:41:06 +0000 |
| commit | 07e66e3ebef8859d7b421ac5778ef92b980a16f3 (patch) | |
| tree | d73be95ae4931aefc9b501a474869a4f2f29dea5 /lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp | |
| parent | 60648578ba6203cb7cc2a4c119c81a6b48af6942 (diff) | |
| download | bcm5719-llvm-07e66e3ebef8859d7b421ac5778ef92b980a16f3.tar.gz bcm5719-llvm-07e66e3ebef8859d7b421ac5778ef92b980a16f3.zip | |
Added KDP resume, suspend, set/remove breakpoint, and kernel version support.
Also we now display a live update of the kexts that we are loading.
llvm-svn: 135563
Diffstat (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 6d33ea28634..2d3a617a239 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -14,6 +14,7 @@ // C++ Includes // Other libraries and framework includes #include "lldb/Core/ConnectionFileDescriptor.h" +#include "lldb/Core/Debugger.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" #include "lldb/Host/Host.h" @@ -183,10 +184,19 @@ ProcessKDP::DoConnectRemote (const char *remote_url) ArchSpec kernel_arch; kernel_arch.SetArchitecture(eArchTypeMachO, cpu, sub); m_target.SetArchitecture(kernel_arch); - SetID (1); UpdateThreadListIfNeeded (); SetPrivateState (eStateStopped); + StreamSP async_strm_sp(m_target.GetDebugger().GetAsyncOutputStream()); + if (async_strm_sp) + { + const char *kernel_version = m_comm.GetKernelVersion (); + if (kernel_version) + { + async_strm_sp->Printf ("KDP connected to %s\n", kernel_version); + async_strm_sp->Flush(); + } + } } } else @@ -237,24 +247,6 @@ ProcessKDP::DoAttachToProcessWithID (lldb::pid_t attach_pid) return error; } -size_t -ProcessKDP::AttachInputReaderCallback (void *baton, - InputReader *reader, - lldb::InputReaderAction notification, - const char *bytes, - size_t bytes_len) -{ - if (notification == eInputReaderGotToken) - { -// ProcessKDP *process = (ProcessKDP *)baton; -// if (process->m_waiting_for_attach) -// process->m_waiting_for_attach = false; - reader->SetIsDone(true); - return 1; - } - return 0; -} - Error ProcessKDP::DoAttachToProcessWithName (const char *process_name, bool wait_for_launch) { @@ -286,7 +278,8 @@ Error ProcessKDP::DoResume () { Error error; - error.SetErrorString ("ProcessKDP::DoResume () is not implemented yet"); + if (!m_comm.SendRequestResume ()) + error.SetErrorString ("KDP resume failed"); return error; } @@ -354,15 +347,8 @@ ProcessKDP::DoHalt (bool &caused_stop) } else { - // TODO: add the ability to halt a running kernel - error.SetErrorString ("halt not supported in kdp-remote plug-in"); -// if (!m_comm.SendInterrupt (locker, 2, caused_stop, timed_out)) -// { -// if (timed_out) -// error.SetErrorString("timed out sending interrupt packet"); -// else -// error.SetErrorString("unknown error sending interrupt packet"); -// } + if (!m_comm.SendRequestSuspend ()) + error.SetErrorString ("KDP halt failed"); } return error; } @@ -574,12 +560,26 @@ ProcessKDP::DoDeallocateMemory (lldb::addr_t addr) Error ProcessKDP::EnableBreakpoint (BreakpointSite *bp_site) { + if (m_comm.LocalBreakpointsAreSupported ()) + { + Error error; + if (!m_comm.SendRequestBreakpoint(true, bp_site->GetLoadAddress())) + error.SetErrorString ("KDP set breakpoint failed"); + return error; + } return EnableSoftwareBreakpoint (bp_site); } Error ProcessKDP::DisableBreakpoint (BreakpointSite *bp_site) { + if (m_comm.LocalBreakpointsAreSupported ()) + { + Error error; + if (!m_comm.SendRequestBreakpoint(false, bp_site->GetLoadAddress())) + error.SetErrorString ("KDP remove breakpoint failed"); + return error; + } return DisableSoftwareBreakpoint (bp_site); } |

