本文整理汇总了C++中SBAddress类的典型用法代码示例。如果您正苦于以下问题:C++ SBAddress类的具体用法?C++ SBAddress怎么用?C++ SBAddress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SBAddress类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: formatBreakpoint
char *
formatBreakpoint (StringB &breakpointdescB, SBBreakpoint breakpoint, STATE *pstate)
{
logprintf (LOG_TRACE, "formatBreakpoint (0x%x, 0x%x, 0x%x)\n", &breakpointdescB, &breakpoint, pstate);
// 18^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000001000/00f58",
// func="main",file="../Sources/tests.cpp",fullname="/pro/runtime-EclipseApplication/tests/Sources/tests.cpp",
// line="17",thread-groups=["i1"],times="0",original-location="/pro/runtime-EclipseApplication/tests/Sources/tests.cpp:17"}
int bpid = breakpoint.GetID();
SBBreakpointLocation location = breakpoint.GetLocationAtIndex(0);
SBAddress addr = location.GetAddress();
uint32_t file_addr=addr.GetFileAddress();
SBFunction function=addr.GetFunction();
const char *func_name=function.GetName();
SBLineEntry line_entry=addr.GetLineEntry();
SBFileSpec filespec = line_entry.GetFileSpec();
const char *filename=filespec.GetFilename();
char filepath[PATH_MAX];
snprintf (filepath, sizeof(filepath), "%s/%s", filespec.GetDirectory(), filename);
uint32_t line=line_entry.GetLine();
const char *dispose = (breakpoint.IsOneShot())? "del": "keep";
const char *originallocation = "";
// originallocation,dispose = breakpoints[bpid]
breakpointdescB.catsprintf (
"{number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"y\",addr=\"0x%016x\","
"func=\"%s\",file=\"%s\",fullname=\"%s\",line=\"%d\","
"thread-groups=[\"%s\"],times=\"0\",original-location=\"%s\"}",
bpid,dispose,file_addr,func_name,filename,
filepath,line,pstate->threadgroup,originallocation);
return breakpointdescB.c_str();
}
示例2: GetStartAddress
SBAddress SBSymbol::GetStartAddress() {
SBAddress addr;
if (m_opaque_ptr && m_opaque_ptr->ValueIsAddress()) {
addr.SetAddress(&m_opaque_ptr->GetAddressRef());
}
return addr;
}
示例3:
SBAddress
SBFunction::GetStartAddress ()
{
SBAddress addr;
if (m_opaque_ptr)
addr.SetAddress (&m_opaque_ptr->GetAddressRange().GetBaseAddress());
return addr;
}
示例4: module_sp
SBSymbolContext
SBModule::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope)
{
SBSymbolContext sb_sc;
ModuleSP module_sp (GetSP ());
if (module_sp && addr.IsValid())
module_sp->ResolveSymbolContextForAddress (addr.ref(), resolve_scope, *sb_sc);
return sb_sc;
}
示例5: SBSymbolContext
SBSymbolContext
SBSymbolContext::GetParentOfInlinedScope(const SBAddress &curr_frame_pc,
SBAddress &parent_frame_addr) const {
SBSymbolContext sb_sc;
if (m_opaque_ap.get() && curr_frame_pc.IsValid()) {
if (m_opaque_ap->GetParentOfInlinedScope(curr_frame_pc.ref(), sb_sc.ref(),
parent_frame_addr.ref()))
return sb_sc;
}
return SBSymbolContext();
}
示例6: GetEndAddress
SBAddress SBSymbol::GetEndAddress() {
SBAddress addr;
if (m_opaque_ptr && m_opaque_ptr->ValueIsAddress()) {
lldb::addr_t range_size = m_opaque_ptr->GetByteSize();
if (range_size > 0) {
addr.SetAddress(&m_opaque_ptr->GetAddressRef());
addr->Slide(m_opaque_ptr->GetByteSize());
}
}
return addr;
}
示例7: SBThreadPlan
SBThreadPlan
SBThreadPlan::QueueThreadPlanForStepInRange(SBAddress &sb_start_address,
lldb::addr_t size, SBError &error) {
if (m_opaque_sp) {
Address *start_address = sb_start_address.get();
if (!start_address) {
return SBThreadPlan();
}
AddressRange range(*start_address, size);
SymbolContext sc;
start_address->CalculateSymbolContext(&sc);
Status plan_status;
SBThreadPlan plan =
SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForStepInRange(
false, range, sc, NULL, eAllThreads, plan_status));
if (plan_status.Fail())
error.SetErrorString(plan_status.AsCString());
return plan;
} else {
return SBThreadPlan();
}
}
示例8: SBThreadPlan
SBThreadPlan
SBThreadPlan::QueueThreadPlanForStepInRange (SBAddress &sb_start_address,
lldb::addr_t size)
{
if (m_opaque_sp)
{
Address *start_address = sb_start_address.get();
if (!start_address)
{
return SBThreadPlan();
}
AddressRange range (*start_address, size);
SymbolContext sc;
start_address->CalculateSymbolContext(&sc);
return SBThreadPlan (m_opaque_sp->GetThread().QueueThreadPlanForStepInRange (false,
range,
sc,
NULL,
eAllThreads));
}
else
{
return SBThreadPlan();
}
}
示例9: QueueThreadPlanForRunToAddress
SBThreadPlan SBThreadPlan::QueueThreadPlanForRunToAddress(SBAddress sb_address,
SBError &error) {
if (m_opaque_sp) {
Address *address = sb_address.get();
if (!address)
return SBThreadPlan();
Status plan_status;
SBThreadPlan plan =
SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForRunToAddress(
false, *address, false, plan_status));
if (plan_status.Fail())
error.SetErrorString(plan_status.AsCString());
return plan;
} else {
return SBThreadPlan();
}
}
示例10: ref
SBAddress::SBAddress (const SBAddress &rhs) :
m_opaque_ap ()
{
if (rhs.IsValid())
ref() = rhs.ref();
}
示例11: formatFrame
char *
formatFrame (StringB &framedescB, SBFrame frame, FrameDetails framedetails)
{
logprintf (LOG_TRACE, "formatFrame (0x%x, 0x%x, 0x%x)\n", &framedescB, &frame, framedetails);
int frameid = frame.GetFrameID();
SBAddress addr = frame.GetPCAddress();
uint32_t file_addr = addr.GetFileAddress();
SBFunction function = addr.GetFunction();
char levelstring[NAME_MAX];
if (framedetails&WITH_LEVEL)
snprintf (levelstring, sizeof(levelstring), "level=\"%d\",", frameid);
else
levelstring[0] = '\0';
const char *modulefilename = "";
SBModule module = frame.GetModule();
if (module.IsValid()) {
SBFileSpec modulefilespec = module.GetPlatformFileSpec();
modulefilename = modulefilespec.GetFilename();
}
const char *func_name="??";
static StringB argsstringB(LINE_MAX);
argsstringB.clear();
if (function.IsValid()) {
const char *filename, *filedir;
int line = 0;
func_name = function.GetName();
SBLineEntry line_entry = addr.GetLineEntry();
SBFileSpec filespec = line_entry.GetFileSpec();
filename = filespec.GetFilename();
filedir = filespec.GetDirectory();
line = line_entry.GetLine();
if (framedetails&WITH_ARGS) {
SBValueList args = frame.GetVariables(1,0,0,0);
static StringB argsdescB(LINE_MAX);
argsdescB.clear();
SBFunction function = frame.GetFunction();
formatVariables (argsdescB, args);
argsstringB.catsprintf ("%sargs=[%s]", (framedetails==JUST_LEVEL_AND_ARGS)?"":",", argsdescB.c_str());
}
if (framedetails==JUST_LEVEL_AND_ARGS)
framedescB.catsprintf ("frame={%s%s}", levelstring, argsstringB.c_str());
else
framedescB.catsprintf ("frame={%saddr=\"0x%016x\",func=\"%s\"%s,file=\"%s\","
"fullname=\"%s/%s\",line=\"%d\"}",
levelstring,file_addr,func_name,argsstringB.c_str(),filename,filedir,filename,line);
}
else {
if (framedetails&WITH_ARGS)
argsstringB.catsprintf ("%sargs=[]", (framedetails==JUST_LEVEL_AND_ARGS)?"":",");
if (framedetails==JUST_LEVEL_AND_ARGS)
framedescB.catsprintf ("frame={%s%s}", levelstring, argsstringB.c_str());
else {
func_name = frame.GetFunctionName();
framedescB.catsprintf ("frame={%saddr=\"0x%016x\",func=\"%s\"%s,file=\"%s\"}",
levelstring, file_addr, func_name, argsstringB.c_str(), modulefilename);
}
}
return framedescB.c_str();
}