当前位置: 首页>>代码示例>>C++>>正文


C++ CHECK_TYPEDEF函数代码示例

本文整理汇总了C++中CHECK_TYPEDEF函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_TYPEDEF函数的具体用法?C++ CHECK_TYPEDEF怎么用?C++ CHECK_TYPEDEF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CHECK_TYPEDEF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gccgo_string_p

static int
gccgo_string_p (struct type *type)
{
  /* gccgo strings don't necessarily have a name we can use.  */

  if (TYPE_NFIELDS (type) == 2)
    {
      struct type *type0 = TYPE_FIELD_TYPE (type, 0);
      struct type *type1 = TYPE_FIELD_TYPE (type, 1);

      CHECK_TYPEDEF (type0);
      CHECK_TYPEDEF (type1);

      if (TYPE_CODE (type0) == TYPE_CODE_PTR
	  && strcmp (TYPE_FIELD_NAME (type, 0), "__data") == 0
	  && TYPE_CODE (type1) == TYPE_CODE_INT
	  && strcmp (TYPE_FIELD_NAME (type, 1), "__length") == 0)
	{
	  struct type *target_type = TYPE_TARGET_TYPE (type0);

	  CHECK_TYPEDEF (target_type);

	  if (TYPE_CODE (target_type) == TYPE_CODE_INT
	      && TYPE_LENGTH (target_type) == 1
	      && strcmp (TYPE_NAME (target_type), "uint8") == 0)
	    return 1;
	}
    }

  return 0;
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:31,代码来源:go-lang.c

示例2: m2_print_array_contents

static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
			 int embedded_offset, CORE_ADDR address,
			 struct ui_file *stream, int recurse,
			 const struct value_print_options *options,
			 int len)
{
  int eltlen;
  CHECK_TYPEDEF (type);

  if (TYPE_LENGTH (type) > 0)
    {
      eltlen = TYPE_LENGTH (type);
      if (options->prettyprint_arrays)
	print_spaces_filtered (2 + 2 * recurse, stream);
      /* For an array of chars, print with string syntax.  */
      if (eltlen == 1 &&
	  ((TYPE_CODE (type) == TYPE_CODE_INT)
	   || ((current_language->la_language == language_m2)
	       && (TYPE_CODE (type) == TYPE_CODE_CHAR)))
	  && (options->format == 0 || options->format == 's'))
	val_print_string (type, address, len+1, stream, options);
      else
	{
	  fprintf_filtered (stream, "{");
	  val_print_array_elements (type, valaddr + embedded_offset,
				    address, stream, recurse, options, 0);
	  fprintf_filtered (stream, "}");
	}
    }
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:31,代码来源:m2-valprint.c

示例3: structured_type

/* Returns non-zero if the value is a structured type */
int
structured_type (struct type *type)
{
    CHECK_TYPEDEF (type);
    switch (current_language->la_language)
    {
    case language_c:
    case language_cplus:
    case language_objc:
        return (TYPE_CODE (type) == TYPE_CODE_STRUCT) ||
               (TYPE_CODE (type) == TYPE_CODE_UNION) ||
               (TYPE_CODE (type) == TYPE_CODE_ARRAY);
    case language_pascal:
        return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
               (TYPE_CODE(type) == TYPE_CODE_UNION) ||
               (TYPE_CODE(type) == TYPE_CODE_SET) ||
               (TYPE_CODE(type) == TYPE_CODE_ARRAY);
    case language_m2:
        return (TYPE_CODE (type) == TYPE_CODE_STRUCT) ||
               (TYPE_CODE (type) == TYPE_CODE_SET) ||
               (TYPE_CODE (type) == TYPE_CODE_ARRAY);
    default:
        return (0);
    }
}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:26,代码来源:language.c

示例4: m2_print_unbounded_array

static void
m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
			  int embedded_offset, CORE_ADDR address,
			  struct ui_file *stream, int recurse,
			  const struct value_print_options *options)
{
  struct type *content_type;
  CORE_ADDR addr;
  LONGEST len;
  struct value *val;

  CHECK_TYPEDEF (type);
  content_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));

  addr = unpack_pointer (TYPE_FIELD_TYPE (type, 0),
			 (TYPE_FIELD_BITPOS (type, 0) / 8) +
			 valaddr + embedded_offset);

  val = value_at_lazy (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)),
		       addr);
  len = unpack_field_as_long (type, valaddr + embedded_offset, 1);

  fprintf_filtered (stream, "{");  
  m2_print_array_contents (value_type (val), value_contents(val),
			   value_embedded_offset (val), addr, stream,
			   recurse, options, len);
  fprintf_filtered (stream, ", HIGH = %d}", (int) len);
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:28,代码来源:m2-valprint.c

