2010-11-05 02:30:59 +08:00
|
|
|
//===-- AppleObjCRuntime.h ----------------------------------------*- C++ -*-===//
|
2010-09-23 10:01:19 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-11-05 02:30:59 +08:00
|
|
|
#ifndef liblldb_AppleObjCRuntime_h_
|
|
|
|
#define liblldb_AppleObjCRuntime_h_
|
2010-09-23 10:01:19 +08:00
|
|
|
|
|
|
|
// 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"
|
2010-09-28 09:25:32 +08:00
|
|
|
#include "lldb/Core/ValueObject.h"
|
|
|
|
#include "AppleObjCTrampolineHandler.h"
|
|
|
|
#include "AppleThreadPlanStepThroughObjCTrampoline.h"
|
2010-09-23 10:01:19 +08:00
|
|
|
|
|
|
|
namespace lldb_private {
|
|
|
|
|
2010-11-05 02:30:59 +08:00
|
|
|
class AppleObjCRuntime :
|
2010-09-28 09:25:32 +08:00
|
|
|
public lldb_private::ObjCLanguageRuntime
|
|
|
|
{
|
|
|
|
public:
|
2010-11-05 02:30:59 +08:00
|
|
|
|
2011-06-25 06:03:24 +08:00
|
|
|
virtual ~AppleObjCRuntime() { }
|
2010-09-28 09:25:32 +08:00
|
|
|
|
|
|
|
// These are generic runtime functions:
|
2010-09-30 08:54:27 +08:00
|
|
|
virtual bool
|
|
|
|
GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope);
|
|
|
|
|
2010-09-28 09:25:32 +08:00
|
|
|
virtual bool
|
2011-04-01 07:01:21 +08:00
|
|
|
GetObjectDescription (Stream &str, ValueObject &object);
|
2010-09-28 09:25:32 +08:00
|
|
|
|
2011-04-16 08:01:13 +08:00
|
|
|
virtual bool
|
|
|
|
CouldHaveDynamicValue (ValueObject &in_value);
|
|
|
|
|
|
|
|
virtual bool
|
2011-05-04 11:43:18 +08:00
|
|
|
GetDynamicTypeAndAddress (ValueObject &in_value,
|
|
|
|
lldb::DynamicValueType use_dynamic,
|
|
|
|
TypeAndOrName &class_type_or_name,
|
|
|
|
Address &address);
|
2010-09-28 09:25:32 +08:00
|
|
|
|
|
|
|
// These are the ObjC specific functions.
|
2010-11-05 02:30:59 +08:00
|
|
|
|
2010-09-28 09:25:32 +08:00
|
|
|
virtual bool
|
|
|
|
IsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
ReadObjCLibrary (const lldb::ModuleSP &module_sp);
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
HasReadObjCLibrary ()
|
2010-09-23 10:01:19 +08:00
|
|
|
{
|
2010-09-28 09:25:32 +08:00
|
|
|
return m_read_objc_library;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual lldb::ThreadPlanSP
|
|
|
|
GetStepThroughTrampolinePlan (Thread &thread, bool stop_others);
|
|
|
|
|
2011-08-03 01:27:39 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:25:32 +08:00
|
|
|
//------------------------------------------------------------------
|
|
|
|
// Static Functions
|
|
|
|
//------------------------------------------------------------------
|
2010-11-05 02:30:59 +08:00
|
|
|
// Note there is no CreateInstance, Initialize & Terminate functions here, because
|
|
|
|
// you can't make an instance of this generic runtime.
|
2010-09-28 09:25:32 +08:00
|
|
|
|
2010-11-05 02:30:59 +08:00
|
|
|
protected:
|
2012-03-08 10:39:03 +08:00
|
|
|
virtual bool
|
|
|
|
CalculateHasNewLiteralsAndIndexing();
|
|
|
|
|
2010-11-05 02:30:59 +08:00
|
|
|
static bool
|
|
|
|
AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
|
|
|
|
|
2011-03-25 05:19:54 +08:00
|
|
|
static enum ObjCRuntimeVersions
|
2011-09-17 14:21:20 +08:00
|
|
|
GetObjCVersion (Process *process, lldb::ModuleSP &objc_module_sp);
|
2010-11-05 02:30:59 +08:00
|
|
|
|
2010-09-28 09:25:32 +08:00
|
|
|
//------------------------------------------------------------------
|
|
|
|
// PluginInterface protocol
|
|
|
|
//------------------------------------------------------------------
|
2010-11-05 02:30:59 +08:00
|
|
|
public:
|
2012-03-03 10:05:11 +08:00
|
|
|
virtual void
|
|
|
|
SetExceptionBreakpoints();
|
2011-03-09 06:40:15 +08:00
|
|
|
|
2010-11-04 06:19:38 +08:00
|
|
|
virtual void
|
|
|
|
ClearExceptionBreakpoints ();
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason);
|
2010-09-28 09:25:32 +08:00
|
|
|
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;
|
2010-11-04 06:19:38 +08:00
|
|
|
lldb::BreakpointSP m_objc_exception_bp_sp;
|
2010-09-28 09:25:32 +08:00
|
|
|
|
2010-11-05 02:30:59 +08:00
|
|
|
AppleObjCRuntime(Process *process) :
|
2010-09-28 09:25:32 +08:00
|
|
|
lldb_private::ObjCLanguageRuntime(process),
|
|
|
|
m_read_objc_library (false),
|
|
|
|
m_objc_trampoline_handler_ap(NULL)
|
|
|
|
{ } // Call CreateInstance instead.
|
|
|
|
};
|
2010-09-23 10:01:19 +08:00
|
|
|
|
|
|
|
} // namespace lldb_private
|
|
|
|
|
2010-11-05 02:30:59 +08:00
|
|
|
#endif // liblldb_AppleObjCRuntime_h_
|