예제 #1
0
static void
set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
{
  if (strcmp (set_architecture_string, "auto") == 0)
    {
      target_architecture_auto = 1;
    }
  else if (GDB_MULTI_ARCH)
    {
      struct gdbarch_info info;
      gdbarch_info_init (&info);
      info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
      if (info.bfd_arch_info == NULL)
	internal_error (__FILE__, __LINE__,
			"set_architecture: bfd_scan_arch failed");
      if (gdbarch_update_p (info))
	target_architecture_auto = 0;
      else
	printf_unfiltered ("Architecture `%s' not recognized.\n",
			   set_architecture_string);
    }
  else
    {
      const struct bfd_arch_info *arch
	= bfd_scan_arch (set_architecture_string);
      if (arch == NULL)
	internal_error (__FILE__, __LINE__,
			"set_architecture: bfd_scan_arch failed");
      set_arch (arch, set_arch_manual);
    }
  show_architecture (NULL, from_tty);
}
예제 #2
0
static void
initialize_tdesc_arm_with_m (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("arm"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "sp", 13, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "lr", 14, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "pc", 15, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "xpsr", 25, 1, NULL, 32, "int");

  tdesc_arm_with_m = result;
}
예제 #3
0
static void
set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
{
  struct gdbarch_info info;

  gdbarch_info_init (&info);

  if (strcmp (set_architecture_string, "auto") == 0)
    {
      target_architecture_user = NULL;
      if (!gdbarch_update_p (info))
	internal_error (__FILE__, __LINE__,
			_("could not select an architecture automatically"));
    }
  else
    {
      info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
      if (info.bfd_arch_info == NULL)
	internal_error (__FILE__, __LINE__,
			_("set_architecture: bfd_scan_arch failed"));
      if (gdbarch_update_p (info))
	target_architecture_user = info.bfd_arch_info;
      else
	printf_unfiltered (_("Architecture `%s' not recognized.\n"),
			   set_architecture_string);
    }
  show_architecture (gdb_stdout, from_tty, NULL, NULL);
}
예제 #4
0
static SIM_RC
sim_model_init (SIM_DESC sd)
{
  SIM_CPU *cpu;

  /* If both cpu model and state architecture are set, ensure they're
     compatible.  If only one is set, set the other.  If neither are set,
     use the default model.  STATE_ARCHITECTURE is the bfd_arch_info data
     for the selected "mach" (bfd terminology).  */

  /* Only check cpu 0.  STATE_ARCHITECTURE is for that one only.  */
  /* ??? At present this only supports homogeneous multiprocessors.  */
  cpu = STATE_CPU (sd, 0);

  if (! STATE_ARCHITECTURE (sd)
      && ! CPU_MACH (cpu))
    {
      /* Set the default model.  */
      const MODEL *model = sim_model_lookup (WITH_DEFAULT_MODEL);
      sim_model_set (sd, NULL, model);
    }

  if (STATE_ARCHITECTURE (sd)
      && CPU_MACH (cpu))
    {
      if (strcmp (STATE_ARCHITECTURE (sd)->printable_name,
		  MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
	{
	  sim_io_eprintf (sd, "invalid model `%s' for `%s'\n",
			  MODEL_NAME (CPU_MODEL (cpu)),
			  STATE_ARCHITECTURE (sd)->printable_name);
	  return SIM_RC_FAIL;
	}
    }
  else if (STATE_ARCHITECTURE (sd))
    {
      /* Use the default model for the selected machine.
	 The default model is the first one in the list.  */
      const MACH *mach = sim_mach_lookup_bfd_name (STATE_ARCHITECTURE (sd)->printable_name);

      if (mach == NULL)
	{
	  sim_io_eprintf (sd, "unsupported machine `%s'\n",
			  STATE_ARCHITECTURE (sd)->printable_name);
	  return SIM_RC_FAIL;
	}
      sim_model_set (sd, NULL, MACH_MODELS (mach));
    }
  else
    {
      STATE_ARCHITECTURE (sd) = bfd_scan_arch (MACH_BFD_NAME (CPU_MACH (cpu)));
    }

  return SIM_RC_OK;
}
예제 #5
0
파일: main.c 프로젝트: grugq/tg-community
static int set_arch( struct opdis_options * opts, const char * arg ) {
	const bfd_arch_info_type * arch = bfd_scan_arch( arg );
	if (! arch ) {
		fprintf( stderr, "Unsupported architecture: '%s'\n", arg );
		return 0;
	}

	opts->arch = arch->mach;
	opts->arch_str = arg;

	return 1;
}
예제 #6
0
static void
gldelf64ltsmip_before_parse (void)
{
  const bfd_arch_info_type *arch = bfd_scan_arch ("mips");
  if (arch)
    {
      ldfile_output_architecture = arch->arch;
      ldfile_output_machine = arch->mach;
      ldfile_output_machine_name = arch->printable_name;
    }
  else
    ldfile_output_architecture = bfd_arch_mips;
  config.dynamic_link = TRUE;
  config.has_shared = TRUE;
}
예제 #7
0
파일: main.c 프로젝트: grugq/tg-community
static void configure_opdis( struct opdis_options * opts ) {
	opdis_t o = opts->opdis;
	const bfd_arch_info_type * arch_info = bfd_scan_arch( opts->arch_str );

	opdis_set_arch( o, arch_info->arch, opts->arch, NULL );

	if ( opts->disasm_opts && opts->disasm_opts[0] ) {
		opdis_set_disassembler_options( o, opts->disasm_opts );
	}

	opdis_set_x86_syntax( o, opts->syntax );

	opdis_set_display( o, opdis_display_cb, opts->insn_tree );
	opdis_set_resolver( o, opdis_resolver_cb, opts->map );
}
예제 #8
0
void
ldfile_set_output_arch (const char *string, enum bfd_architecture defarch)
{
  const bfd_arch_info_type *arch = bfd_scan_arch (string);

  if (arch)
    {
      ldfile_output_architecture = arch->arch;
      ldfile_output_machine = arch->mach;
      ldfile_output_machine_name = arch->printable_name;
    }
  else if (defarch != bfd_arch_unknown)
    ldfile_output_architecture = defarch;
  else
    einfo (_("%P%F: cannot represent machine `%s'\n"), string);
}
예제 #9
0
static void
initialize_tdesc_tic6x_c62x (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.tic6x.core");
  tdesc_create_reg (feature, "A0", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A1", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A13", 13, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A14", 14, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A15", 15, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B0", 16, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B1", 17, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B2", 18, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B3", 19, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B4", 20, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B5", 21, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B6", 22, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B7", 23, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B8", 24, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B9", 25, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B10", 26, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B11", 27, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B12", 28, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B13", 29, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B14", 30, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B15", 31, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "CSR", 32, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "PC", 33, 1, NULL, 32, "code_ptr");

  tdesc_tic6x_c62x = result;
}
예제 #10
0
bool disas_libopcode(FILE *fp_out, const char *machine, bool big_endian,
		     uint64_t addr, void *buf, size_t len)
{
	bfd *abfd = NULL;
	struct disassemble_info inf;
	const bfd_arch_info_type *arch_inf = bfd_scan_arch (machine);
	disassembler_ftype disas_fn;
	int size, pos;

	if (!arch_inf) {
		return false;
	}

	abfd = bfd_openr("/dev/null", "binary");
	abfd->arch_info = arch_inf;

	init_disassemble_info (&inf, fp_out, (fprintf_ftype) fprintf);
	inf.buffer = buf;
	inf.buffer_vma = addr;
	inf.buffer_length = len;
	inf.endian = big_endian ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
	inf.print_address_func = print_address;

	disassemble_init_for_target(&inf);

	disas_fn = disassembler (abfd);
	pos = 0;
	do {
		fprintf(fp_out, "%" PRIx64 "\t", addr + pos);
		size = disas_fn(addr + pos, &inf);
		pos += size;
		fputc('\n', fp_out);
	} while (pos < len);
	bfd_close(abfd);
	return true;
}
예제 #11
0
파일: tic6x-c64xp.c 프로젝트: 5kg/gdb
static void
initialize_tdesc_tic6x_c64xp (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.tic6x.core");
  tdesc_create_reg (feature, "A0", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A1", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A13", 13, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A14", 14, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A15", 15, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B0", 16, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B1", 17, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B2", 18, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B3", 19, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B4", 20, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B5", 21, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B6", 22, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B7", 23, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B8", 24, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B9", 25, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B10", 26, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B11", 27, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B12", 28, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B13", 29, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B14", 30, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B15", 31, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "CSR", 32, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "PC", 33, 1, NULL, 32, "code_ptr");

  feature = tdesc_create_feature (result, "org.gnu.gdb.tic6x.gp");
  tdesc_create_reg (feature, "A16", 34, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A17", 35, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A18", 36, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A19", 37, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A20", 38, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A21", 39, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A22", 40, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A23", 41, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A24", 42, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A25", 43, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A26", 44, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A27", 45, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A28", 46, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A29", 47, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A30", 48, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "A31", 49, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B16", 50, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B17", 51, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B18", 52, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B19", 53, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B20", 54, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B21", 55, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B22", 56, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B23", 57, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B24", 58, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B25", 59, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B26", 60, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B27", 61, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B28", 62, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B29", 63, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B30", 64, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "B31", 65, 1, NULL, 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.tic6x.c6xp");
  tdesc_create_reg (feature, "TSR", 66, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ILC", 67, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "RILC", 68, 1, NULL, 32, "uint32");

  tdesc_tic6x_c64xp = result;
}
예제 #12
0
static SIM_RC
standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
			 char *arg, int is_command)
{
  int i,n;

  switch ((STANDARD_OPTIONS) opt)
    {
    case OPTION_VERBOSE:
      STATE_VERBOSE_P (sd) = 1;
      break;

#ifdef SIM_HAVE_BIENDIAN
    case OPTION_ENDIAN:
      if (strcmp (arg, "big") == 0)
	{
	  if (WITH_TARGET_BYTE_ORDER == LITTLE_ENDIAN)
	    {
	      sim_io_eprintf (sd, "Simulator compiled for little endian only.\n");
	      return SIM_RC_FAIL;
	    }
	  /* FIXME:wip: Need to set something in STATE_CONFIG.  */
	  current_target_byte_order = BIG_ENDIAN;
	}
      else if (strcmp (arg, "little") == 0)
	{
	  if (WITH_TARGET_BYTE_ORDER == BIG_ENDIAN)
	    {
	      sim_io_eprintf (sd, "Simulator compiled for big endian only.\n");
	      return SIM_RC_FAIL;
	    }
	  /* FIXME:wip: Need to set something in STATE_CONFIG.  */
	  current_target_byte_order = LITTLE_ENDIAN;
	}
      else
	{
	  sim_io_eprintf (sd, "Invalid endian specification `%s'\n", arg);
	  return SIM_RC_FAIL;
	}
      break;
#endif

    case OPTION_ENVIRONMENT:
      if (strcmp (arg, "user") == 0)
	STATE_ENVIRONMENT (sd) = USER_ENVIRONMENT;
      else if (strcmp (arg, "virtual") == 0)
	STATE_ENVIRONMENT (sd) = VIRTUAL_ENVIRONMENT;
      else if (strcmp (arg, "operating") == 0)
	STATE_ENVIRONMENT (sd) = OPERATING_ENVIRONMENT;
      else
	{
	  sim_io_eprintf (sd, "Invalid environment specification `%s'\n", arg);
	  return SIM_RC_FAIL;
	}
      if (WITH_ENVIRONMENT != ALL_ENVIRONMENT
	  && WITH_ENVIRONMENT != STATE_ENVIRONMENT (sd))
	{
	  char *type;
	  switch (WITH_ENVIRONMENT)
	    {
	    case USER_ENVIRONMENT: type = "user"; break;
	    case VIRTUAL_ENVIRONMENT: type = "virtual"; break;
	    case OPERATING_ENVIRONMENT: type = "operating"; break;
	    }
	  sim_io_eprintf (sd, "Simulator compiled for the %s environment only.\n",
			  type);
	  return SIM_RC_FAIL;
	}
      break;

    case OPTION_ALIGNMENT:
      if (strcmp (arg, "strict") == 0)
	{
	  if (WITH_ALIGNMENT == 0 || WITH_ALIGNMENT == STRICT_ALIGNMENT)
	    {
	      current_alignment = STRICT_ALIGNMENT;
	      break;
	    }
	}
      else if (strcmp (arg, "nonstrict") == 0)
	{
	  if (WITH_ALIGNMENT == 0 || WITH_ALIGNMENT == NONSTRICT_ALIGNMENT)
	    {
	      current_alignment = NONSTRICT_ALIGNMENT;
	      break;
	    }
	}
      else if (strcmp (arg, "forced") == 0)
	{
	  if (WITH_ALIGNMENT == 0 || WITH_ALIGNMENT == FORCED_ALIGNMENT)
	    {
	      current_alignment = FORCED_ALIGNMENT;
	      break;
	    }
	}
      else
	{
	  sim_io_eprintf (sd, "Invalid alignment specification `%s'\n", arg);
	  return SIM_RC_FAIL;
	}
      switch (WITH_ALIGNMENT)
	{
	case STRICT_ALIGNMENT:
	  sim_io_eprintf (sd, "Simulator compiled for strict alignment only.\n");
	  break;
	case NONSTRICT_ALIGNMENT:
	  sim_io_eprintf (sd, "Simulator compiled for nonstrict alignment only.\n");
	  break;
	case FORCED_ALIGNMENT:
	  sim_io_eprintf (sd, "Simulator compiled for forced alignment only.\n");
	  break;
	}
      return SIM_RC_FAIL;

    case OPTION_DEBUG:
      if (! WITH_DEBUG)
	sim_io_eprintf (sd, "Debugging not compiled in, `-D' ignored\n");
      else
	{
	  for (n = 0; n < MAX_NR_PROCESSORS; ++n)
	    for (i = 0; i < MAX_DEBUG_VALUES; ++i)
	      CPU_DEBUG_FLAGS (STATE_CPU (sd, n))[i] = 1;
	}
      break;

    case OPTION_DEBUG_INSN :
      if (! WITH_DEBUG)
	sim_io_eprintf (sd, "Debugging not compiled in, `--debug-insn' ignored\n");
      else
	{
	  for (n = 0; n < MAX_NR_PROCESSORS; ++n)
	    CPU_DEBUG_FLAGS (STATE_CPU (sd, n))[DEBUG_INSN_IDX] = 1;
	}
      break;

    case OPTION_DEBUG_FILE :
      if (! WITH_DEBUG)
	sim_io_eprintf (sd, "Debugging not compiled in, `--debug-file' ignored\n");
      else
	{
	  FILE *f = fopen (arg, "w");

	  if (f == NULL)
	    {
	      sim_io_eprintf (sd, "Unable to open debug output file `%s'\n", arg);
	      return SIM_RC_FAIL;
	    }
	  for (n = 0; n < MAX_NR_PROCESSORS; ++n)
	    CPU_DEBUG_FILE (STATE_CPU (sd, n)) = f;
	}
      break;

#ifdef SIM_H8300 /* FIXME: Can be moved to h8300 dir.  */
    case OPTION_H8300:
      set_h8300h (1,0);
      break;
    case OPTION_H8300S:
      set_h8300h (1,1);
      break;
#endif

#ifdef SIM_HAVE_FLATMEM
    case OPTION_MEM_SIZE:
      {
	unsigned long ul = strtol (arg, NULL, 0);
	/* 16384: some minimal amount */
	if (! isdigit (arg[0]) || ul < 16384)
	  {
	    sim_io_eprintf (sd, "Invalid memory size `%s'", arg);
	    return SIM_RC_FAIL;
	  }
	STATE_MEM_SIZE (sd) = ul;
      }
      break;
#endif

    case OPTION_DO_COMMAND:
      sim_do_command (sd, arg);
      break;

    case OPTION_ARCHITECTURE:
      {
	const struct bfd_arch_info *ap = bfd_scan_arch (arg);
	if (ap == NULL)
	  {
	    sim_io_eprintf (sd, "Architecture `%s' unknown\n", arg);
	    return SIM_RC_FAIL;
	  }
	STATE_ARCHITECTURE (sd) = ap;
	break;
      }

    case OPTION_ARCHITECTURE_INFO:
      {
	const char **list = bfd_arch_list();
	const char **lp;
	if (list == NULL)
	  abort ();
	sim_io_printf (sd, "Possible architectures:");
	for (lp = list; *lp != NULL; lp++)
	  sim_io_printf (sd, " %s", *lp);
	sim_io_printf (sd, "\n");
	free (list);
	break;
      }

    case OPTION_TARGET:
      {
	STATE_TARGET (sd) = xstrdup (arg);
	break;
      }

    case OPTION_LOAD_LMA:
      {
	STATE_LOAD_AT_LMA_P (sd) = 1;
	break;
      }

    case OPTION_LOAD_VMA:
      {
	STATE_LOAD_AT_LMA_P (sd) = 0;
	break;
      }

    case OPTION_HELP:
      sim_print_help (sd, is_command);
      if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE)
	exit (0);
      /* FIXME: 'twould be nice to do something similar if gdb.  */
      break;
    }

  return SIM_RC_OK;
}
예제 #13
0
static void
initialize_tdesc_amd64_mpx_linux (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type;
  struct tdesc_type *type;

  set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64"));

  set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
  type = tdesc_create_flags (feature, "i386_eflags", 4);
  tdesc_add_flag (type, 0, "CF");
  tdesc_add_flag (type, 1, "");
  tdesc_add_flag (type, 2, "PF");
  tdesc_add_flag (type, 4, "AF");
  tdesc_add_flag (type, 6, "ZF");
  tdesc_add_flag (type, 7, "SF");
  tdesc_add_flag (type, 8, "TF");
  tdesc_add_flag (type, 9, "IF");
  tdesc_add_flag (type, 10, "DF");
  tdesc_add_flag (type, 11, "OF");
  tdesc_add_flag (type, 14, "NT");
  tdesc_add_flag (type, 16, "RF");
  tdesc_add_flag (type, 17, "VM");
  tdesc_add_flag (type, 18, "AC");
  tdesc_add_flag (type, 19, "VIF");
  tdesc_add_flag (type, 20, "VIP");
  tdesc_add_flag (type, 21, "ID");

  tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rdx", 3, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rsi", 4, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rdi", 5, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rbp", 6, 1, NULL, 64, "data_ptr");
  tdesc_create_reg (feature, "rsp", 7, 1, NULL, 64, "data_ptr");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rip", 16, 1, NULL, 64, "code_ptr");
  tdesc_create_reg (feature, "eflags", 17, 1, NULL, 32, "i386_eflags");
  tdesc_create_reg (feature, "cs", 18, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ss", 19, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ds", 20, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "es", 21, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "fs", 22, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "gs", 23, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "st0", 24, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st1", 25, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st2", 26, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st3", 27, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st4", 28, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st5", 29, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st6", 30, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st7", 31, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "fctrl", 32, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fstat", 33, 1, "float", 32, "int");
  tdesc_create_reg (feature, "ftag", 34, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fiseg", 35, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fioff", 36, 1, "float", 32, "int");
  tdesc_create_reg (feature, "foseg", 37, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fooff", 38, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fop", 39, 1, "float", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
  field_type = tdesc_named_type (feature, "ieee_single");
  tdesc_create_vector (feature, "v4f", field_type, 4);

  field_type = tdesc_named_type (feature, "ieee_double");
  tdesc_create_vector (feature, "v2d", field_type, 2);

  field_type = tdesc_named_type (feature, "int8");
  tdesc_create_vector (feature, "v16i8", field_type, 16);

  field_type = tdesc_named_type (feature, "int16");
  tdesc_create_vector (feature, "v8i16", field_type, 8);

  field_type = tdesc_named_type (feature, "int32");
  tdesc_create_vector (feature, "v4i32", field_type, 4);

  field_type = tdesc_named_type (feature, "int64");
  tdesc_create_vector (feature, "v2i64", field_type, 2);

  type = tdesc_create_union (feature, "vec128");
  field_type = tdesc_named_type (feature, "v4f");
  tdesc_add_field (type, "v4_float", field_type);
  field_type = tdesc_named_type (feature, "v2d");
  tdesc_add_field (type, "v2_double", field_type);
  field_type = tdesc_named_type (feature, "v16i8");
  tdesc_add_field (type, "v16_int8", field_type);
  field_type = tdesc_named_type (feature, "v8i16");
  tdesc_add_field (type, "v8_int16", field_type);
  field_type = tdesc_named_type (feature, "v4i32");
  tdesc_add_field (type, "v4_int32", field_type);
  field_type = tdesc_named_type (feature, "v2i64");
  tdesc_add_field (type, "v2_int64", field_type);
  field_type = tdesc_named_type (feature, "uint128");
  tdesc_add_field (type, "uint128", field_type);

  type = tdesc_create_flags (feature, "i386_mxcsr", 4);
  tdesc_add_flag (type, 0, "IE");
  tdesc_add_flag (type, 1, "DE");
  tdesc_add_flag (type, 2, "ZE");
  tdesc_add_flag (type, 3, "OE");
  tdesc_add_flag (type, 4, "UE");
  tdesc_add_flag (type, 5, "PE");
  tdesc_add_flag (type, 6, "DAZ");
  tdesc_add_flag (type, 7, "IM");
  tdesc_add_flag (type, 8, "DM");
  tdesc_add_flag (type, 9, "ZM");
  tdesc_add_flag (type, 10, "OM");
  tdesc_add_flag (type, 11, "UM");
  tdesc_add_flag (type, 12, "PM");
  tdesc_add_flag (type, 15, "FZ");

  tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm3", 43, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm4", 44, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm5", 45, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm6", 46, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm7", 47, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm8", 48, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm9", 49, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm10", 50, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm11", 51, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm12", 52, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm13", 53, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm14", 54, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm15", 55, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "mxcsr", 56, 1, "vector", 32, "i386_mxcsr");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
  tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
  type = tdesc_create_struct (feature, "br128");
  field_type = tdesc_named_type (feature, "uint64");
  tdesc_add_field (type, "lbound", field_type);
  field_type = tdesc_named_type (feature, "uint64");
  tdesc_add_field (type, "ubound_raw", field_type);

  type = tdesc_create_struct (feature, "_bndstatus");
  tdesc_set_struct_size (type, 8);
  tdesc_add_bitfield (type, "bde", 2, 63);
  tdesc_add_bitfield (type, "error", 0, 1);

  type = tdesc_create_union (feature, "status");
  field_type = tdesc_named_type (feature, "data_ptr");
  tdesc_add_field (type, "raw", field_type);
  field_type = tdesc_named_type (feature, "_bndstatus");
  tdesc_add_field (type, "status", field_type);

  type = tdesc_create_struct (feature, "_bndcfgu");
  tdesc_set_struct_size (type, 8);
  tdesc_add_bitfield (type, "base", 12, 63);
  tdesc_add_bitfield (type, "reserved", 2, 11);
  tdesc_add_bitfield (type, "preserved", 1, 1);
  tdesc_add_bitfield (type, "enabled", 0, 0);

  type = tdesc_create_union (feature, "cfgu");
  field_type = tdesc_named_type (feature, "data_ptr");
  tdesc_add_field (type, "raw", field_type);
  field_type = tdesc_named_type (feature, "_bndcfgu");
  tdesc_add_field (type, "config", field_type);

  tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
  tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
  tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
  tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
  tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
  tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");

  tdesc_amd64_mpx_linux = result;
}
예제 #14
0
static void
initialize_tdesc_s390x_te_linux64 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("s390:64-bit"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.core");
  tdesc_create_reg (feature, "pswm", 0, 1, "psw", 64, "uint64");
  tdesc_create_reg (feature, "pswa", 1, 1, "psw", 64, "uint64");
  tdesc_create_reg (feature, "r0", 2, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r1", 3, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r2", 4, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r3", 5, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r4", 6, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r5", 7, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r6", 8, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r7", 9, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r8", 10, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r9", 11, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r10", 12, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r11", 13, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r12", 14, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r13", 15, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r14", 16, 1, "general", 64, "uint64");
  tdesc_create_reg (feature, "r15", 17, 1, "general", 64, "uint64");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.acr");
  tdesc_create_reg (feature, "acr0", 18, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr1", 19, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr2", 20, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr3", 21, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr4", 22, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr5", 23, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr6", 24, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr7", 25, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr8", 26, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr9", 27, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr10", 28, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr11", 29, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr12", 30, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr13", 31, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr14", 32, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr15", 33, 1, "access", 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.fpr");
  tdesc_create_reg (feature, "fpc", 34, 1, "float", 32, "uint32");
  tdesc_create_reg (feature, "f0", 35, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f1", 36, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f2", 37, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f3", 38, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f4", 39, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f5", 40, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f6", 41, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f7", 42, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f8", 43, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f9", 44, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f10", 45, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f11", 46, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f12", 47, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f13", 48, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f14", 49, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f15", 50, 1, "float", 64, "ieee_double");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.linux");
  tdesc_create_reg (feature, "orig_r2", 51, 1, "system", 64, "uint64");
  tdesc_create_reg (feature, "last_break", 52, 0, "system", 64, "code_ptr");
  tdesc_create_reg (feature, "system_call", 53, 1, "system", 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.tdb");
  tdesc_create_reg (feature, "tdb0", 54, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tac", 55, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tct", 56, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "atia", 57, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr0", 58, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr1", 59, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr2", 60, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr3", 61, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr4", 62, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr5", 63, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr6", 64, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr7", 65, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr8", 66, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr9", 67, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr10", 68, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr11", 69, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr12", 70, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr13", 71, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr14", 72, 1, "tdb", 64, "uint64");
  tdesc_create_reg (feature, "tr15", 73, 1, "tdb", 64, "uint64");

  tdesc_s390x_te_linux64 = result;
}
예제 #15
0
static void
initialize_tdesc_powerpc_e500 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type, *type;

  set_tdesc_architecture (result, bfd_scan_arch ("powerpc:e500"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.spe");
  tdesc_create_reg (feature, "ev0h", 32, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev1h", 33, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev2h", 34, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev3h", 35, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev4h", 36, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev5h", 37, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev6h", 38, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev7h", 39, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev8h", 40, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev9h", 41, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev10h", 42, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev11h", 43, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev12h", 44, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev13h", 45, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev14h", 46, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev15h", 47, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev16h", 48, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev17h", 49, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev18h", 50, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev19h", 51, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev20h", 52, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev21h", 53, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev22h", 54, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev23h", 55, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev24h", 56, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev25h", 57, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev26h", 58, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev27h", 59, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev28h", 60, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev29h", 61, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev30h", 62, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "ev31h", 63, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "acc", 73, 1, NULL, 64, "int");
  tdesc_create_reg (feature, "spefscr", 74, 1, NULL, 32, "int");

  tdesc_powerpc_e500 = result;
}
예제 #16
0
static void
initialize_tdesc_i386_mmx_linux (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type;
  struct tdesc_type *type;

  set_tdesc_architecture (result, bfd_scan_arch ("i386"));

  set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
  type = tdesc_create_flags (feature, "i386_eflags", 4);
  tdesc_add_flag (type, 0, "CF");
  tdesc_add_flag (type, 1, "");
  tdesc_add_flag (type, 2, "PF");
  tdesc_add_flag (type, 4, "AF");
  tdesc_add_flag (type, 6, "ZF");
  tdesc_add_flag (type, 7, "SF");
  tdesc_add_flag (type, 8, "TF");
  tdesc_add_flag (type, 9, "IF");
  tdesc_add_flag (type, 10, "DF");
  tdesc_add_flag (type, 11, "OF");
  tdesc_add_flag (type, 14, "NT");
  tdesc_add_flag (type, 16, "RF");
  tdesc_add_flag (type, 17, "VM");
  tdesc_add_flag (type, 18, "AC");
  tdesc_add_flag (type, 19, "VIF");
  tdesc_add_flag (type, 20, "VIP");
  tdesc_add_flag (type, 21, "ID");

  tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ebx", 3, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "esp", 4, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "ebp", 5, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "esi", 6, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "edi", 7, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "eip", 8, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "eflags", 9, 1, NULL, 32, "i386_eflags");
  tdesc_create_reg (feature, "cs", 10, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ss", 11, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ds", 12, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "es", 13, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "fs", 14, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "gs", 15, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "st0", 16, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st1", 17, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st2", 18, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st3", 19, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st4", 20, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st5", 21, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st6", 22, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st7", 23, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "fctrl", 24, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fstat", 25, 1, "float", 32, "int");
  tdesc_create_reg (feature, "ftag", 26, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fiseg", 27, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fioff", 28, 1, "float", 32, "int");
  tdesc_create_reg (feature, "foseg", 29, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fooff", 30, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fop", 31, 1, "float", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
  tdesc_create_reg (feature, "orig_eax", 41, 1, NULL, 32, "int");

  tdesc_i386_mmx_linux = result;
}
예제 #17
0
void
initialize_current_architecture (void)
{
  const char **arches = gdbarch_printable_names ();

  /* determine a default architecture and byte order. */
  struct gdbarch_info info;
  gdbarch_info_init (&info);
  
  /* Find a default architecture. */
  if (info.bfd_arch_info == NULL
      && default_bfd_arch != NULL)
    info.bfd_arch_info = default_bfd_arch;
  if (info.bfd_arch_info == NULL)
    {
      /* Choose the architecture by taking the first one
	 alphabetically. */
      const char *chosen = arches[0];
      const char **arch;
      for (arch = arches; *arch != NULL; arch++)
	{
	  if (strcmp (*arch, chosen) < 0)
	    chosen = *arch;
	}
      if (chosen == NULL)
	internal_error (__FILE__, __LINE__,
			"initialize_current_architecture: No arch");
      info.bfd_arch_info = bfd_scan_arch (chosen);
      if (info.bfd_arch_info == NULL)
	internal_error (__FILE__, __LINE__,
			"initialize_current_architecture: Arch not found");
    }

  /* Take several guesses at a byte order.  */
  if (info.byte_order == BFD_ENDIAN_UNKNOWN
      && default_bfd_vec != NULL)
    {
      /* Extract BFD's default vector's byte order. */
      switch (default_bfd_vec->byteorder)
	{
	case BFD_ENDIAN_BIG:
	  info.byte_order = BFD_ENDIAN_BIG;
	  break;
	case BFD_ENDIAN_LITTLE:
	  info.byte_order = BFD_ENDIAN_LITTLE;
	  break;
	default:
	  break;
	}
    }
  if (info.byte_order == BFD_ENDIAN_UNKNOWN)
    {
      /* look for ``*el-*'' in the target name. */
      const char *chp;
      chp = strchr (target_name, '-');
      if (chp != NULL
	  && chp - 2 >= target_name
	  && strncmp (chp - 2, "el", 2) == 0)
	info.byte_order = BFD_ENDIAN_LITTLE;
    }
  if (info.byte_order == BFD_ENDIAN_UNKNOWN)
    {
      /* Wire it to big-endian!!! */
      info.byte_order = BFD_ENDIAN_BIG;
    }

  if (GDB_MULTI_ARCH)
    {
      if (! gdbarch_update_p (info))
	{
	  internal_error (__FILE__, __LINE__,
			  "initialize_current_architecture: Selection of initial architecture failed");
	}
    }
  else
    {
      /* If the multi-arch logic comes up with a byte-order (from BFD)
         use it for the non-multi-arch case.  */
      if (info.byte_order != BFD_ENDIAN_UNKNOWN)
	target_byte_order = info.byte_order;
      initialize_non_multiarch ();
    }

  /* Create the ``set architecture'' command appending ``auto'' to the
     list of architectures. */
  {
    struct cmd_list_element *c;
    /* Append ``auto''. */
    int nr;
    for (nr = 0; arches[nr] != NULL; nr++);
    arches = xrealloc (arches, sizeof (char*) * (nr + 2));
    arches[nr + 0] = "auto";
    arches[nr + 1] = NULL;
    /* FIXME: add_set_enum_cmd() uses an array of ``char *'' instead
       of ``const char *''.  We just happen to know that the casts are
       safe. */
    c = add_set_enum_cmd ("architecture", class_support,
			  arches, &set_architecture_string,
			  "Set architecture of target.",
			  &setlist);
    set_cmd_sfunc (c, set_architecture);
    add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
    /* Don't use set_from_show - need to print both auto/manual and
       current setting. */
    add_cmd ("architecture", class_support, show_architecture,
	     "Show the current target architecture", &showlist);
  }
}
예제 #18
0
static void
initialize_tdesc_i386_avx_avx512_linux (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type;
  struct tdesc_type *type;

  set_tdesc_architecture (result, bfd_scan_arch ("i386"));

  set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
  type = tdesc_create_flags (feature, "i386_eflags", 4);
  tdesc_add_flag (type, 0, "CF");
  tdesc_add_flag (type, 1, "");
  tdesc_add_flag (type, 2, "PF");
  tdesc_add_flag (type, 4, "AF");
  tdesc_add_flag (type, 6, "ZF");
  tdesc_add_flag (type, 7, "SF");
  tdesc_add_flag (type, 8, "TF");
  tdesc_add_flag (type, 9, "IF");
  tdesc_add_flag (type, 10, "DF");
  tdesc_add_flag (type, 11, "OF");
  tdesc_add_flag (type, 14, "NT");
  tdesc_add_flag (type, 16, "RF");
  tdesc_add_flag (type, 17, "VM");
  tdesc_add_flag (type, 18, "AC");
  tdesc_add_flag (type, 19, "VIF");
  tdesc_add_flag (type, 20, "VIP");
  tdesc_add_flag (type, 21, "ID");

  tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ebx", 3, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "esp", 4, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "ebp", 5, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "esi", 6, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "edi", 7, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "eip", 8, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "eflags", 9, 1, NULL, 32, "i386_eflags");
  tdesc_create_reg (feature, "cs", 10, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ss", 11, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ds", 12, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "es", 13, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "fs", 14, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "gs", 15, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "st0", 16, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st1", 17, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st2", 18, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st3", 19, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st4", 20, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st5", 21, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st6", 22, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st7", 23, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "fctrl", 24, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fstat", 25, 1, "float", 32, "int");
  tdesc_create_reg (feature, "ftag", 26, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fiseg", 27, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fioff", 28, 1, "float", 32, "int");
  tdesc_create_reg (feature, "foseg", 29, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fooff", 30, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fop", 31, 1, "float", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
  field_type = tdesc_named_type (feature, "ieee_single");
  tdesc_create_vector (feature, "v4f", field_type, 4);

  field_type = tdesc_named_type (feature, "ieee_double");
  tdesc_create_vector (feature, "v2d", field_type, 2);

  field_type = tdesc_named_type (feature, "int8");
  tdesc_create_vector (feature, "v16i8", field_type, 16);

  field_type = tdesc_named_type (feature, "int16");
  tdesc_create_vector (feature, "v8i16", field_type, 8);

  field_type = tdesc_named_type (feature, "int32");
  tdesc_create_vector (feature, "v4i32", field_type, 4);

  field_type = tdesc_named_type (feature, "int64");
  tdesc_create_vector (feature, "v2i64", field_type, 2);

  type = tdesc_create_union (feature, "vec128");
  field_type = tdesc_named_type (feature, "v4f");
  tdesc_add_field (type, "v4_float", field_type);
  field_type = tdesc_named_type (feature, "v2d");
  tdesc_add_field (type, "v2_double", field_type);
  field_type = tdesc_named_type (feature, "v16i8");
  tdesc_add_field (type, "v16_int8", field_type);
  field_type = tdesc_named_type (feature, "v8i16");
  tdesc_add_field (type, "v8_int16", field_type);
  field_type = tdesc_named_type (feature, "v4i32");
  tdesc_add_field (type, "v4_int32", field_type);
  field_type = tdesc_named_type (feature, "v2i64");
  tdesc_add_field (type, "v2_int64", field_type);
  field_type = tdesc_named_type (feature, "uint128");
  tdesc_add_field (type, "uint128", field_type);

  type = tdesc_create_flags (feature, "i386_mxcsr", 4);
  tdesc_add_flag (type, 0, "IE");
  tdesc_add_flag (type, 1, "DE");
  tdesc_add_flag (type, 2, "ZE");
  tdesc_add_flag (type, 3, "OE");
  tdesc_add_flag (type, 4, "UE");
  tdesc_add_flag (type, 5, "PE");
  tdesc_add_flag (type, 6, "DAZ");
  tdesc_add_flag (type, 7, "IM");
  tdesc_add_flag (type, 8, "DM");
  tdesc_add_flag (type, 9, "ZM");
  tdesc_add_flag (type, 10, "OM");
  tdesc_add_flag (type, 11, "UM");
  tdesc_add_flag (type, 12, "PM");
  tdesc_add_flag (type, 15, "FZ");

  tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm3", 35, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm4", 36, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm5", 37, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm6", 38, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm7", 39, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "mxcsr", 40, 1, "vector", 32, "i386_mxcsr");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
  tdesc_create_reg (feature, "orig_eax", 41, 1, NULL, 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
  tdesc_create_reg (feature, "ymm0h", 42, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm1h", 43, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm2h", 44, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm3h", 45, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm4h", 46, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm5h", 47, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm6h", 48, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm7h", 49, 1, NULL, 128, "uint128");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512");
  field_type = tdesc_named_type (feature, "uint128");
  tdesc_create_vector (feature, "v2ui128", field_type, 2);

  tdesc_create_reg (feature, "k0", 50, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k1", 51, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k2", 52, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k3", 53, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k4", 54, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k5", 55, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k6", 56, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k7", 57, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "zmm0h", 58, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm1h", 59, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm2h", 60, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm3h", 61, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm4h", 62, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm5h", 63, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm6h", 64, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm7h", 65, 1, NULL, 256, "v2ui128");

  tdesc_i386_avx_avx512_linux = result;
}
예제 #19
0
static void
initialize_tdesc_powerpc_vsx64 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct type *field_type, *type;

  set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr");
  tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr");
  tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
  tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec");
  field_type = tdesc_named_type (feature, "ieee_single");
  type = init_vector_type (field_type, 4);
  TYPE_NAME (type) = xstrdup ("v4f");
  tdesc_record_type (feature, type);

  field_type = tdesc_named_type (feature, "int32");
  type = init_vector_type (field_type, 4);
  TYPE_NAME (type) = xstrdup ("v4i32");
  tdesc_record_type (feature, type);

  field_type = tdesc_named_type (feature, "int16");
  type = init_vector_type (field_type, 8);
  TYPE_NAME (type) = xstrdup ("v8i16");
  tdesc_record_type (feature, type);

  field_type = tdesc_named_type (feature, "int8");
  type = init_vector_type (field_type, 16);
  TYPE_NAME (type) = xstrdup ("v16i8");
  tdesc_record_type (feature, type);

  type = init_composite_type (NULL, TYPE_CODE_UNION);
  TYPE_NAME (type) = xstrdup ("vec128");
  field_type = tdesc_named_type (feature, "uint128");
  append_composite_type_field (type, xstrdup ("uint128"), field_type);
  field_type = tdesc_named_type (feature, "v4f");
  append_composite_type_field (type, xstrdup ("v4_float"), field_type);
  field_type = tdesc_named_type (feature, "v4i32");
  append_composite_type_field (type, xstrdup ("v4_int32"), field_type);
  field_type = tdesc_named_type (feature, "v8i16");
  append_composite_type_field (type, xstrdup ("v8_int16"), field_type);
  field_type = tdesc_named_type (feature, "v16i8");
  append_composite_type_field (type, xstrdup ("v16_int8"), field_type);
  TYPE_VECTOR (type) = 1;
  tdesc_record_type (feature, type);

  tdesc_create_reg (feature, "vr0", 71, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr1", 72, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr2", 73, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr3", 74, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr4", 75, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr5", 76, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr6", 77, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr7", 78, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr8", 79, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr9", 80, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr10", 81, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr11", 82, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr12", 83, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr13", 84, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr14", 85, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr15", 86, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr16", 87, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr17", 88, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr18", 89, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr19", 90, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr20", 91, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr21", 92, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr22", 93, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr23", 94, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr24", 95, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr25", 96, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr26", 97, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr27", 98, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr28", 99, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr29", 100, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr30", 101, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr31", 102, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vscr", 103, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "vrsave", 104, 1, "vector", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.vsx");
  tdesc_create_reg (feature, "vs0h", 105, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs1h", 106, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs2h", 107, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs3h", 108, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs4h", 109, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs5h", 110, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs6h", 111, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs7h", 112, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs8h", 113, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs9h", 114, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs10h", 115, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs11h", 116, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs12h", 117, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs13h", 118, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs14h", 119, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs15h", 120, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs16h", 121, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs17h", 122, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs18h", 123, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs19h", 124, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs20h", 125, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs21h", 126, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs22h", 127, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs23h", 128, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs24h", 129, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs25h", 130, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs26h", 131, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs27h", 132, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs28h", 133, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs29h", 134, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs30h", 135, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "vs31h", 136, 1, NULL, 64, "uint64");

  tdesc_powerpc_vsx64 = result;
}
예제 #20
0
파일: dis_asm.c 프로젝트: lemin9538/skyeye
void init_disassemble(){
	abfd = malloc(sizeof(bfd));
	init_disassemble_info (&disasm_info, stdout, (fprintf_ftype) fprintf);
	disasm_info.print_address_func = objdump_print_address;
	disasm_info.symbol_at_address_func = objdump_symbol_at_address;

	/*
	 * choose arch infor since we will select different disassemble function.
	 */
	generic_arch_t* arch_instance = get_arch_instance("");
	machine = arch_instance->arch_name;	
	const bfd_arch_info_type *info = bfd_scan_arch (machine);
	if (info == NULL){
        	//fatal (_("Can't use supplied machine %s"), machine);
		printf("Can't use supplied machine %s\n", machine);
		return;
	}

	abfd->arch_info = info;
	
	/*
	 * endian selection
	 */
	if (endian != BFD_ENDIAN_UNKNOWN)
	{
		struct bfd_target *xvec;

		xvec = xmalloc (sizeof (struct bfd_target));
		//memcpy (xvec, abfd->xvec, sizeof (struct bfd_target));
		xvec->byteorder = endian;
		abfd->xvec = xvec;
	}
	/* Get a disassemble function according to the arch and endian of abfd */
	disassemble_fn = disassembler (abfd);
	if(!disassemble_fn)
	{
      /*
	non_fatal (_("Can't disassemble for architecture %s\n"),
                 bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
	*/
		printf("Can't disassemble for architecture %s\n", bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
		exit_status = 1;
		return;
	}

	disasm_info.flavour = bfd_get_flavour (abfd);
	disasm_info.arch = bfd_get_arch (abfd);
	disasm_info.mach = bfd_get_mach (abfd);
	disasm_info.disassembler_options = disassembler_options;
	disasm_info.octets_per_byte = bfd_octets_per_byte (abfd);
	disasm_info.skip_zeroes = DEFAULT_SKIP_ZEROES;
	disasm_info.skip_zeroes_at_end = DEFAULT_SKIP_ZEROES_AT_END;
	disasm_info.disassembler_needs_relocs = FALSE;

#if 1
	if (bfd_big_endian (abfd))
		disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG;
	else if (bfd_little_endian (abfd))
		disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;
	else
 /* ??? Aborting here seems too drastic.  We could default to big or little
       instead.  */
	disasm_info.endian = BFD_ENDIAN_UNKNOWN;
#endif
	/* set the default endianess is BFD_ENDIAN_LITTLE */
	disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;
	disasm_info.symtab = sorted_syms;
	disasm_info.symtab_size = sorted_symcount;
	disasm_info.read_memory_func = disasm_read_memory;
	free (sorted_syms);
}
예제 #21
0
파일: powerpc-32l.c 프로젝트: 5kg/gdb
static void
initialize_tdesc_powerpc_32l (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
  tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
  tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int");

  tdesc_powerpc_32l = result;
}
예제 #22
0
static void
initialize_tdesc_amd64_avx_avx512 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type;
  struct tdesc_type *type;

  set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
  type = tdesc_create_flags (feature, "i386_eflags", 4);
  tdesc_add_flag (type, 0, "CF");
  tdesc_add_flag (type, 1, "");
  tdesc_add_flag (type, 2, "PF");
  tdesc_add_flag (type, 4, "AF");
  tdesc_add_flag (type, 6, "ZF");
  tdesc_add_flag (type, 7, "SF");
  tdesc_add_flag (type, 8, "TF");
  tdesc_add_flag (type, 9, "IF");
  tdesc_add_flag (type, 10, "DF");
  tdesc_add_flag (type, 11, "OF");
  tdesc_add_flag (type, 14, "NT");
  tdesc_add_flag (type, 16, "RF");
  tdesc_add_flag (type, 17, "VM");
  tdesc_add_flag (type, 18, "AC");
  tdesc_add_flag (type, 19, "VIF");
  tdesc_add_flag (type, 20, "VIP");
  tdesc_add_flag (type, 21, "ID");

  tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rdx", 3, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rsi", 4, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rdi", 5, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rbp", 6, 1, NULL, 64, "data_ptr");
  tdesc_create_reg (feature, "rsp", 7, 1, NULL, 64, "data_ptr");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "int64");
  tdesc_create_reg (feature, "rip", 16, 1, NULL, 64, "code_ptr");
  tdesc_create_reg (feature, "eflags", 17, 1, NULL, 32, "i386_eflags");
  tdesc_create_reg (feature, "cs", 18, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ss", 19, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "ds", 20, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "es", 21, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "fs", 22, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "gs", 23, 1, NULL, 32, "int32");
  tdesc_create_reg (feature, "st0", 24, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st1", 25, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st2", 26, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st3", 27, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st4", 28, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st5", 29, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st6", 30, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "st7", 31, 1, NULL, 80, "i387_ext");
  tdesc_create_reg (feature, "fctrl", 32, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fstat", 33, 1, "float", 32, "int");
  tdesc_create_reg (feature, "ftag", 34, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fiseg", 35, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fioff", 36, 1, "float", 32, "int");
  tdesc_create_reg (feature, "foseg", 37, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fooff", 38, 1, "float", 32, "int");
  tdesc_create_reg (feature, "fop", 39, 1, "float", 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
  field_type = tdesc_named_type (feature, "ieee_single");
  tdesc_create_vector (feature, "v4f", field_type, 4);

  field_type = tdesc_named_type (feature, "ieee_double");
  tdesc_create_vector (feature, "v2d", field_type, 2);

  field_type = tdesc_named_type (feature, "int8");
  tdesc_create_vector (feature, "v16i8", field_type, 16);

  field_type = tdesc_named_type (feature, "int16");
  tdesc_create_vector (feature, "v8i16", field_type, 8);

  field_type = tdesc_named_type (feature, "int32");
  tdesc_create_vector (feature, "v4i32", field_type, 4);

  field_type = tdesc_named_type (feature, "int64");
  tdesc_create_vector (feature, "v2i64", field_type, 2);

  type = tdesc_create_union (feature, "vec128");
  field_type = tdesc_named_type (feature, "v4f");
  tdesc_add_field (type, "v4_float", field_type);
  field_type = tdesc_named_type (feature, "v2d");
  tdesc_add_field (type, "v2_double", field_type);
  field_type = tdesc_named_type (feature, "v16i8");
  tdesc_add_field (type, "v16_int8", field_type);
  field_type = tdesc_named_type (feature, "v8i16");
  tdesc_add_field (type, "v8_int16", field_type);
  field_type = tdesc_named_type (feature, "v4i32");
  tdesc_add_field (type, "v4_int32", field_type);
  field_type = tdesc_named_type (feature, "v2i64");
  tdesc_add_field (type, "v2_int64", field_type);
  field_type = tdesc_named_type (feature, "uint128");
  tdesc_add_field (type, "uint128", field_type);

  type = tdesc_create_flags (feature, "i386_mxcsr", 4);
  tdesc_add_flag (type, 0, "IE");
  tdesc_add_flag (type, 1, "DE");
  tdesc_add_flag (type, 2, "ZE");
  tdesc_add_flag (type, 3, "OE");
  tdesc_add_flag (type, 4, "UE");
  tdesc_add_flag (type, 5, "PE");
  tdesc_add_flag (type, 6, "DAZ");
  tdesc_add_flag (type, 7, "IM");
  tdesc_add_flag (type, 8, "DM");
  tdesc_add_flag (type, 9, "ZM");
  tdesc_add_flag (type, 10, "OM");
  tdesc_add_flag (type, 11, "UM");
  tdesc_add_flag (type, 12, "PM");
  tdesc_add_flag (type, 15, "FZ");

  tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm3", 43, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm4", 44, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm5", 45, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm6", 46, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm7", 47, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm8", 48, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm9", 49, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm10", 50, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm11", 51, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm12", 52, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm13", 53, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm14", 54, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm15", 55, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "mxcsr", 56, 1, "vector", 32, "i386_mxcsr");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
  tdesc_create_reg (feature, "ymm0h", 57, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm1h", 58, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm2h", 59, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm3h", 60, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm4h", 61, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm5h", 62, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm6h", 63, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm7h", 64, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm8h", 65, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm9h", 66, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm10h", 67, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm11h", 68, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm12h", 69, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm13h", 70, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm14h", 71, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm15h", 72, 1, NULL, 128, "uint128");

  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512");
  field_type = tdesc_named_type (feature, "ieee_single");
  tdesc_create_vector (feature, "v4f", field_type, 4);

  field_type = tdesc_named_type (feature, "ieee_double");
  tdesc_create_vector (feature, "v2d", field_type, 2);

  field_type = tdesc_named_type (feature, "int8");
  tdesc_create_vector (feature, "v16i8", field_type, 16);

  field_type = tdesc_named_type (feature, "int16");
  tdesc_create_vector (feature, "v8i16", field_type, 8);

  field_type = tdesc_named_type (feature, "int32");
  tdesc_create_vector (feature, "v4i32", field_type, 4);

  field_type = tdesc_named_type (feature, "int64");
  tdesc_create_vector (feature, "v2i64", field_type, 2);

  type = tdesc_create_union (feature, "vec128");
  field_type = tdesc_named_type (feature, "v4f");
  tdesc_add_field (type, "v4_float", field_type);
  field_type = tdesc_named_type (feature, "v2d");
  tdesc_add_field (type, "v2_double", field_type);
  field_type = tdesc_named_type (feature, "v16i8");
  tdesc_add_field (type, "v16_int8", field_type);
  field_type = tdesc_named_type (feature, "v8i16");
  tdesc_add_field (type, "v8_int16", field_type);
  field_type = tdesc_named_type (feature, "v4i32");
  tdesc_add_field (type, "v4_int32", field_type);
  field_type = tdesc_named_type (feature, "v2i64");
  tdesc_add_field (type, "v2_int64", field_type);
  field_type = tdesc_named_type (feature, "uint128");
  tdesc_add_field (type, "uint128", field_type);

  field_type = tdesc_named_type (feature, "uint128");
  tdesc_create_vector (feature, "v2ui128", field_type, 2);

  tdesc_create_reg (feature, "xmm16", 73, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm17", 74, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm18", 75, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm19", 76, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm20", 77, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm21", 78, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm22", 79, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm23", 80, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm24", 81, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm25", 82, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm26", 83, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm27", 84, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm28", 85, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm29", 86, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm30", 87, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "xmm31", 88, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "ymm16h", 89, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm17h", 90, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm18h", 91, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm19h", 92, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm20h", 93, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm21h", 94, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm22h", 95, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm23h", 96, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm24h", 97, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm25h", 98, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm26h", 99, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm27h", 100, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm28h", 101, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm29h", 102, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm30h", 103, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "ymm31h", 104, 1, NULL, 128, "uint128");
  tdesc_create_reg (feature, "k0", 105, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k1", 106, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k2", 107, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k3", 108, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k4", 109, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k5", 110, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k6", 111, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "k7", 112, 1, NULL, 64, "uint64");
  tdesc_create_reg (feature, "zmm0h", 113, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm1h", 114, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm2h", 115, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm3h", 116, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm4h", 117, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm5h", 118, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm6h", 119, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm7h", 120, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm8h", 121, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm9h", 122, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm10h", 123, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm11h", 124, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm12h", 125, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm13h", 126, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm14h", 127, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm15h", 128, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm16h", 129, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm17h", 130, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm18h", 131, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm19h", 132, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm20h", 133, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm21h", 134, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm22h", 135, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm23h", 136, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm24h", 137, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm25h", 138, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm26h", 139, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm27h", 140, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm28h", 141, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm29h", 142, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm30h", 143, 1, NULL, 256, "v2ui128");
  tdesc_create_reg (feature, "zmm31h", 144, 1, NULL, 256, "v2ui128");

  tdesc_amd64_avx_avx512 = result;
}
static void
initialize_tdesc_powerpc_isa205_altivec32l (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type, *type;

  set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
  tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
  tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec");
  field_type = tdesc_named_type (feature, "ieee_single");
  tdesc_create_vector (feature, "v4f", field_type, 4);

  field_type = tdesc_named_type (feature, "int32");
  tdesc_create_vector (feature, "v4i32", field_type, 4);

  field_type = tdesc_named_type (feature, "int16");
  tdesc_create_vector (feature, "v8i16", field_type, 8);

  field_type = tdesc_named_type (feature, "int8");
  tdesc_create_vector (feature, "v16i8", field_type, 16);

  type = tdesc_create_union (feature, "vec128");
  field_type = tdesc_named_type (feature, "uint128");
  tdesc_add_field (type, "uint128", field_type);
  field_type = tdesc_named_type (feature, "v4f");
  tdesc_add_field (type, "v4_float", field_type);
  field_type = tdesc_named_type (feature, "v4i32");
  tdesc_add_field (type, "v4_int32", field_type);
  field_type = tdesc_named_type (feature, "v8i16");
  tdesc_add_field (type, "v8_int16", field_type);
  field_type = tdesc_named_type (feature, "v16i8");
  tdesc_add_field (type, "v16_int8", field_type);

  tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128");
  tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int");

  tdesc_powerpc_isa205_altivec32l = result;
}
예제 #24
0
static void
initialize_tdesc_arm_with_vfpv3 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("arm"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "sp", 13, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "lr", 14, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "pc", 15, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "cpsr", 25, 1, NULL, 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.vfp");
  tdesc_create_reg (feature, "d0", 26, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d1", 27, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d2", 28, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d3", 29, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d4", 30, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d5", 31, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d6", 32, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d7", 33, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d8", 34, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d9", 35, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d10", 36, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d11", 37, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d12", 38, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d13", 39, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d14", 40, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d15", 41, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d16", 42, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d17", 43, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d18", 44, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d19", 45, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d20", 46, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d21", 47, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d22", 48, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d23", 49, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d24", 50, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d25", 51, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d26", 52, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d27", 53, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d28", 54, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d29", 55, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d30", 56, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "d31", 57, 1, NULL, 64, "ieee_double");
  tdesc_create_reg (feature, "fpscr", 58, 1, "float", 32, "int");

  tdesc_arm_with_vfpv3 = result;
}
예제 #25
0
static const struct bfd_target *
vms_object_p (bfd * abfd)
{
  int err = 0;
  int prev_type;
  const struct bfd_target *target_vector = NULL;
  const bfd_arch_info_type *arch = NULL;
  void * tdata_save = abfd->tdata.any;
  bfd_vma saddr_save = bfd_get_start_address (abfd);

#if defined(VMS_DEBUG) && VMS_DEBUG
  vms_debug(1, "vms_object_p (%p)\n", (void *)abfd);
#endif

  if (!vms_initialize (abfd))
    goto error_ret;

  if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET))
    goto err_wrong_format;

  prev_type = -1;

  do
    {
#if defined(VMS_DEBUG) && VMS_DEBUG
      vms_debug(7, "reading at %08lx\n", (unsigned long)bfd_tell(abfd));
#endif
      if (_bfd_vms_next_record (abfd) < 0)
	{
#if defined(VMS_DEBUG) && VMS_DEBUG
	  vms_debug (2, "next_record failed\n");
#endif
	  goto err_wrong_format;
	}

      if ((prev_type == EOBJ_S_C_EGSD)
	   && (PRIV (rec_type) != EOBJ_S_C_EGSD))
	{
	  if (! vms_fixup_sections (abfd))
	    {
#if defined(VMS_DEBUG) && VMS_DEBUG
	      vms_debug (2, "vms_fixup_sections failed\n");
#endif
	      goto err_wrong_format;
	    }
	}

      prev_type = PRIV (rec_type);

      if (target_vector == NULL)
	{
	  if (prev_type <= OBJ_S_C_MAXRECTYP)
	    target_vector = &vms_vax_vec;
	  else
	    target_vector = &vms_alpha_vec;
	}

      switch (prev_type)
	{
	  case OBJ_S_C_HDR:
	  case EOBJ_S_C_EMH:
	    err = _bfd_vms_slurp_hdr (abfd, prev_type);
	    break;
	  case OBJ_S_C_EOM:
	  case OBJ_S_C_EOMW:
	  case EOBJ_S_C_EEOM:
	    err = _bfd_vms_slurp_eom (abfd, prev_type);
	    break;
	  case OBJ_S_C_GSD:
	  case EOBJ_S_C_EGSD:
	    err = _bfd_vms_slurp_gsd (abfd, prev_type);
	    break;
	  case OBJ_S_C_TIR:
	  case EOBJ_S_C_ETIR:
	    err = _bfd_vms_slurp_tir (abfd, prev_type);
	    break;
	  case OBJ_S_C_DBG:
	  case EOBJ_S_C_EDBG:
	    err = _bfd_vms_slurp_dbg (abfd, prev_type);
	    break;
	  case OBJ_S_C_TBT:
	  case EOBJ_S_C_ETBT:
	    err = _bfd_vms_slurp_tbt (abfd, prev_type);
	    break;
	  case OBJ_S_C_LNK:
	    err = _bfd_vms_slurp_lnk (abfd, prev_type);
	    break;
	  default:
	    err = -1;
	}
      if (err != 0)
	{
#if defined(VMS_DEBUG) && VMS_DEBUG
	  vms_debug (2, "slurp type %d failed with %d\n", prev_type, err);
#endif
	  goto err_wrong_format;
	}
    }
  while ((prev_type != EOBJ_S_C_EEOM) && (prev_type != OBJ_S_C_EOM) && (prev_type != OBJ_S_C_EOMW));

  if (target_vector == & vms_vax_vec)
    {
      if (! vms_fixup_sections (abfd))
	{
#if defined(VMS_DEBUG) && VMS_DEBUG
	  vms_debug (2, "vms_fixup_sections failed\n");
#endif
	  goto err_wrong_format;
	}

      /* Set arch_info to vax.  */

      arch = bfd_scan_arch ("vax");
      PRIV (is_vax) = TRUE;
#if defined(VMS_DEBUG) && VMS_DEBUG
      vms_debug (2, "arch is vax\n");
#endif
    }
  else if (target_vector == &vms_alpha_vec)
    {
      /* Set arch_info to alpha: */
      const char *alphastr = "alpha";
      arch = bfd_scan_arch(alphastr);
      PRIV (is_vax) = FALSE;
#if defined(VMS_DEBUG) && VMS_DEBUG
      vms_debug(2, "arch is %s\n", alphastr);
#endif /* VMS_DEBUG */
    }

  if (arch == NULL)
    {
#if defined(VMS_DEBUG) && VMS_DEBUG
      vms_debug (2, "arch not found\n");
#endif
      goto err_wrong_format;
    }
  abfd->arch_info = arch;

  return target_vector;

 err_wrong_format:
  bfd_set_error (bfd_error_wrong_format);
 error_ret:
  if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL)
    bfd_release (abfd, abfd->tdata.any);
  abfd->tdata.any = tdata_save;
  bfd_set_start_address (abfd, saddr_save);
  return NULL;
}
예제 #26
0
파일: s390-linux64v2.c 프로젝트: 5kg/gdb
static void
initialize_tdesc_s390_linux64v2 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.core");
  tdesc_create_reg (feature, "pswm", 0, 1, "psw", 32, "uint32");
  tdesc_create_reg (feature, "pswa", 1, 1, "psw", 32, "uint32");
  tdesc_create_reg (feature, "r0h", 2, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r0l", 3, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r1h", 4, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r1l", 5, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r2h", 6, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r2l", 7, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r3h", 8, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r3l", 9, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r4h", 10, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r4l", 11, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r5h", 12, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r5l", 13, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r6h", 14, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r6l", 15, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r7h", 16, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r7l", 17, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r8h", 18, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r8l", 19, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r9h", 20, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r9l", 21, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r10h", 22, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r10l", 23, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r11h", 24, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r11l", 25, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r12h", 26, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r12l", 27, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r13h", 28, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r13l", 29, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r14h", 30, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r14l", 31, 1, "lower", 32, "uint32");
  tdesc_create_reg (feature, "r15h", 32, 1, "upper", 32, "uint32");
  tdesc_create_reg (feature, "r15l", 33, 1, "lower", 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.acr");
  tdesc_create_reg (feature, "acr0", 34, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr1", 35, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr2", 36, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr3", 37, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr4", 38, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr5", 39, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr6", 40, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr7", 41, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr8", 42, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr9", 43, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr10", 44, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr11", 45, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr12", 46, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr13", 47, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr14", 48, 1, "access", 32, "uint32");
  tdesc_create_reg (feature, "acr15", 49, 1, "access", 32, "uint32");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.fpr");
  tdesc_create_reg (feature, "fpc", 50, 1, "float", 32, "uint32");
  tdesc_create_reg (feature, "f0", 51, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f1", 52, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f2", 53, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f3", 54, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f4", 55, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f5", 56, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f6", 57, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f7", 58, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f8", 59, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f9", 60, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f10", 61, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f11", 62, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f12", 63, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f13", 64, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f14", 65, 1, "float", 64, "ieee_double");
  tdesc_create_reg (feature, "f15", 66, 1, "float", 64, "ieee_double");

  feature = tdesc_create_feature (result, "org.gnu.gdb.s390.linux");
  tdesc_create_reg (feature, "orig_r2", 67, 1, "system", 32, "uint32");
  tdesc_create_reg (feature, "last_break", 68, 0, "system", 32, "code_ptr");
  tdesc_create_reg (feature, "system_call", 69, 1, "system", 32, "uint32");

  tdesc_s390_linux64v2 = result;
}
예제 #27
0
파일: nios2.c 프로젝트: 5kg/gdb
static void
initialize_tdesc_nios2 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;

  set_tdesc_architecture (result, bfd_scan_arch ("nios2"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.nios2.cpu");
  tdesc_create_reg (feature, "zero", 0, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "at", 1, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "et", 24, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "bt", 25, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "sp", 27, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ba", 30, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "pc", 32, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "status", 33, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "estatus", 34, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "bstatus", 35, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ienable", 36, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ipending", 37, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "cpuid", 38, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "ctl6", 39, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "exception", 40, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "pteaddr", 41, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "tlbacc", 42, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "tlbmisc", 43, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "eccinj", 44, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "badaddr", 45, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "config", 46, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "mpubase", 47, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "mpuacc", 48, 1, NULL, 32, "uint32");

  tdesc_nios2 = result;
}
예제 #28
0
파일: arc-v2.c 프로젝트: Winter3un/ctf_task
static void
initialize_tdesc_arc_v2 (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct tdesc_type *field_type;
  struct tdesc_type *type;

  set_tdesc_architecture (result, bfd_scan_arch ("ARCv2"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.arc.core.v2");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "fp", 27, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "sp", 28, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "ilink", 29, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "r30", 30, 1, "", 32, "int");
  tdesc_create_reg (feature, "blink", 31, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "lp_count", 32, 1, NULL, 32, "uint32");
  tdesc_create_reg (feature, "pcl", 33, 1, "", 32, "code_ptr");

  feature = tdesc_create_feature (result, "org.gnu.gdb.arc.aux-minimal");
  type = tdesc_create_flags (feature, "status32_type", 4);
  tdesc_add_flag (type, 0, "H");
  tdesc_add_bitfield (type, "E", 1, 4);
  tdesc_add_flag (type, 5, "AE");
  tdesc_add_flag (type, 6, "DE");
  tdesc_add_flag (type, 7, "U");
  tdesc_add_flag (type, 8, "V");
  tdesc_add_flag (type, 9, "C");
  tdesc_add_flag (type, 10, "N");
  tdesc_add_flag (type, 11, "Z");
  tdesc_add_flag (type, 12, "L");
  tdesc_add_flag (type, 13, "DZ");
  tdesc_add_flag (type, 14, "SC");
  tdesc_add_flag (type, 15, "ES");
  tdesc_add_bitfield (type, "RB", 16, 18);
  tdesc_add_flag (type, 19, "AD");
  tdesc_add_flag (type, 20, "US");
  tdesc_add_flag (type, 31, "IE");

  tdesc_create_reg (feature, "pc", 34, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "status32", 35, 1, NULL, 32, "status32_type");

  tdesc_arc_v2 = result;
}
예제 #29
0
static void
initialize_tdesc_arm_with_iwmmxt (void)
{
  struct target_desc *result = allocate_target_description ();
  struct tdesc_feature *feature;
  struct type *field_type, *type;

  set_tdesc_architecture (result, bfd_scan_arch ("iwmmxt"));

  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "sp", 13, 1, NULL, 32, "data_ptr");
  tdesc_create_reg (feature, "lr", 14, 1, NULL, 32, "int");
  tdesc_create_reg (feature, "pc", 15, 1, NULL, 32, "code_ptr");
  tdesc_create_reg (feature, "cpsr", 25, 1, NULL, 32, "int");

  feature = tdesc_create_feature (result, "org.gnu.gdb.xscale.iwmmxt");
  field_type = tdesc_named_type (feature, "uint8");
  type = init_vector_type (field_type, 8);
  TYPE_NAME (type) = xstrdup ("iwmmxt_v8u8");
  tdesc_record_type (feature, type);

  field_type = tdesc_named_type (feature, "uint16");
  type = init_vector_type (field_type, 4);
  TYPE_NAME (type) = xstrdup ("iwmmxt_v4u16");
  tdesc_record_type (feature, type);

  field_type = tdesc_named_type (feature, "uint32");
  type = init_vector_type (field_type, 2);
  TYPE_NAME (type) = xstrdup ("iwmmxt_v2u32");
  tdesc_record_type (feature, type);

  type = init_composite_type (NULL, TYPE_CODE_UNION);
  TYPE_NAME (type) = xstrdup ("iwmmxt_vec64i");
  field_type = tdesc_named_type (feature, "iwmmxt_v8u8");
  append_composite_type_field (type, xstrdup ("u8"), field_type);
  field_type = tdesc_named_type (feature, "iwmmxt_v4u16");
  append_composite_type_field (type, xstrdup ("u16"), field_type);
  field_type = tdesc_named_type (feature, "iwmmxt_v2u32");
  append_composite_type_field (type, xstrdup ("u32"), field_type);
  field_type = tdesc_named_type (feature, "uint64");
  append_composite_type_field (type, xstrdup ("u64"), field_type);
  TYPE_VECTOR (type) = 1;
  tdesc_record_type (feature, type);

  tdesc_create_reg (feature, "wR0", 26, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR1", 27, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR2", 28, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR3", 29, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR4", 30, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR5", 31, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR6", 32, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR7", 33, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR8", 34, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR9", 35, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR10", 36, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR11", 37, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR12", 38, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR13", 39, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR14", 40, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wR15", 41, 1, NULL, 64, "iwmmxt_vec64i");
  tdesc_create_reg (feature, "wCSSF", 42, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "wCASF", 43, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "wCGR0", 44, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "wCGR1", 45, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "wCGR2", 46, 1, "vector", 32, "int");
  tdesc_create_reg (feature, "wCGR3", 47, 1, "vector", 32, "int");

  tdesc_arm_with_iwmmxt = result;
}
예제 #30
0
void
initialize_current_architecture (void)
{
  const char **arches = gdbarch_printable_names ();
  struct gdbarch_info info;

  /* determine a default architecture and byte order.  */
  gdbarch_info_init (&info);
  
  /* Find a default architecture.  */
  if (default_bfd_arch == NULL)
    {
      /* Choose the architecture by taking the first one
	 alphabetically.  */
      const char *chosen = arches[0];
      const char **arch;
      for (arch = arches; *arch != NULL; arch++)
	{
	  if (strcmp (*arch, chosen) < 0)
	    chosen = *arch;
	}
      if (chosen == NULL)
	internal_error (__FILE__, __LINE__,
			_("initialize_current_architecture: No arch"));
      default_bfd_arch = bfd_scan_arch (chosen);
      if (default_bfd_arch == NULL)
	internal_error (__FILE__, __LINE__,
			_("initialize_current_architecture: Arch not found"));
    }

  info.bfd_arch_info = default_bfd_arch;

  /* Take several guesses at a byte order.  */
  if (default_byte_order == BFD_ENDIAN_UNKNOWN
      && default_bfd_vec != NULL)
    {
      /* Extract BFD's default vector's byte order.  */
      switch (default_bfd_vec->byteorder)
	{
	case BFD_ENDIAN_BIG:
	  default_byte_order = BFD_ENDIAN_BIG;
	  break;
	case BFD_ENDIAN_LITTLE:
	  default_byte_order = BFD_ENDIAN_LITTLE;
	  break;
	default:
	  break;
	}
    }
  if (default_byte_order == BFD_ENDIAN_UNKNOWN)
    {
      /* look for ``*el-*'' in the target name.  */
      const char *chp;
      chp = strchr (target_name, '-');
      if (chp != NULL
	  && chp - 2 >= target_name
	  && startswith (chp - 2, "el"))
	default_byte_order = BFD_ENDIAN_LITTLE;
    }
  if (default_byte_order == BFD_ENDIAN_UNKNOWN)
    {
      /* Wire it to big-endian!!! */
      default_byte_order = BFD_ENDIAN_BIG;
    }

  info.byte_order = default_byte_order;
  info.byte_order_for_code = info.byte_order;

  if (! gdbarch_update_p (info))
    internal_error (__FILE__, __LINE__,
		    _("initialize_current_architecture: Selection of "
		      "initial architecture failed"));

  /* Create the ``set architecture'' command appending ``auto'' to the
     list of architectures.  */
  {
    /* Append ``auto''.  */
    int nr;
    for (nr = 0; arches[nr] != NULL; nr++);
    arches = xrealloc (arches, sizeof (char*) * (nr + 2));
    arches[nr + 0] = "auto";
    arches[nr + 1] = NULL;
    add_setshow_enum_cmd ("architecture", class_support,
			  arches, &set_architecture_string, 
			  _("Set architecture of target."),
			  _("Show architecture of target."), NULL,
			  set_architecture, show_architecture,
			  &setlist, &showlist);
    add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
  }
}