sim_open (args);
len = (7 + 1			 + strlen (" -E little") + strlen (" --architecture=xxxxxxxxxx") + (args ? strlen (args) : 0) + 50)  ; arg_buf = (char *) alloca (len); strcpy (arg_buf, "gdbsim");	  switch (selected_byte_order ()) { case BFD_ENDIAN_BIG: strcat (arg_buf, " -E big"); break; case BFD_ENDIAN_LITTLE: strcat (arg_buf, " -E little"); break; case BFD_ENDIAN_UNKNOWN: break; }  if (selected_architecture_name () != NULL) { strcat (arg_buf, " --architecture="); strcat (arg_buf, selected_architecture_name ()); }  if (args) { strcat (arg_buf, " ");	 strcat (arg_buf, args); } argv = buildargv (arg_buf); if (argv == NULL) error ("Insufficient memory available to allocate simulator arg list."); make_cleanup_freeargv (argv);  init_callbacks (); gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, exec_bfd, argv);  if (gdbsim_desc == 0) error ("unable to create simulator instance");
gdbsim_open (args, from_tty)     char *args;     int from_tty;{  if (sr_get_debug ())    printf_filtered ("gdbsim_open: args \"%s\"\n", args ? args : "(null)");  sim_set_callbacks (&default_callback);  default_callback.init (&default_callback);  sim_open (args);  push_target (&gdbsim_ops);  target_fetch_registers (-1);  printf_filtered ("Connected to the simulator.\n");}