llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

137 lines
3.7 KiB
C
Raw Normal View History

//===-- AppleObjCRuntime.h ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_AppleObjCRuntime_h_
#define liblldb_AppleObjCRuntime_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/LanguageRuntime.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Core/ValueObject.h"
#include "AppleObjCTrampolineHandler.h"
#include "AppleThreadPlanStepThroughObjCTrampoline.h"
namespace lldb_private {
class AppleObjCRuntime :
public lldb_private::ObjCLanguageRuntime
{
public:
virtual ~AppleObjCRuntime() { }
// These are generic runtime functions:
virtual bool
GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope);
virtual bool
GetObjectDescription (Stream &str, ValueObject &object);
virtual bool
CouldHaveDynamicValue (ValueObject &in_value);
virtual bool
GetDynamicTypeAndAddress (ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address);
// These are the ObjC specific functions.
virtual bool
IsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
virtual bool
ReadObjCLibrary (const lldb::ModuleSP &module_sp);
virtual bool
HasReadObjCLibrary ()
{
return m_read_objc_library;
}
virtual lldb::ThreadPlanSP
GetStepThroughTrampolinePlan (Thread &thread, bool stop_others);
virtual bool
IsValidISA(ObjCISA isa)
{
return false;
}
virtual ObjCISA
GetISA(ValueObject& valobj)
{
return 0;
}
virtual ConstString
GetActualTypeName(ObjCISA isa)
{
return ConstString(NULL);
}
virtual ObjCISA
GetParentClass(ObjCISA isa)
{
return 0;
}
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
// Note there is no CreateInstance, Initialize & Terminate functions here, because
// you can't make an instance of this generic runtime.
protected:
virtual bool
CalculateHasNewLiteralsAndIndexing();
static bool
AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
static enum ObjCRuntimeVersions
GetObjCVersion (Process *process, lldb::ModuleSP &objc_module_sp);
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
public:
virtual void
SetExceptionBreakpoints();
LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide an interface to a local or remote debugging platform. By default each host OS that supports LLDB should be registering a "default" platform that will be used unless a new platform is selected. Platforms are responsible for things such as: - getting process information by name or by processs ID - finding platform files. This is useful for remote debugging where there is an SDK with files that might already or need to be cached for debug access. - getting a list of platform supported architectures in the exact order they should be selected. This helps the native x86 platform on MacOSX select the correct x86_64/i386 slice from universal binaries. - Connect to remote platforms for remote debugging - Resolving an executable including finding an executable inside platform specific bundles (macosx uses .app bundles that contain files) and also selecting the appropriate slice of universal files for a given platform. So by default there is always a local platform, but remote platforms can be connected to. I will soon be adding a new "platform" command that will support the following commands: (lldb) platform connect --name machine1 macosx connect://host:port Connected to "machine1" platform. (lldb) platform disconnect macosx This allows LLDB to be well setup to do remote debugging and also once connected process listing and finding for things like: (lldb) process attach --name x<TAB> The currently selected platform plug-in can now auto complete any available processes that start with "x". The responsibilities for the platform plug-in will soon grow and expand. llvm-svn: 127286
2011-03-09 06:40:15 +08:00
virtual void
ClearExceptionBreakpoints ();
virtual bool
ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason);
protected:
Address *
GetPrintForDebuggerAddr();
std::auto_ptr<Address> m_PrintForDebugger_addr;
bool m_read_objc_library;
std::auto_ptr<lldb_private::AppleObjCTrampolineHandler> m_objc_trampoline_handler_ap;
lldb::BreakpointSP m_objc_exception_bp_sp;
AppleObjCRuntime(Process *process) :
lldb_private::ObjCLanguageRuntime(process),
m_read_objc_library (false),
m_objc_trampoline_handler_ap(NULL)
{ } // Call CreateInstance instead.
};
} // namespace lldb_private
#endif // liblldb_AppleObjCRuntime_h_