示例5: c_print_type

void
c_print_type (struct type *type,
	      const char *varstring,
	      struct ui_file *stream,
	      int show, int level,
	      const struct type_print_options *flags)
{
  enum type_code code;
  int demangled_args;
  int need_post_space;
  const char *local_name;

  if (show > 0)
    CHECK_TYPEDEF (type);

  local_name = find_typedef_in_hash (flags, type);
  if (local_name != NULL)
    {
      fputs_filtered (local_name, stream);
      if (varstring != NULL && *varstring != '\0')
	fputs_filtered (" ", stream);
    }
  else
    {
      c_type_print_base (type, stream, show, level, flags);
      code = TYPE_CODE (type);
      if ((varstring != NULL && *varstring != '\0')
	  /* Need a space if going to print stars or brackets;
	     but not if we will print just a type name.  */
	  || ((show > 0 || TYPE_NAME (type) == 0)
	      && (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
		  || code == TYPE_CODE_METHOD
		  || (code == TYPE_CODE_ARRAY
		      && !TYPE_VECTOR (type))
		  || code == TYPE_CODE_MEMBERPTR
		  || code == TYPE_CODE_METHODPTR
		  || code == TYPE_CODE_REF)))
	fputs_filtered (" ", stream);
      need_post_space = (varstring != NULL && strcmp (varstring, "") != 0);
      c_type_print_varspec_prefix (type, stream, show, 0, need_post_space,
				   flags);
    }

  if (varstring != NULL)
    {
      fputs_filtered (varstring, stream);

      /* For demangled function names, we have the arglist as part of
         the name, so don't print an additional pair of ()'s.  */
      if (local_name == NULL)
	{
	  demangled_args = strchr (varstring, '(') != NULL;
	  c_type_print_varspec_suffix (type, stream, show,
				       0, demangled_args,
				       flags);
	}
    }
}
开发者ID:nds32,项目名称:binutils,代码行数:58,代码来源:c-typeprint.c

示例6: typy_fields

/* Return a sequence of all fields.  Each field is a dictionary with
   some pre-defined keys.  */
static PyObject *
typy_fields (PyObject *self, PyObject *args)
{
    PyObject *result;
    int i;
    struct type *type = ((type_object *) self)->type;
    volatile struct gdb_exception except;

    TRY_CATCH (except, RETURN_MASK_ALL)
    {
        CHECK_TYPEDEF (type);
    }
开发者ID:tkgunji,项目名称:RCU2_soft,代码行数:14,代码来源:py-type.c

示例7: c_print_typedef

void
c_print_typedef (struct type *type, struct symbol *new_symbol,
		 struct ui_file *stream)
{
  CHECK_TYPEDEF (type);
  fprintf_filtered (stream, "typedef ");
  type_print (type, "", stream, 0);
  if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0
      || strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
		 SYMBOL_LINKAGE_NAME (new_symbol)) != 0)
    fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new_symbol));
  fprintf_filtered (stream, ";\n");
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:13,代码来源:c-typeprint.c

示例8: go_classify_struct_type

enum go_type
go_classify_struct_type (struct type *type)
{
  CHECK_TYPEDEF (type);

  /* Recognize strings as they're useful to be able to print without
     pretty-printers.  */
  if (gccgo_string_p (type)
      || sixg_string_p (type))
    return GO_TYPE_STRING;

  return GO_TYPE_NONE;
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:13,代码来源:go-lang.c

示例9: numeric_type

/* Returns non-zero if the value is numeric */
int
numeric_type (struct type *type)
{
    CHECK_TYPEDEF (type);
    switch (TYPE_CODE (type))
    {
    case TYPE_CODE_INT:
    case TYPE_CODE_FLT:
        return 1;

    default:
        return 0;
    }
}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:15,代码来源:language.c

示例10: m2_print_typedef

void
m2_print_typedef (struct type *type, struct symbol *new_symbol,
		  struct ui_file *stream)
{
  CHECK_TYPEDEF (type);
  fprintf_filtered (stream, "TYPE ");
  if (!TYPE_NAME (SYMBOL_TYPE (new_symbol))
      || strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
		 SYMBOL_LINKAGE_NAME (new_symbol)) != 0)
    fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
  else
    fprintf_filtered (stream, "<builtin> = ");
  type_print (type, "", stream, 0);
  fprintf_filtered (stream, ";\n");
}
开发者ID:neon12345,项目名称:gdb,代码行数:15,代码来源:m2-typeprint.c

