这篇教程C++ val_print函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中val_print函数的典型用法代码示例。如果您正苦于以下问题:C++ val_print函数的具体用法?C++ val_print怎么用?C++ val_print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了val_print函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: val_carstatic const cst_val *find_rewrite_rule(const cst_val *LC, const cst_val *RC, const cst_lts_rewrites *r){ /* Search through rewrite rules to find matching one */ const cst_val *i, *RLC, *RA, *RRC; for (i=r->rules; i; i=val_cdr(i)) {/* val_print(stdout, val_car(i)); printf("/n"); */ RLC = val_car(val_car(i)); RA = val_car(val_cdr(val_car(i))); RRC = val_car(val_cdr(val_cdr(val_car(i)))); if (rule_matches(LC,RC,RLC,RA,RRC,r->sets)) return val_car(i); } fprintf(stderr,"LTS_REWRITES: unable to find a matching rules for:/n"); fprintf(stderr,"CL: "); val_print(stderr,LC); fprintf(stderr,"/n"); fprintf(stderr,"RC: "); val_print(stderr,RC); fprintf(stderr,"/n"); return NULL;}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:27,
示例2: builtin_print/** $print : any* -> void <doc>Can print any value</doc>**/static value builtin_print( value *args, int nargs ) { buffer b; int i; if( nargs == 1 && val_is_string(*args) ) { val_print(*args); return neko_builtins[1]; } b = alloc_buffer(NULL); for(i=0;i<nargs;i++) val_buffer(b,args[i]); val_print(buffer_to_string(b)); return neko_builtins[1];}
开发者ID:ConstNW,项目名称:neko,代码行数:17,
示例3: mi_cmd_data_evaluate_expression/* Evaluate the value of the argument. The argument is an expression. If the expression contains spaces it needs to be included in double quotes. */enum mi_cmd_resultmi_cmd_data_evaluate_expression (char *command, char **argv, int argc){ struct expression *expr; struct cleanup *old_chain = NULL; struct value *val; struct ui_stream *stb = NULL; stb = ui_out_stream_new (uiout); if (argc != 1) { mi_error_message = xstrprintf ("mi_cmd_data_evaluate_expression: Usage: -data-evaluate-expression expression"); return MI_CMD_ERROR; } expr = parse_expression (argv[0]); old_chain = make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr); /* Print the result of the expression evaluation. */ val_print (value_type (val), value_contents (val), value_embedded_offset (val), VALUE_ADDRESS (val), stb->stream, 0, 0, 0, 0); ui_out_field_stream (uiout, "value", stb); ui_out_stream_delete (stb); do_cleanups (old_chain); return MI_CMD_DONE;}
开发者ID:debrouxl,项目名称:tiemu,代码行数:37,
示例4: flite_voice_add_lex_addendaint flite_voice_add_lex_addenda(cst_voice *v, const cst_string *lexfile){ /* Add addenda in lexfile to current voice */ cst_lexicon *lex; const cst_val *lex_addenda = NULL; cst_val *new_addenda; lex = val_lexicon(feat_val(v->features,"lexicon")); if (feat_present(v->features, "lex_addenda")) lex_addenda = feat_val(v->features, "lex_addenda"); new_addenda = cst_lex_load_addenda(lex,lexfile);#if 0 printf("/naddenda: "); val_print(stdout,new_addenda); printf("/n");#endif new_addenda = val_append(new_addenda,(cst_val *)lex_addenda); if (lex->lex_addenda) delete_val(lex->lex_addenda); lex->lex_addenda = new_addenda; return 0;}
开发者ID:nlphacker,项目名称:OpenSpeech,代码行数:25,
示例5: ada_val_print_gnat_arraystatic voidada_val_print_gnat_array (struct type *type, const gdb_byte *valaddr, int offset, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, const struct language_defn *language){ struct value *mark = value_mark (); struct value *val; val = value_from_contents_and_address (type, valaddr + offset, address); /* If this is a reference, coerce it now. This helps taking care of the case where ADDRESS is meaningless because original_value was not an lval. */ val = coerce_ref (val); if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF) /* array access type. */ val = ada_coerce_to_simple_array_ptr (val); else val = ada_coerce_to_simple_array (val); if (val == NULL) { gdb_assert (TYPE_CODE (type) == TYPE_CODE_TYPEDEF); fprintf_filtered (stream, "0x0"); } else val_print (value_type (val), value_embedded_offset (val), value_address (val), stream, recurse, val, options, language); value_free_to_mark (mark);}
开发者ID:kraj,项目名称:binutils-gdb,代码行数:31,
示例6: val_printvoid val_print(cst_file fd,const cst_val *v){ const cst_val *p; if (v == NULL) cst_fprintf(fd,"[null]"); else if (CST_VAL_TYPE(v) == CST_VAL_TYPE_INT) cst_fprintf(fd,"%d",val_int(v)); else if (CST_VAL_TYPE(v) == CST_VAL_TYPE_FLOAT) cst_fprintf(fd,"%f",val_float(v)); else if (CST_VAL_TYPE(v) == CST_VAL_TYPE_STRING) cst_fprintf(fd,"%s",val_string(v)); else if (cst_val_consp(v)) { cst_fprintf(fd,"("); for (p=v; p; ) { val_print(fd,val_car(p)); p=val_cdr(p); if (p) cst_fprintf(fd," "); } cst_fprintf(fd,")"); } else cst_fprintf(fd,"[Val %s 0x%p]", cst_val_defs[CST_VAL_TYPE(v)/2].name,CST_VAL_VOID(v));}
开发者ID:nvda-india,项目名称:nvda-flite-hts,代码行数:28,
示例7: ada_val_print_refstatic voidada_val_print_ref (struct type *type, const gdb_byte *valaddr, int offset, int offset_aligned, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, const struct language_defn *language){ /* For references, the debugger is expected to print the value as an address if DEREF_REF is null. But printing an address in place of the object value would be confusing to an Ada programmer. So, for Ada values, we print the actual dereferenced value regardless. */ struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type)); struct value *deref_val; CORE_ADDR deref_val_int; if (TYPE_CODE (elttype) == TYPE_CODE_UNDEF) { fputs_filtered ("<ref to undefined type>", stream); return; } deref_val = coerce_ref_if_computed (original_value); if (deref_val) { if (ada_is_tagged_type (value_type (deref_val), 1)) deref_val = ada_tag_value_at_base_address (deref_val); common_val_print (deref_val, stream, recurse + 1, options, language); return; } deref_val_int = unpack_pointer (type, valaddr + offset_aligned); if (deref_val_int == 0) { fputs_filtered ("(null)", stream); return; } deref_val = ada_value_ind (value_from_pointer (lookup_pointer_type (elttype), deref_val_int)); if (ada_is_tagged_type (value_type (deref_val), 1)) deref_val = ada_tag_value_at_base_address (deref_val); /* Make sure that the object does not have an unreasonable size before trying to print it. This can happen for instance with references to dynamic objects whose contents is uninitialized (Eg: an array whose bounds are not set yet). */ ada_ensure_varsize_limit (value_type (deref_val)); val_print (value_type (deref_val), value_contents_for_printing (deref_val), value_embedded_offset (deref_val), value_address (deref_val), stream, recurse + 1, deref_val, options, language);}
开发者ID:uarka,项目名称:binutils,代码行数:59,
示例8: ada_value_printintada_value_print (struct value *val0, struct ui_file *stream, int format, enum val_prettyprint pretty){ char *valaddr = VALUE_CONTENTS (val0); CORE_ADDR address = VALUE_ADDRESS (val0) + VALUE_OFFSET (val0); struct type *type = ada_to_fixed_type (VALUE_TYPE (val0), valaddr, address, NULL); struct value *val = value_from_contents_and_address (type, valaddr, address); /* If it is a pointer, indicate what it points to. */ if (TYPE_CODE (type) == TYPE_CODE_PTR) { /* Hack: don't print (char *) for char strings. Their type is indicated by the quoted string anyway. */ if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char) || TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_INT || TYPE_UNSIGNED (TYPE_TARGET_TYPE (type))) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") "); } } else if (ada_is_array_descriptor_type (type)) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") "); } else if (ada_is_bogus_array_descriptor (type)) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") (...?)"); return 0; } if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == 0 && TYPE_CODE (TYPE_INDEX_TYPE (type)) == TYPE_CODE_RANGE) { /* This is an array of zero-length elements, that is an array of null records. This array needs to be printed by hand, as the standard routine to print arrays relies on the size of the array elements to be nonzero. This is because it computes the number of elements in the array by dividing the array size by the array element size. */ fprintf_filtered (stream, "(%d .. %d => ())", TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)), TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (type))); return 0; } return (val_print (type, VALUE_CONTENTS (val), 0, address, stream, format, 1, 0, pretty));}
开发者ID:sjohnston-adventiumlabs,项目名称:xen-micart-scheduler,代码行数:58,
示例9: feat_printint feat_print(cst_file fd,const cst_features *f){ cst_featvalpair *p; for (p=f->head; p; p=p->next) { cst_fprintf(fd, "%s ",p->name); val_print(fd,p->val); cst_fprintf(fd,"/n"); } return 0;}
开发者ID:nlphacker,项目名称:OpenSpeech,代码行数:13,
示例10: get_register/* Output one register's contents in the desired format. */static intget_register (int regnum, int format){ gdb_byte buffer[MAX_REGISTER_SIZE]; int optim; int realnum; CORE_ADDR addr; enum lval_type lval; static struct ui_stream *stb = NULL; stb = ui_out_stream_new (uiout); if (format == 'N') format = 0; frame_register (get_selected_frame (NULL), regnum, &optim, &lval, &addr, &realnum, buffer); if (optim) { mi_error_message = xstrprintf ("Optimized out"); return -1; } if (format == 'r') { int j; char *ptr, buf[1024]; strcpy (buf, "0x"); ptr = buf + 2; for (j = 0; j < register_size (current_gdbarch, regnum); j++) { int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j : register_size (current_gdbarch, regnum) - 1 - j; sprintf (ptr, "%02x", (unsigned char) buffer[idx]); ptr += 2; } ui_out_field_string (uiout, "value", buf); /*fputs_filtered (buf, gdb_stdout); */ } else { val_print (register_type (current_gdbarch, regnum), buffer, 0, 0, stb->stream, format, 1, 0, Val_pretty_default); ui_out_field_stream (uiout, "value", stb); ui_out_stream_delete (stb); } return 1;}
开发者ID:debrouxl,项目名称:tiemu,代码行数:51,
示例11: profile_detailsstatic void profile_details( const char *name, neko_module *m, int *tot ) { unsigned int i; value *dbg = val_is_null(m->debuginf)?NULL:val_array_ptr(m->debuginf); printf("Details for : %s[%d]/n",name,m->codesize); for(i=0;i<m->codesize;i++) { int c = (int)m->code[PROF_SIZE+i]; if( c > 0 ) { if( dbg ) val_print(dbg[i]); printf(" %-4X %d/n",i,c); } } printf("/n");}
开发者ID:angavrilov,项目名称:iphone-neko,代码行数:14,
示例12: ada_value_printvoidada_value_print (struct value *val0, struct ui_file *stream, const struct value_print_options *options){ struct value *val = ada_to_fixed_value (val0); CORE_ADDR address = value_address (val); struct type *type = ada_check_typedef (value_enclosing_type (val)); struct value_print_options opts; /* If it is a pointer, indicate what it points to. */ if (TYPE_CODE (type) == TYPE_CODE_PTR) { /* Hack: don't print (char *) for char strings. Their type is indicated by the quoted string anyway. */ if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char) || TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_INT || TYPE_UNSIGNED (TYPE_TARGET_TYPE (type))) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") "); } } else if (ada_is_array_descriptor_type (type)) { /* We do not print the type description unless TYPE is an array access type (this is encoded by the compiler as a typedef to a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */ if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") "); } } else if (ada_is_bogus_array_descriptor (type)) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") (...?)"); return; } opts = *options; opts.deref_ref = 1; val_print (type, value_embedded_offset (val), address, stream, 0, val, &opts, current_language);}
开发者ID:kraj,项目名称:binutils-gdb,代码行数:49,
示例13: deck_printint deck_print(Deck * deck){ int i; deck->realign(deck); for(i=0;i<deck->cards->n_items;i++){ val_print( (((Card*)(deck->cards->data))[i]).val); suit_print( (((Card*)(deck->cards->data))[i]).suit); printf(" "); } printf("/n"); return 0;}
开发者ID:gtw,项目名称:C-Programming,代码行数:15,
示例14: hand_printint hand_print(Hand * hand){ int i; for(i=0;i<hand->size;i++){ val_print((hand->cards)[i].val); suit_print((hand->cards)[i].suit); printf(" "); if(hand->cards[i].val != _10) printf(" "); } printf("/n"); return 0;}
开发者ID:gtw,项目名称:C-Programming,代码行数:16,
示例15: profile_functionsstatic void profile_functions( const char *name, neko_module *m, int *tot ) { unsigned int i; value *dbg = val_is_null(m->debuginf)?NULL:val_array_ptr(m->debuginf); for(i=0;i<m->nglobals;i++) { value v = m->globals[i]; if( val_is_function(v) && val_type(v) == VAL_FUNCTION && ((vfunction*)v)->module == m ) { int pos = (int)(((int_val)((vfunction*)v)->addr - (int_val)m->code) / sizeof(int_val)); if( m->code[PROF_SIZE+pos] > 0 ) { printf("%-8d %-4d %-20s %X ",m->code[PROF_SIZE+pos],i,name,pos); if( dbg ) val_print(dbg[pos]); printf("/n"); } } }}
开发者ID:angavrilov,项目名称:iphone-neko,代码行数:16,
示例16: ada_val_print_fltstatic voidada_val_print_flt (struct type *type, const gdb_byte *valaddr, int offset, int offset_aligned, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, const struct language_defn *language){ if (options->format) { val_print (type, offset, address, stream, recurse, original_value, options, language_def (language_c)); return; } ada_print_floating (valaddr + offset, type, stream);}
开发者ID:kraj,项目名称:binutils-gdb,代码行数:17,
示例17: cart_print_nodestatic void cart_print_node(int n, const cst_cart *tree){ printf("%s ",cst_cart_node_feat(n,tree)); if (cst_cart_node_op(n,tree) == CST_CART_OP_IS) printf("IS "); else if (cst_cart_node_op(n,tree) == CST_CART_OP_LESS) printf("< "); else if (cst_cart_node_op(n,tree) == CST_CART_OP_GREATER) printf("> "); else if (cst_cart_node_op(n,tree) == CST_CART_OP_IN) printf("IN "); else if (cst_cart_node_op(n,tree) == CST_CART_OP_MATCHES) printf("MATCHES "); else printf("*%d* ",cst_cart_node_op(n,tree)); val_print(stdout,cst_cart_node_val(n,tree)); printf("/n");}
开发者ID:nvda-india,项目名称:nvda-flite-hts,代码行数:18,
示例18: f77_print_array_1static voidf77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int *elts){ int i; if (nss != ndimensions) { for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max); i++) { fprintf_filtered (stream, "( "); f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), valaddr + i * F77_DIM_OFFSET (nss), address + i * F77_DIM_OFFSET (nss), stream, recurse, val, options, elts); fprintf_filtered (stream, ") "); } if (*elts >= options->print_max && i < F77_DIM_SIZE (nss)) fprintf_filtered (stream, "..."); } else { for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < options->print_max; i++, (*elts)++) { val_print (TYPE_TARGET_TYPE (type), valaddr + i * F77_DIM_OFFSET (ndimensions), 0, address + i * F77_DIM_OFFSET (ndimensions), stream, recurse, val, options, current_language); if (i != (F77_DIM_SIZE (nss) - 1)) fprintf_filtered (stream, ", "); if ((*elts == options->print_max - 1) && (i != (F77_DIM_SIZE (nss) - 1))) fprintf_filtered (stream, "..."); } }}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:44,
示例19: f77_print_array_1static voidf77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct ui_file *stream, int format, int deref_ref, int recurse, enum val_prettyprint pretty, int *elts){ int i; if (nss != ndimensions) { for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++) { fprintf_filtered (stream, "( "); f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), valaddr + i * F77_DIM_OFFSET (nss), address + i * F77_DIM_OFFSET (nss), stream, format, deref_ref, recurse, pretty, elts); fprintf_filtered (stream, ") "); } if (*elts >= print_max && i < F77_DIM_SIZE (nss)) fprintf_filtered (stream, "..."); } else { for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < print_max; i++, (*elts)++) { val_print (TYPE_TARGET_TYPE (type), valaddr + i * F77_DIM_OFFSET (ndimensions), 0, address + i * F77_DIM_OFFSET (ndimensions), stream, format, deref_ref, recurse, pretty); if (i != (F77_DIM_SIZE (nss) - 1)) fprintf_filtered (stream, ", "); if ((*elts == print_max - 1) && (i != (F77_DIM_SIZE (nss) - 1))) fprintf_filtered (stream, "..."); } }}
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:42,
示例20: cst_utf8_explodecst_val *cmu_grapheme_lex_lts_function(const struct lexicon_struct *l, const char *word, const char *pos, const cst_features *feats){ cst_val *phones = 0; cst_val *utflets = 0; const cst_val *v; char ord[10]; int i,phindex; /* string to utf8 chars */ utflets = cst_utf8_explode(word); for (v=utflets; v; v=val_cdr(v)) { /* We will add the found phones in reverse order and reverse then */ /* afterwards */ cst_utf8_as_hex(val_string(val_car(v)),ord); phindex = cst_find_u2sampa(ord); if (phindex < 0) printf("awb_debug no sampa %s %s/n",val_string(val_car(v)),ord); for (i=4; (phindex>=0) && (i>0); i--) { if (unicode_sampa_mapping[phindex][i]) phones = cons_val(string_val(unicode_sampa_mapping[phindex][i]), phones); } } phones = val_reverse(phones);#if 1 printf("cmu_grapheme_lex.c: word /"%s/" ",word); val_print(stdout,phones); printf("/n");#endif delete_val(utflets); return phones;}
开发者ID:2php,项目名称:flite-2.0.0-release,代码行数:40,
示例21: ada_val_print_ptrstatic voidada_val_print_ptr (struct type *type, const gdb_byte *valaddr, int offset, int offset_aligned, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, const struct language_defn *language){ val_print (type, offset, address, stream, recurse, original_value, options, language_def (language_c)); if (ada_is_tag_type (type)) { struct value *val = value_from_contents_and_address (type, valaddr + offset_aligned, address + offset_aligned); const char *name = ada_tag_name (val); if (name != NULL) fprintf_filtered (stream, " (%s)", name); }}
开发者ID:kraj,项目名称:binutils-gdb,代码行数:23,
示例22: f_val_printintf_val_print (struct type *type, char *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int format, int deref_ref, int recurse, enum val_prettyprint pretty){ unsigned int i = 0; /* Number of characters printed */ struct type *elttype; LONGEST val; CORE_ADDR addr; CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) { case TYPE_CODE_STRING: f77_get_dynamic_length_of_aggregate (type); LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0); break; case TYPE_CODE_ARRAY: fprintf_filtered (stream, "("); f77_print_array (type, valaddr, address, stream, format, deref_ref, recurse, pretty); fprintf_filtered (stream, ")"); break; case TYPE_CODE_PTR: if (format && format != 's') { print_scalar_formatted (valaddr, type, format, 0, stream); break; } else { addr = unpack_pointer (type, valaddr); elttype = check_typedef (TYPE_TARGET_TYPE (type)); if (TYPE_CODE (elttype) == TYPE_CODE_FUNC) { /* Try to print what function it points to. */ print_address_demangle (addr, stream, demangle); /* Return value is irrelevant except for string pointers. */ return 0; } if (addressprint && format != 's') print_address_numeric (addr, 1, stream); /* For a pointer to char or unsigned char, also print the string pointed to, unless pointer is null. */ if (TYPE_LENGTH (elttype) == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT && (format == 0 || format == 's') && addr != 0) i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream); /* Return number of characters printed, including the terminating '/0' if we reached the end. val_print_string takes care including the terminating '/0' if necessary. */ return i; } break; case TYPE_CODE_REF: elttype = check_typedef (TYPE_TARGET_TYPE (type)); if (addressprint) { CORE_ADDR addr = extract_typed_address (valaddr + embedded_offset, type); fprintf_filtered (stream, "@"); print_address_numeric (addr, 1, stream); if (deref_ref) fputs_filtered (": ", stream); } /* De-reference the reference. */ if (deref_ref) { if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF) { struct value *deref_val = value_at (TYPE_TARGET_TYPE (type), unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); val_print (VALUE_TYPE (deref_val), VALUE_CONTENTS (deref_val), 0, VALUE_ADDRESS (deref_val), stream, format, deref_ref, recurse, pretty); } else fputs_filtered ("???", stream); } break; case TYPE_CODE_FUNC://.........这里部分代码省略.........
开发者ID:2014-class,项目名称:freerouter,代码行数:101,
示例23: c_value_print//.........这里部分代码省略......... && TYPE_NAME (TYPE_TARGET_TYPE (val_type)) != NULL && (strcmp (TYPE_NAME (TYPE_TARGET_TYPE (val_type)), "char") == 0 || textual_name (TYPE_NAME (TYPE_TARGET_TYPE (val_type))))) { /* Print nothing. */ } else if (options->objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS)) { int is_ref = TYPE_CODE (type) == TYPE_CODE_REF; if (is_ref) val = value_addr (val); /* Pointer to class, check real type of object. */ fprintf_filtered (stream, "("); if (value_entirely_available (val)) { real_type = value_rtti_indirect_type (val, &full, &top, &using_enc); if (real_type) { /* RTTI entry found. */ type = real_type; /* Need to adjust pointer value. */ val = value_from_pointer (real_type, value_as_address (val) - top); if (is_ref) { val = value_ref (value_ind (val)); type = value_type (val); } /* Note: When we look up RTTI entries, we don't get any information on const or volatile attributes. */ } } type_print (type, "", stream, -1); fprintf_filtered (stream, ") "); val_type = type; } else { /* normal case */ fprintf_filtered (stream, "("); type_print (value_type (val), "", stream, -1); fprintf_filtered (stream, ") "); } } if (!value_initialized (val)) fprintf_filtered (stream, " [uninitialized] "); if (options->objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS)) { /* Attempt to determine real type of object. */ real_type = value_rtti_type (val, &full, &top, &using_enc); if (real_type) { /* We have RTTI information, so use it. */ val = value_full_object (val, real_type, full, top, using_enc); fprintf_filtered (stream, "(%s%s) ", TYPE_NAME (real_type), full ? "" : _(" [incomplete object]")); /* Print out object: enclosing type is same as real_type if full. */ val_print (value_enclosing_type (val), value_contents_for_printing (val), 0, value_address (val), stream, 0, val, &opts, current_language); return; /* Note: When we look up RTTI entries, we don't get any information on const or volatile attributes. */ } else if (type != check_typedef (value_enclosing_type (val))) { /* No RTTI information, so let's do our best. */ fprintf_filtered (stream, "(%s ?) ", TYPE_NAME (value_enclosing_type (val))); val_print (value_enclosing_type (val), value_contents_for_printing (val), 0, value_address (val), stream, 0, val, &opts, current_language); return; } /* Otherwise, we end up at the return outside this "if". */ } val_print (val_type, value_contents_for_printing (val), value_embedded_offset (val), value_address (val), stream, 0, val, &opts, current_language);}
开发者ID:nds32,项目名称:binutils,代码行数:101,
示例24: pascal_object_print_value_fields//.........这里部分代码省略......... else { wrap_here (n_spaces (2 + 2 * recurse)); } annotate_field_begin (TYPE_FIELD_TYPE (type, i)); if (field_is_static (&TYPE_FIELD (type, i))) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); annotate_field_name_end (); fputs_filtered (" = ", stream); annotate_field_value (); if (!field_is_static (&TYPE_FIELD (type, i)) && TYPE_FIELD_PACKED (type, i)) { struct value *v; /* Bitfields require special handling, especially due to byte order problems. */ if (TYPE_FIELD_IGNORE (type, i)) { fputs_filtered ("<optimized out or zero length>", stream); } else if (value_bits_synthetic_pointer (val, TYPE_FIELD_BITPOS (type, i), TYPE_FIELD_BITSIZE (type, i))) { fputs_filtered (_("<synthetic pointer>"), stream); } else { struct value_print_options opts = *options; v = value_field_bitfield (type, i, valaddr, offset, val); opts.deref_ref = 0; common_val_print (v, stream, recurse + 1, &opts, current_language); } } else { if (TYPE_FIELD_IGNORE (type, i)) { fputs_filtered ("<optimized out or zero length>", stream); } else if (field_is_static (&TYPE_FIELD (type, i))) { /* struct value *v = value_static_field (type, i); v4.17 specific. */ struct value *v; v = value_field_bitfield (type, i, valaddr, offset, val); if (v == NULL) val_print_optimized_out (NULL, stream); else pascal_object_print_static_field (v, stream, recurse + 1, options); } else { struct value_print_options opts = *options; opts.deref_ref = 0; /* val_print (TYPE_FIELD_TYPE (type, i), valaddr + TYPE_FIELD_BITPOS (type, i) / 8, address + TYPE_FIELD_BITPOS (type, i) / 8, 0, stream, format, 0, recurse + 1, pretty); */ val_print (TYPE_FIELD_TYPE (type, i), valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8, address, stream, recurse + 1, val, &opts, current_language); } } annotate_field_end (); } if (dont_print_statmem == 0) { /* Free the space used to deal with the printing of the members from top level. */ obstack_free (&dont_print_statmem_obstack, last_dont_print); dont_print_statmem_obstack = tmp_obstack; } if (options->prettyformat) { fprintf_filtered (stream, "/n"); print_spaces_filtered (2 * recurse, stream); } } fprintf_filtered (stream, "}");}
开发者ID:Cookfeces,项目名称:binutils-gdb,代码行数:101,
示例25: new_features_localconst cst_val *cart_interpret(cst_item *item, const cst_cart *tree){ /* Tree interpretation */ const cst_val *v=0; const cst_val *tree_val; const char *tree_feat = ""; cst_features *fcache; int r=0; int node=0; fcache = new_features_local(item_utt(item)->ctx); while (cst_cart_node_op(node,tree) != CST_CART_OP_LEAF) {#if CART_DEBUG cart_print_node(node,tree);#endif tree_feat = cst_cart_node_feat(node,tree); v = get_param_val(fcache,tree_feat,0); if (v == 0) { v = ffeature(item,tree_feat); feat_set(fcache,tree_feat,v); }#if CART_DEBUG val_print(stdout,v); printf("/n");#endif tree_val = cst_cart_node_val(node,tree); if (cst_cart_node_op(node,tree) == CST_CART_OP_IS) r = val_equal(v,tree_val); else if (cst_cart_node_op(node,tree) == CST_CART_OP_LESS) r = val_less(v,tree_val); else if (cst_cart_node_op(node,tree) == CST_CART_OP_GREATER) r = val_greater(v,tree_val); else if (cst_cart_node_op(node,tree) == CST_CART_OP_IN) r = val_member(v,tree_val); else if (cst_cart_node_op(node,tree) == CST_CART_OP_MATCHES) r = cst_regex_match(cst_regex_table[val_int(tree_val)], val_string(v)); else { cst_errmsg("cart_interpret_question: unknown op type %d/n", cst_cart_node_op(node,tree)); cst_error(); } if (r) { /* Oh yes it is */#if CART_DEBUG printf(" YES/n");#endif node = cst_cart_node_yes(node,tree); } else { /* Oh no it isn't */#if CART_DEBUG printf(" NO/n");#endif node = cst_cart_node_no(node,tree); } } delete_features(fcache); return cst_cart_node_val(node,tree); }
开发者ID:nvda-india,项目名称:nvda-flite-hts,代码行数:69,
示例26: pascal_object_print_value_fields//.........这里部分代码省略......... } if (inspect_it) { if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR) fputs_filtered ("/"( ptr /"", stream); else fputs_filtered ("/"( nodef /"", stream); if (TYPE_FIELD_STATIC (type, i)) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("/" /"", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("/") /"", stream); } else { annotate_field_begin (TYPE_FIELD_TYPE (type, i)); if (TYPE_FIELD_STATIC (type, i)) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); annotate_field_name_end (); fputs_filtered (" = ", stream); annotate_field_value (); } if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i)) { struct value *v; /* Bitfields require special handling, especially due to byte order problems. */ if (TYPE_FIELD_IGNORE (type, i)) { fputs_filtered ("<optimized out or zero length>", stream); } else { v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else { if (TYPE_FIELD_IGNORE (type, i)) { fputs_filtered ("<optimized out or zero length>", stream); } else if (TYPE_FIELD_STATIC (type, i)) { /* struct value *v = value_static_field (type, i); v4.17 specific */ struct value *v; v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); if (v == NULL) fputs_filtered ("<optimized out>", stream); else pascal_object_print_static_field (v, stream, format, recurse + 1, pretty); } else { /* val_print (TYPE_FIELD_TYPE (type, i), valaddr + TYPE_FIELD_BITPOS (type, i) / 8, address + TYPE_FIELD_BITPOS (type, i) / 8, 0, stream, format, 0, recurse + 1, pretty); */ val_print (TYPE_FIELD_TYPE (type, i), valaddr, TYPE_FIELD_BITPOS (type, i) / 8, address + TYPE_FIELD_BITPOS (type, i) / 8, stream, format, 0, recurse + 1, pretty); } } annotate_field_end (); } if (dont_print_statmem == 0) { /* Free the space used to deal with the printing of the members from top level. */ obstack_free (&dont_print_statmem_obstack, last_dont_print); dont_print_statmem_obstack = tmp_obstack; } if (pretty) { fprintf_filtered (stream, "/n"); print_spaces_filtered (2 * recurse, stream); } } fprintf_filtered (stream, "}");}
开发者ID:benjaminlevine,项目名称:Huawei-HG633-Open-Source-Software-Package,代码行数:101,
示例27: ts_open_stringcst_val *cst_lex_make_entry(const cst_lexicon *lex, const cst_string *entry){ /* if replace then replace entry in addenda of lex with entry */ /* else append entry to addenda of lex */ cst_tokenstream *e; cst_val *phones = NULL; cst_val *ventry; const cst_string *w, *p; cst_string *word; cst_string *pos; int i; e = ts_open_string(entry, cst_ts_default_whitespacesymbols, "","",""); w = ts_get(e); if (w[0] == '"') /* it was a quoted entry */ { /* so reparse it */ ts_close(e); e = ts_open_string(entry, cst_ts_default_whitespacesymbols, "","",""); w = ts_get_quoted_token(e,'"','//'); } word = cst_strdup(w); p = ts_get(e); if (!cst_streq(":",p)) /* there is a real pos */ { pos = cst_strdup(p); p = ts_get(e); if (!cst_streq(":",p)) /* there is a real pos */ { cst_fprintf(stdout,"add_addenda: lex %s: expected /":/" in %s/n", lex->name, word); cst_free(word); cst_free(pos); ts_close(e); return NULL; } } else pos = cst_strdup("nil"); while (!ts_eof(e)) { p = ts_get(e); /* Check its a legal phone */ for (i=0; lex->phone_table[i]; i++) { if (cst_streq(p,lex->phone_table[i])) break; } if (cst_streq("#",p)) /* comment to end of line */ break; else if (cst_streq("",p)) /* trailing ws at eoln causes this */ break; else if (lex->phone_table[i]) /* Only add it if its a valid phone */ phones = cons_val(string_val(p),phones); else { cst_fprintf(stdout,"add_addenda: lex: %s word %s phone %s not in lexicon phoneset/n", lex->name, word, p); } } ventry = cons_val(string_val(word),cons_val(string_val(pos), val_reverse(phones))); cst_free(word); cst_free(pos); ts_close(e);#if 0 printf("entry: "); val_print(stdout,ventry); printf("/n");#endif return ventry;}
开发者ID:rhdunn,项目名称:flite,代码行数:83,
示例28: java_print_value_fields//.........这里部分代码省略......... if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR) fputs_filtered ("/"( ptr /"", stream); else fputs_filtered ("/"( nodef /"", stream); if (field_is_static (&TYPE_FIELD (type, i))) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("/" /"", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("/") /"", stream); } else { annotate_field_begin (TYPE_FIELD_TYPE (type, i)); if (field_is_static (&TYPE_FIELD (type, i))) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), language_cplus, DMGL_PARAMS | DMGL_ANSI); annotate_field_name_end (); fputs_filtered (": ", stream); annotate_field_value (); } if (!field_is_static (&TYPE_FIELD (type, i)) && TYPE_FIELD_PACKED (type, i)) { struct value *v; /* Bitfields require special handling, especially due to byte order problems. */ if (TYPE_FIELD_IGNORE (type, i)) { fputs_filtered ("<optimized out or zero length>", stream); } else { struct value_print_options opts; v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); opts = *options; opts.deref_ref = 0; common_val_print (v, stream, recurse + 1, &opts, current_language); } } else { if (TYPE_FIELD_IGNORE (type, i)) { fputs_filtered ("<optimized out or zero length>", stream); } else if (field_is_static (&TYPE_FIELD (type, i))) { struct value *v = value_static_field (type, i); if (v == NULL) fputs_filtered ("<optimized out>", stream); else { struct value_print_options opts; struct type *t = check_typedef (value_type (v)); if (TYPE_CODE (t) == TYPE_CODE_STRUCT) v = value_addr (v); opts = *options; opts.deref_ref = 0; common_val_print (v, stream, recurse + 1, &opts, current_language); } } else if (TYPE_FIELD_TYPE (type, i) == NULL) fputs_filtered ("<unknown type>", stream); else { struct value_print_options opts = *options; opts.deref_ref = 0; val_print (TYPE_FIELD_TYPE (type, i), valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0, address + TYPE_FIELD_BITPOS (type, i) / 8, stream, recurse + 1, &opts, current_language); } } annotate_field_end (); } if (options->pretty) { fprintf_filtered (stream, "/n"); print_spaces_filtered (2 * recurse, stream); } } fprintf_filtered (stream, "}");}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:101,
示例29: c_value_printintc_value_print (struct value *val, struct ui_file *stream, int format, enum val_prettyprint pretty){ struct type *type, *real_type; int full, top, using_enc; /* If it is a pointer, indicate what it points to. Print type also if it is a reference. C++: if it is a member pointer, we will take care of that when we print it. */ type = check_typedef (value_type (val)); if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF) { /* Hack: remove (char *) for char strings. Their type is indicated by the quoted string anyway. */ if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_NAME (type) == NULL && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0) { /* Print nothing */ } else if (objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS)) { if (TYPE_CODE(type) == TYPE_CODE_REF) { /* Copy value, change to pointer, so we don't get an * error about a non-pointer type in value_rtti_target_type */ struct value *temparg; temparg=value_copy(val); deprecated_set_value_type (temparg, lookup_pointer_type (TYPE_TARGET_TYPE(type))); val=temparg; } /* Pointer to class, check real type of object */ fprintf_filtered (stream, "("); real_type = value_rtti_target_type (val, &full, &top, &using_enc); if (real_type) { /* RTTI entry found */ if (TYPE_CODE (type) == TYPE_CODE_PTR) { /* create a pointer type pointing to the real type */ type = lookup_pointer_type (real_type); } else { /* create a reference type referencing the real type */ type = lookup_reference_type (real_type); } /* JYG: Need to adjust pointer value. */ /* NOTE: cagney/2005-01-02: THIS IS BOGUS. */ value_contents_writeable (val)[0] -= top; /* Note: When we look up RTTI entries, we don't get any information on const or volatile attributes */ } type_print (type, "", stream, -1); fprintf_filtered (stream, ") "); } else { /* normal case */ fprintf_filtered (stream, "("); type_print (value_type (val), "", stream, -1); fprintf_filtered (stream, ") "); } } /* APPLE LOCAL begin variable initialized status. */ if (value_var_status (val) == 0) fprintf_filtered (stream, " [uninitialized] "); /* APPLE LOCAL end variable initialized status. */ if (objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS)) { /* Attempt to determine real type of object */ real_type = value_rtti_type (val, &full, &top, &using_enc); if (real_type) { /* We have RTTI information, so use it */ val = value_full_object (val, real_type, full, top, using_enc); fprintf_filtered (stream, "(%s%s) ", TYPE_NAME (real_type), full ? "" : _(" [incomplete object]")); /* Print out object: enclosing type is same as real_type if full */ return val_print (value_enclosing_type (val), value_contents_all (val), 0, VALUE_ADDRESS (val), stream, format, 1, 0, pretty); /* Note: When we look up RTTI entries, we don't get any information on const or volatile attributes */ } else if (type != check_typedef (value_enclosing_type (val)))//.........这里部分代码省略.........
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:101,
示例30: f_val_printintf_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options){ struct gdbarch *gdbarch = get_type_arch (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); unsigned int i = 0; /* Number of characters printed */ struct type *elttype; LONGEST val; CORE_ADDR addr; int index; CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) { case TYPE_CODE_STRING: f77_get_dynamic_length_of_aggregate (type); LA_PRINT_STRING (stream, builtin_type (gdbarch)->builtin_char, valaddr, TYPE_LENGTH (type), NULL, 0, options); break; case TYPE_CODE_ARRAY: fprintf_filtered (stream, "("); f77_print_array (type, valaddr, address, stream, recurse, original_value, options); fprintf_filtered (stream, ")"); break; case TYPE_CODE_PTR: if (options->format && options->format != 's') { print_scalar_formatted (valaddr, type, options, 0, stream); break; } else { addr = unpack_pointer (type, valaddr); elttype = check_typedef (TYPE_TARGET_TYPE (type)); if (TYPE_CODE (elttype) == TYPE_CODE_FUNC) { /* Try to print what function it points to. */ print_address_demangle (gdbarch, addr, stream, demangle); /* Return value is irrelevant except for string pointers. */ return 0; } if (options->addressprint && options->format != 's') fputs_filtered (paddress (gdbarch, addr), stream); /* For a pointer to char or unsigned char, also print the string pointed to, unless pointer is null. */ if (TYPE_LENGTH (elttype) == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT && (options->format == 0 || options->format == 's') && addr != 0) i = val_print_string (TYPE_TARGET_TYPE (type), addr, -1, stream, options); /* Return number of characters printed, including the terminating '/0' if we reached the end. val_print_string takes care including the terminating '/0' if necessary. */ return i; } break; case TYPE_CODE_REF: elttype = check_typedef (TYPE_TARGET_TYPE (type)); if (options->addressprint) { CORE_ADDR addr = extract_typed_address (valaddr + embedded_offset, type); fprintf_filtered (stream, "@"); fputs_filtered (paddress (gdbarch, addr), stream); if (options->deref_ref) fputs_filtered (": ", stream); } /* De-reference the reference. */ if (options->deref_ref) { if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF) { struct value *deref_val = value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr + embedded_offset)); common_val_print (deref_val, stream, recurse, options, current_language); } else fputs_filtered ("???", stream); } break; case TYPE_CODE_FUNC: if (options->format) {//.........这里部分代码省略.........
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:101,
注:本文中的val_print函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ val_sock函数代码示例 C++ val_is_null函数代码示例 |