2014-05-16 18:51:01 +08:00
|
|
|
//===-- MICmnLLDBDebuggerHandleEvents.h -------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-05-16 18:51:01 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// In-house headers:
|
|
|
|
#include "MICmnBase.h"
|
Add =shlibs-added/=shlibs-removed notifications (MI)
Summary:
This patch adds =shlibs-added/=shlibs-removed notifications in lldb-mi. In more detail:
# Add Target::ModulesDidLoad/ModulesDidUnload notifications
# Improve Target::TargetEventData:
## Refactoring
## Move it back to include/lldb/Target/Target.h
## Add Target::{GetModuleListFromEvent,GetModuleList}; Add Target::m_module_list
# Add SBModule::{GetSymbolVendorMainFileSpec,GetObjectFileHeaderAddress}
# Add SBTarget::{EventIsTaretEvent,GetTargetFromEvent,GetNumModulesFromEvent,GetModuleAtIndexFromEvent}
All tests pass on OS X.
Reviewers: abidh, zturner, jingham, clayborg
Reviewed By: clayborg
Subscribers: jingham, zturner, lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8201
llvm-svn: 231858
2015-03-11 05:59:55 +08:00
|
|
|
#include "MICmnMIValueList.h"
|
2014-05-16 18:51:01 +08:00
|
|
|
#include "MICmnMIValueTuple.h"
|
|
|
|
#include "MIUtilSingletonBase.h"
|
2018-05-26 22:59:14 +08:00
|
|
|
#include "lldb/API/SBEvent.h"
|
2014-05-16 18:51:01 +08:00
|
|
|
|
|
|
|
// Declarations:
|
|
|
|
class CMICmnLLDBDebugSessionInfo;
|
|
|
|
class CMICmnMIResultRecord;
|
|
|
|
class CMICmnStreamStdout;
|
|
|
|
class CMICmnMIOutOfBandRecord;
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//============================================================================
|
2014-11-18 02:06:21 +08:00
|
|
|
// Details: MI class to take LLDB SBEvent objects, filter them and form
|
|
|
|
// MI Out-of-band records from the information inside the event object.
|
|
|
|
// These records are then pushed to stdout.
|
|
|
|
// A singleton class.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
class CMICmnLLDBDebuggerHandleEvents
|
|
|
|
: public CMICmnBase,
|
|
|
|
public MI::ISingleton<CMICmnLLDBDebuggerHandleEvents> {
|
|
|
|
friend class MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>;
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Methods:
|
|
|
|
public:
|
|
|
|
bool Initialize() override;
|
|
|
|
bool Shutdown() override;
|
|
|
|
//
|
|
|
|
bool HandleEvent(const lldb::SBEvent &vEvent, bool &vrbHandledEvent);
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Methods:
|
|
|
|
private:
|
|
|
|
/* ctor */ CMICmnLLDBDebuggerHandleEvents();
|
|
|
|
/* ctor */ CMICmnLLDBDebuggerHandleEvents(
|
|
|
|
const CMICmnLLDBDebuggerHandleEvents &);
|
|
|
|
void operator=(const CMICmnLLDBDebuggerHandleEvents &);
|
|
|
|
//
|
|
|
|
bool ChkForStateChanges();
|
|
|
|
bool GetProcessStdout();
|
|
|
|
bool GetProcessStderr();
|
|
|
|
bool HandleEventSBBreakPoint(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBBreakpointCmn(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBBreakpointAdded(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBBreakpointLocationsAdded(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBProcess(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBTarget(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBThread(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBThreadBitStackChanged(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBThreadSuspended(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleEventSBCommandInterpreter(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleProcessEventBroadcastBitStateChanged(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleProcessEventStateRunning();
|
|
|
|
bool HandleProcessEventStateExited();
|
|
|
|
bool HandleProcessEventStateStopped(const lldb::SBEvent &vrEvent,
|
|
|
|
bool &vwrbShouldBrk);
|
|
|
|
bool HandleProcessEventStopReasonTrace();
|
|
|
|
bool HandleProcessEventStopReasonBreakpoint();
|
|
|
|
bool HandleProcessEventStopSignal(const lldb::SBEvent &vrEvent);
|
|
|
|
bool HandleProcessEventStopException();
|
|
|
|
bool HandleProcessEventStateSuspended(const lldb::SBEvent &vEvent);
|
|
|
|
bool HandleTargetEventBroadcastBitModulesLoaded(const lldb::SBEvent &vEvent);
|
|
|
|
bool
|
|
|
|
HandleTargetEventBroadcastBitModulesUnloaded(const lldb::SBEvent &vEvent);
|
|
|
|
bool MiHelpGetModuleInfo(const lldb::SBModule &vModule,
|
|
|
|
const bool vbWithExtraFields,
|
|
|
|
CMICmnMIOutOfBandRecord &vwrMiOutOfBandRecord);
|
|
|
|
bool MiHelpGetCurrentThreadFrame(CMICmnMIValueTuple &vwrMiValueTuple);
|
|
|
|
bool MiResultRecordToStdout(const CMICmnMIResultRecord &vrMiResultRecord);
|
|
|
|
bool
|
|
|
|
MiOutOfBandRecordToStdout(const CMICmnMIOutOfBandRecord &vrMiResultRecord);
|
|
|
|
bool MiStoppedAtBreakPoint(const MIuint64 vBrkPtId,
|
|
|
|
const lldb::SBBreakpoint &vBrkPt);
|
|
|
|
bool TextToStdout(const CMIUtilString &vrTxt);
|
|
|
|
bool TextToStderr(const CMIUtilString &vrTxt);
|
|
|
|
bool UpdateSelectedThread();
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Overridden:
|
|
|
|
private:
|
|
|
|
// From CMICmnBase
|
|
|
|
/* dtor */ ~CMICmnLLDBDebuggerHandleEvents() override;
|
|
|
|
void InitializeSignals();
|
|
|
|
bool m_bSignalsInitialized;
|
|
|
|
MIuint64 m_SIGINT;
|
|
|
|
MIuint64 m_SIGSTOP;
|
|
|
|
MIuint64 m_SIGSEGV;
|
|
|
|
MIuint64 m_SIGTRAP;
|
2014-05-16 18:51:01 +08:00
|
|
|
};
|