コード例 #1
0
ファイル: SBBroadcaster.cpp プロジェクト: ice799/lldb
uint32_t
SBBroadcaster::AddListener (const SBListener &listener, uint32_t event_mask)
{
    if (m_opaque)
        return m_opaque->AddListener (listener.get(), event_mask);
    return 0;
}
コード例 #2
0
void listener_func() {
  while (!g_done) {
    SBEvent event;
    bool got_event = g_listener.WaitForEvent(1, event);
    if (got_event) {
      if (!event.IsValid())
        throw Exception("event is not valid in listener thread");
        // send process description
        SBProcess process = SBProcess::GetProcessFromEvent(event);
        if (!process.IsValid())
            throw Exception("process is not valid");
        if (SBProcess::GetStateFromEvent(event) != lldb::eStateStopped || SBProcess::GetRestartedFromEvent(event))
            continue; // Only interested in "stopped" events.

        SBStream description;

        for (int i = 0; i < process.GetNumThreads(); ++i) {
            // send each thread description
            SBThread thread = process.GetThreadAtIndex(i);
            // send each frame function name
            uint32_t num_frames = thread.GetNumFrames();
            for(int j = 0; j < num_frames; ++j) {
                const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName();
                if (function_name)
                    g_frame_functions.push(string(function_name));
            }
        }
    }
  }
}
コード例 #3
0
ファイル: SBBroadcaster.cpp プロジェクト: ice799/lldb
bool
SBBroadcaster::RemoveListener (const SBListener &listener, uint32_t event_mask)
{
    if (m_opaque)
        return m_opaque->RemoveListener (listener.get(), event_mask);
    return false;
}
コード例 #4
0
void listener_func() {
  while (!g_done) {
    SBEvent event;
    bool got_event = g_listener.WaitForEvent(1, event);
    if (got_event) {
      if (!event.IsValid())
        throw Exception("event is not valid in listener thread");

      // send process description
      SBProcess process = SBProcess::GetProcessFromEvent(event);
      SBStream description;

      for (int i = 0; i < process.GetNumThreads(); ++i) {
        // send each thread description
        description.Clear();
        SBThread thread = process.GetThreadAtIndex(i);
        thread.GetDescription(description);
        g_thread_descriptions.push(description.GetData());

        // send each frame function name
        uint32_t num_frames = thread.GetNumFrames();
        for(int j = 0; j < num_frames; ++j) {
          const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName();
          if (function_name)
            g_frame_functions.push(function_name);
        }
      }
    }
  }
}
コード例 #5
0
void listener_func() {
    while (!g_done) {
        SBEvent event;
        bool got_event = g_listener.WaitForEvent(1, event);
        if (got_event) {
            if (!event.IsValid())
                throw Exception("event is not valid in listener thread");

            SBStream description;
            event.GetDescription(description);
            string str(description.GetData());
            g_event_descriptions.push(str);
        }
    }
}
コード例 #6
0
void listener_func() {
  while (!g_done) {
    SBEvent event;
    bool got_event = g_listener.WaitForEvent(1, event);
    if (got_event) {
      if (!event.IsValid())
        throw Exception("event is not valid in listener thread");

      SBProcess process = SBProcess::GetProcessFromEvent(event);
      if (process.GetState() == eStateStopped) {
        SBError error = process.Continue();
        if (!error.Success())
          throw Exception(string("Cannot continue process from listener thread: ")
                          + error.GetCString());
        g_process_started.push(true);
      }
    }
  }
}
コード例 #7
0
ファイル: SBAttachInfo.cpp プロジェクト: CODECOMMUNITY/lldb
void
SBAttachInfo::SetListener (SBListener &listener)
{
    m_opaque_sp->SetListener(listener.GetSP());
}
コード例 #8
0
ファイル: SBBroadcaster.cpp プロジェクト: ice799/lldb
void
SBBroadcaster::AddInitialEventsToListener (const SBListener &listener, uint32_t requested_events)
{
    if (m_opaque)
        m_opaque->AddInitialEventsToListener (listener.get(), requested_events);
}
コード例 #9
0
ファイル: SBLaunchInfo.cpp プロジェクト: llvm-project/lldb
void SBLaunchInfo::SetListener(SBListener &listener) {
  LLDB_RECORD_METHOD(void, SBLaunchInfo, SetListener, (lldb::SBListener &),
                     listener);

  m_opaque_sp->SetListener(listener.GetSP());
}