/* Simulator option handling.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB, the GNU debugger.
#endif
OPTION_LOAD_LMA,
OPTION_LOAD_VMA,
+ OPTION_SYSROOT
} STANDARD_OPTIONS;
static const OPTION standard_options[] =
'\0', NULL, "", standard_option_handler, "" },
#endif
+ { {"sysroot", required_argument, NULL, OPTION_SYSROOT},
+ '\0', "SYSROOT",
+ "Root for system calls with absolute file-names and cwd at start",
+ standard_option_handler },
+
{ {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
};
exit (0);
/* FIXME: 'twould be nice to do something similar if gdb. */
break;
+
+ case OPTION_SYSROOT:
+ /* Don't leak memory in the odd event that there's lots of
+ --sysroot=... options. */
+ if (simulator_sysroot[0] != '\0' && arg[0] != '\0')
+ free (simulator_sysroot);
+ simulator_sysroot = xstrdup (arg);
+ break;
}
return SIM_RC_OK;