本文整理汇总了C++中PropertyValue::mAccessFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyValue::mAccessFunc方法的具体用法?C++ PropertyValue::mAccessFunc怎么用?C++ PropertyValue::mAccessFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyValue
的用法示例。
在下文中一共展示了PropertyValue::mAccessFunc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_dwarf_object_property
int read_dwarf_object_property(Context * Ctx, int Frame, ObjectInfo * Obj, int Attr, PropertyValue * Value) {
Trap trap;
memset(Value, 0, sizeof(PropertyValue));
Value->mContext = Ctx;
Value->mFrame = Frame;
Value->mObject = Obj;
Value->mAttr = Attr;
Value->mBigEndian = Obj->mCompUnit->mFile->big_endian;
if (Attr == AT_location && Obj->mLowPC != 0) {
Value->mValue = Obj->mLowPC;
return 0;
}
sCompUnit = Obj->mCompUnit;
sCache = (DWARFCache *)sCompUnit->mFile->dwarf_dt_cache;
sDebugSection = sCompUnit->mSection;
dio_EnterDebugSection(&sCompUnit->mDesc, sDebugSection, Obj->mID - sDebugSection->addr);
if (set_trap(&trap)) {
gop_gAttr = Attr;
gop_gForm = 0;
dio_ReadEntry(get_object_property_callback);
clear_trap(&trap);
}
dio_ExitSection();
sCompUnit = NULL;
sCache = NULL;
sDebugSection = NULL;
if (trap.error) return -1;
switch (Value->mForm = gop_gForm) {
case FORM_REF :
case FORM_REF_ADDR :
case FORM_REF1 :
case FORM_REF2 :
case FORM_REF4 :
case FORM_REF8 :
case FORM_REF_UDATA :
{
ObjectInfo * RefObj = find_object(sCache, gop_gFormRef);
PropertyValue ValueAddr;
if (read_and_evaluate_dwarf_object_property(Ctx, Frame, 0, RefObj, AT_location, &ValueAddr) < 0) return -1;
if (ValueAddr.mAccessFunc != NULL) {
ValueAddr.mAccessFunc(&ValueAddr, 0, &Value->mValue);
}
else {
static U1_T Buf[8];
PropertyValue ValueSize;
ContextAddress Addr;
size_t Size;
Addr = (ContextAddress)get_numeric_property_value(&ValueAddr);
if (read_and_evaluate_dwarf_object_property(Ctx, Frame, Addr, RefObj, AT_byte_size, &ValueSize) < 0) return -1;
Size = (size_t)get_numeric_property_value(&ValueSize);
if (Size < 1 || Size > sizeof(Buf)) {
errno = ERR_INV_DATA_TYPE;
return -1;
}
if (context_read_mem(Ctx, Addr, Buf, Size) < 0) return -1;
check_breakpoints_on_memory_read(Ctx, Addr, Buf, Size);
Value->mAddr = Buf;
Value->mSize = Size;
}
}
break;
case FORM_DATA1 :
case FORM_DATA2 :
case FORM_DATA4 :
case FORM_DATA8 :
case FORM_FLAG :
case FORM_BLOCK1 :
case FORM_BLOCK2 :
case FORM_BLOCK4 :
case FORM_BLOCK :
Value->mAddr = gop_gFormDataAddr;
Value->mSize = gop_gFormDataSize;
break;
case FORM_SDATA :
case FORM_UDATA :
Value->mValue = gop_gFormData;
break;
default:
errno = ENOENT;
return -1;
}
return 0;
}