示例11: same_type

/* Returns non-zero if the two types are the same */
int
same_type (struct type *arg1, struct type *arg2)
{
    CHECK_TYPEDEF (type);
    if (structured_type (arg1) ? !structured_type (arg2) : structured_type (arg2))
        /* One is structured and one isn't */
        return 0;
    else if (structured_type (arg1) && structured_type (arg2))
        return arg1 == arg2;
    else if (numeric_type (arg1) && numeric_type (arg2))
        return (TYPE_CODE (arg2) == TYPE_CODE (arg1)) &&
               (TYPE_UNSIGNED (arg1) == TYPE_UNSIGNED (arg2))
               ? 1 : 0;
    else
        return arg1 == arg2;
}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:17,代码来源:language.c

示例12: print_record

static void
print_record (struct type *type, char *valaddr, struct ui_file *stream,
	      int format, int recurse, enum val_prettyprint pretty)
{
  CHECK_TYPEDEF (type);

  fprintf_filtered (stream, "(");

  if (print_field_values (type, valaddr, stream, format, recurse, pretty,
			  0, type, valaddr) != 0 && pretty)
    {
      fprintf_filtered (stream, "\n");
      print_spaces_filtered (2 * recurse, stream);
    }

  fprintf_filtered (stream, ")");
}
开发者ID:sjohnston-adventiumlabs,项目名称:xen-micart-scheduler,代码行数:17,代码来源:ada-valprint.c

示例13: ordered_type

/* Returns non-zero if its argument is of an ordered type.
   An ordered type is one in which the elements can be tested for the
   properties of "greater than", "less than", etc, or for which the
   operations "increment" or "decrement" make sense. */
int
ordered_type (struct type *type)
{
    CHECK_TYPEDEF (type);
    switch (TYPE_CODE (type))
    {
    case TYPE_CODE_INT:
    case TYPE_CODE_CHAR:
    case TYPE_CODE_ENUM:
    case TYPE_CODE_FLT:
    case TYPE_CODE_RANGE:
        return 1;

    default:
        return 0;
    }
}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:21,代码来源:language.c

示例14: integral_type

/* Returns non-zero if the type is integral */
int
integral_type (struct type *type)
{
    CHECK_TYPEDEF (type);
    switch (current_language->la_language)
    {
    case language_c:
    case language_cplus:
    case language_objc:
        return (TYPE_CODE (type) != TYPE_CODE_INT) &&
               (TYPE_CODE (type) != TYPE_CODE_ENUM) ? 0 : 1;
    case language_m2:
    case language_pascal:
        return TYPE_CODE (type) != TYPE_CODE_INT ? 0 : 1;
    default:
        error ("Language not supported.");
    }
}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:19,代码来源:language.c

示例15: pascal_object_print_static_field

static void
pascal_object_print_static_field (struct value *val,
				  struct ui_file *stream,
				  int recurse,
				  const struct value_print_options *options)
{
  struct type *type = value_type (val);
  struct value_print_options opts;

  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
    {
      CORE_ADDR *first_dont_print, addr;
      int i;

      first_dont_print
	= (CORE_ADDR *) obstack_base (&dont_print_statmem_obstack);
      i = (CORE_ADDR *) obstack_next_free (&dont_print_statmem_obstack)
	- first_dont_print;

      while (--i >= 0)
	{
	  if (value_address (val) == first_dont_print[i])
	    {
	      fputs_filtered ("<same as static member of an already seen type>",
			      stream);
	      return;
	    }
	}

      addr = value_address (val);
      obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
		    sizeof (CORE_ADDR));

      CHECK_TYPEDEF (type);
      pascal_object_print_value_fields (type, value_contents (val), addr,
					stream, recurse, NULL, options,
					NULL, 1);
      return;
    }

  opts = *options;
  opts.deref_ref = 0;
  common_val_print (val, stream, recurse, &opts, current_language);
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:44,代码来源:p-valprint.c


注:本文中的CHECK_TYPEDEF函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。