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
This commit is contained in:
Ilia K
2015-03-10 21:59:55 +00:00
parent 501d5e9f66
commit eb2c19a549
12 changed files with 391 additions and 79 deletions

View File

@@ -13,8 +13,9 @@
#include "lldb/lldb-public.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBBreakpoint.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBExpressionOptions.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBListener.h"
@@ -129,6 +130,32 @@ SBTarget::~SBTarget()
{
}
bool
SBTarget::EventIsTargetEvent (const SBEvent &event)
{
return Target::TargetEventData::GetEventDataFromEvent(event.get()) != NULL;
}
SBTarget
SBTarget::GetTargetFromEvent (const SBEvent &event)
{
return Target::TargetEventData::GetTargetFromEvent (event.get());
}
uint32_t
SBTarget::GetNumModulesFromEvent (const SBEvent &event)
{
const ModuleList module_list = Target::TargetEventData::GetModuleListFromEvent (event.get());
return module_list.GetSize();
}
SBModule
SBTarget::GetModuleAtIndexFromEvent (const uint32_t idx, const SBEvent &event)
{
const ModuleList module_list = Target::TargetEventData::GetModuleListFromEvent (event.get());
return SBModule(module_list.GetModuleAtIndex(idx));
}
const char *
SBTarget::GetBroadcasterClassName ()
{