https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html
gdb/ChangeLog
* main.h (get_gdb_program_name): Add declaration.
* main.c (get_gdb_program_name): Add definition.
+2013-09-18 Andrew Burgess <aburgess@broadcom.com>
+
+ * main.h (get_gdb_program_name): Add declaration.
+ * main.c (get_gdb_program_name): Add definition.
+
2013-09-17 Doug Evans <dje@google.com>
* dwarf2read.c: Move definitions of complaint functions to after
/* GDB as it has been invoked from the command line (i.e. argv[0]). */
static char *gdb_program_name;
+/* Return read only pointer to GDB_PROGRAM_NAME. */
+const char *
+get_gdb_program_name (void)
+{
+ return gdb_program_name;
+}
+
static void print_gdb_help (struct ui_file *);
/* Relocate a file or directory. PROGNAME is the name by which gdb
return value is in malloc'ed storage. */
extern char *windows_get_absolute_argv0 (const char *argv0);
+/* Return read only pointer to the name of gdb as it was invoked. This
+ might have been expanded to an absolute path if required by the
+ platform. Could return NULL if called before gdb has had a chance to
+ parse the argv array. */
+extern const char * get_gdb_program_name (void);
+
#endif