本文整理汇总了C++中builtin_type函数的典型用法代码示例。如果您正苦于以下问题:C++ builtin_type函数的具体用法?C++ builtin_type怎么用?C++ builtin_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了builtin_type函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: jit_read_code_entry
static void
jit_read_code_entry (struct gdbarch *gdbarch,
CORE_ADDR code_addr, struct jit_code_entry *code_entry)
{
int err;
struct type *ptr_type;
int ptr_size;
int entry_size;
gdb_byte *entry_buf;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* Figure out how big the entry is on the remote and how to read it. */
ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
ptr_size = TYPE_LENGTH (ptr_type);
entry_size = 3 * ptr_size + 8; /* Three pointers and one 64-bit int. */
entry_buf = alloca (entry_size);
/* Read the entry. */
err = target_read_memory (code_addr, entry_buf, entry_size);
if (err)
error (_("Unable to read JIT code entry from remote memory!"));
/* Fix the endianness to match the host. */
ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
code_entry->next_entry = extract_typed_address (&entry_buf[0], ptr_type);
code_entry->prev_entry =
extract_typed_address (&entry_buf[ptr_size], ptr_type);
code_entry->symfile_addr =
extract_typed_address (&entry_buf[2 * ptr_size], ptr_type);
code_entry->symfile_size =
extract_unsigned_integer (&entry_buf[3 * ptr_size], 8, byte_order);
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:32,代码来源:jit.c
示例2: obsd_auxv_parse
static int
obsd_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{
struct type *int_type = builtin_type (gdbarch)->builtin_int;
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
const int sizeof_auxv_type = TYPE_LENGTH (int_type);
const int sizeof_auxv_val = TYPE_LENGTH (ptr_type);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
gdb_byte *ptr = *readptr;
if (endptr == ptr)
return 0;
if (endptr - ptr < 2 * sizeof_auxv_val)
return -1;
*typep = extract_unsigned_integer (ptr, sizeof_auxv_type, byte_order);
ptr += sizeof_auxv_val; /* Alignment. */
*valp = extract_unsigned_integer (ptr, sizeof_auxv_val, byte_order);
ptr += sizeof_auxv_val;
*readptr = ptr;
return 1;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:25,代码来源:obsd-tdep.c
示例3: xstormy16_register_type
static struct type *
xstormy16_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum == E_PC_REGNUM)
return builtin_type (gdbarch)->builtin_uint32;
else
return builtin_type (gdbarch)->builtin_uint16;
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:8,代码来源:xstormy16-tdep.c
示例4: tilegx_register_type
static struct type *
tilegx_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum == TILEGX_PC_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
else
return builtin_type (gdbarch)->builtin_uint64;
}
开发者ID:Cookfeces,项目名称:binutils-gdb,代码行数:8,代码来源:tilegx-tdep.c
示例5: unknown_language_arch_info
static void
unknown_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
lai->string_char_type = builtin_type (gdbarch)->builtin_char;
lai->bool_type_default = builtin_type (gdbarch)->builtin_int;
lai->primitive_type_vector = GDBARCH_OBSTACK_CALLOC (gdbarch, 1,
struct type *);
}
开发者ID:atgreen,项目名称:binutils-gdb,代码行数:9,代码来源:language.c
示例6: ft32_register_type
static struct type *
ft32_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == FT32_PC_REGNUM)
return gdbarch_tdep (gdbarch)->pc_type;
else if (reg_nr == FT32_SP_REGNUM || reg_nr == FT32_FP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
else
return builtin_type (gdbarch)->builtin_int32;
}
开发者ID:sifive,项目名称:riscv-binutils-gdb,代码行数:10,代码来源:ft32-tdep.c
示例7: propeller_register_type
static struct type *
propeller_register_type (struct gdbarch *gdbarch, int regnum)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (regnum == gdbarch_pc_regnum (gdbarch))
return builtin_type (gdbarch)->builtin_func_ptr;
return builtin_type (gdbarch)->builtin_int32;
}
开发者ID:neutered,项目名称:propgcc,代码行数:10,代码来源:propeller-tdep.c
示例8: rx_register_type
/* Implement the "register_type" gdbarch method. */
static struct type *
rx_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == RX_PC_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
else if (reg_nr == RX_ACC_REGNUM)
return builtin_type (gdbarch)->builtin_unsigned_long_long;
else
return builtin_type (gdbarch)->builtin_unsigned_long;
}
开发者ID:BreakawayConsulting,项目名称:gdb,代码行数:11,代码来源:rx-tdep.c
示例9: frv_register_type
static struct type *
frv_register_type (struct gdbarch *gdbarch, int reg)
{
if (reg >= first_fpr_regnum && reg <= last_fpr_regnum)
return builtin_type (gdbarch)->builtin_float;
else if (reg == iacc0_regnum)
return builtin_type (gdbarch)->builtin_int64;
else
return builtin_type (gdbarch)->builtin_int32;
}
开发者ID:RadeonOpenCompute,项目名称:ROCm-GDB,代码行数:10,代码来源:frv-tdep.c
示例10: moxie_register_type
static struct type *
moxie_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == MOXIE_PC_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
else if (reg_nr == MOXIE_SP_REGNUM || reg_nr == MOXIE_FP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
else
return builtin_type_int32;
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:10,代码来源:moxie-tdep.c
示例11: msp430x_register_type
static struct type *
msp430x_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr < MSP430_NUM_REGS)
return builtin_type (gdbarch)->builtin_uint32;
else if (reg_nr == MSP430_PC_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
else
return builtin_type (gdbarch)->builtin_uint32;
}
开发者ID:Levi-Armstrong,项目名称:gdb-7.7.1,代码行数:10,代码来源:msp430-tdep.c
示例12: gnuv3_method_ptr_to_value
static struct value *
gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr)
{
struct gdbarch *gdbarch;
const gdb_byte *contents = value_contents (method_ptr);
CORE_ADDR ptr_value;
struct type *domain_type, *final_type, *method_type;
LONGEST adjustment;
struct value *adjval;
int vbit;
domain_type = TYPE_DOMAIN_TYPE (check_typedef (value_type (method_ptr)));
final_type = lookup_pointer_type (domain_type);
method_type = TYPE_TARGET_TYPE (check_typedef (value_type (method_ptr)));
/* Extract the pointer to member. */
gdbarch = get_class_arch (domain_type);
vbit = gnuv3_decode_method_ptr (gdbarch, contents, &ptr_value, &adjustment);
/* First convert THIS to match the containing type of the pointer to
member. This cast may adjust the value of THIS. */
*this_p = value_cast (final_type, *this_p);
/* Then apply whatever adjustment is necessary. This creates a somewhat
strange pointer: it claims to have type FINAL_TYPE, but in fact it
might not be a valid FINAL_TYPE. For instance, it might be a
base class of FINAL_TYPE. And if it's not the primary base class,
then printing it out as a FINAL_TYPE object would produce some pretty
garbage.
But we don't really know the type of the first argument in
METHOD_TYPE either, which is why this happens. We can't
dereference this later as a FINAL_TYPE, but once we arrive in the
called method we'll have debugging information for the type of
"this" - and that'll match the value we produce here.
You can provoke this case by casting a Base::* to a Derived::*, for
instance. */
*this_p = value_cast (builtin_type (gdbarch)->builtin_data_ptr, *this_p);
adjval = value_from_longest (builtin_type (gdbarch)->builtin_long,
adjustment);
*this_p = value_ptradd (*this_p, adjval);
*this_p = value_cast (final_type, *this_p);
if (vbit)
{
LONGEST voffset;
voffset = ptr_value / TYPE_LENGTH (vtable_ptrdiff_type (gdbarch));
return gnuv3_get_virtual_fn (gdbarch, value_ind (*this_p),
method_type, voffset);
}
else
return value_from_pointer (lookup_pointer_type (method_type), ptr_value);
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:55,代码来源:gnu-v3-abi.c
示例13: avr_register_type
static struct type *
avr_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == AVR_PC_REGNUM)
return builtin_type (gdbarch)->builtin_uint32;
if (reg_nr == AVR_PSEUDO_PC_REGNUM)
return gdbarch_tdep (gdbarch)->pc_type;
if (reg_nr == AVR_SP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
return builtin_type (gdbarch)->builtin_uint8;
}
开发者ID:GoldStoneProd2010,项目名称:gdb-7.6,代码行数:11,代码来源:avr-tdep.c
示例14: d10v_register_type
static struct type *
d10v_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == D10V_PC_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
if (reg_nr == D10V_SP_REGNUM || reg_nr == D10V_FP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
else if (reg_nr >= a0_regnum (gdbarch)
&& reg_nr < (a0_regnum (gdbarch) + NR_A_REGS))
return builtin_type_int64;
else
return builtin_type_int16;
}
开发者ID:dougmencken,项目名称:apple-gdb-1824,代码行数:13,代码来源:d10v-tdep.c
示例15: value_nsstring
struct value *
value_nsstring (struct gdbarch *gdbarch, char *ptr, int len)
{
struct type *char_type = builtin_type (gdbarch)->builtin_char;
struct value *stringValue[3];
struct value *function, *nsstringValue;
struct symbol *sym;
struct type *type;
if (!target_has_execution)
return 0; /* Can't call into inferior to create NSString. */
stringValue[2] = value_string(ptr, len, char_type);
stringValue[2] = value_coerce_array(stringValue[2]);
/* _NSNewStringFromCString replaces "istr" after Lantern2A. */
if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0).minsym)
{
function = find_function_in_inferior("_NSNewStringFromCString", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
}
else if (lookup_minimal_symbol("istr", 0, 0).minsym)
{
function = find_function_in_inferior("istr", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
}
else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0).minsym)
{
function
= find_function_in_inferior("+[NSString stringWithCString:]", NULL);
type = builtin_type (gdbarch)->builtin_long;
stringValue[0] = value_from_longest
(type, lookup_objc_class (gdbarch, "NSString"));
stringValue[1] = value_from_longest
(type, lookup_child_selector (gdbarch, "stringWithCString:"));
nsstringValue = call_function_by_hand(function, 3, &stringValue[0]);
}
else
error (_("NSString: internal error -- no way to create new NSString"));
sym = lookup_struct_typedef("NSString", 0, 1);
if (sym == NULL)
sym = lookup_struct_typedef("NXString", 0, 1);
if (sym == NULL)
type = builtin_type (gdbarch)->builtin_data_ptr;
else
type = lookup_pointer_type(SYMBOL_TYPE (sym));
deprecated_set_value_type (nsstringValue, type);
return nsstringValue;
}
开发者ID:cupertinomiranda,项目名称:binutils,代码行数:51,代码来源:objc-lang.c
示例16: m88k_register_type
static struct type *
m88k_register_type (struct gdbarch *gdbarch, int regnum)
{
/* SXIP, SNIP, SFIP and R1 contain code addresses. */
if ((regnum >= M88K_SXIP_REGNUM && regnum <= M88K_SFIP_REGNUM)
|| regnum == M88K_R1_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
/* R30 and R31 typically contains data addresses. */
if (regnum == M88K_R30_REGNUM || regnum == M88K_R31_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
return builtin_type (gdbarch)->builtin_int32;
}
开发者ID:5kg,项目名称:gdb,代码行数:14,代码来源:m88k-tdep.c
示例17: nios2_register_type
static struct type *
nios2_register_type (struct gdbarch *gdbarch, int regno)
{
/* If the XML description has register information, use that to
determine the register type. */
if (tdesc_has_registers (gdbarch_target_desc (gdbarch)))
return tdesc_register_type (gdbarch, regno);
if (regno == NIOS2_PC_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
else if (regno == NIOS2_SP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
else
return builtin_type (gdbarch)->builtin_uint32;
}
开发者ID:mbref,项目名称:binutils-gdb-microblaze,代码行数:15,代码来源:nios2-tdep.c
示例18: gnuv3_make_method_ptr
static void
gnuv3_make_method_ptr (struct type *type, gdb_byte *contents,
CORE_ADDR value, int is_virtual)
{
struct gdbarch *gdbarch = get_type_arch (type);
int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* FIXME drow/2006-12-24: The adjustment of "this" is currently
always zero, since the method pointer is of the correct type.
But if the method pointer came from a base class, this is
incorrect - it should be the offset to the base. The best
fix might be to create the pointer to member pointing at the
base class and cast it to the derived class, but that requires
support for adjusting pointers to members when casting them -
not currently supported by GDB. */
if (!gdbarch_vbit_in_delta (gdbarch))
{
store_unsigned_integer (contents, size, byte_order, value | is_virtual);
store_unsigned_integer (contents + size, size, byte_order, 0);
}
else
{
store_unsigned_integer (contents, size, byte_order, value);
store_unsigned_integer (contents + size, size, byte_order, is_virtual);
}
}
开发者ID:nds32,项目名称:binutils,代码行数:28,代码来源:gnu-v3-abi.c
示例19: gnuv3_method_ptr_size
static int
gnuv3_method_ptr_size (struct type *type)
{
struct gdbarch *gdbarch = get_type_arch (type);
return 2 * TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
}
开发者ID:nds32,项目名称:binutils,代码行数:7,代码来源:gnu-v3-abi.c
示例20: darwin_read_exec_load_addr_from_dyld
static CORE_ADDR
darwin_read_exec_load_addr_from_dyld (struct darwin_info *info)
{
struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int ptr_len = TYPE_LENGTH (ptr_type);
unsigned int image_info_size = ptr_len * 3;
int i;
/* Read infos for each solib. One of them should be the executable. */
for (i = 0; i < info->all_image.count; i++)
{
CORE_ADDR iinfo = info->all_image.info + i * image_info_size;
gdb_byte buf[image_info_size];
CORE_ADDR load_addr;
/* Read image info from inferior. */
if (target_read_memory (iinfo, buf, image_info_size))
break;
load_addr = extract_typed_address (buf, ptr_type);
if (darwin_validate_exec_header (load_addr) == load_addr)
return load_addr;
}
return 0;
}
开发者ID:Distrotech,项目名称:binutils,代码行数:27,代码来源:solib-darwin.c
注:本文中的builtin_type函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论