diff options
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/main.c | 3 | ||||
-rw-r--r-- | gdb/main.h | 6 | ||||
-rw-r--r-- | gdb/mingw-hdep.c | 14 | ||||
-rw-r--r-- | gdb/windows-nat.c | 12 | ||||
-rw-r--r-- | gdb/windows-nat.h | 4 |
6 files changed, 30 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c5db5c4..21585e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2013-04-06 Eli Zaretskii <eliz@gnu.org> + + * windows-nat.c (windows_get_absolute_argv0): Move from here... + * mingw-hdep.c (windows_get_absolute_argv0): ...to here. + Include main.h. + + * windows-nat.h (windows_get_absolute_argv0): Move prototype from + here... + * main.h (windows_get_absolute_argv0): ...to here. + 2013-04-05 Doug Evans <dje@google.com> * dwarf2read.c (struct dwarf2_per_objfile): Tweak comment. @@ -45,9 +45,6 @@ #include "maint.h" #include "filenames.h" -#ifdef __MINGW32__ -# include "windows-nat.h" -#endif /* The selected interpreter. This will be used as a set command variable, so it should always be malloc'ed - since @@ -36,4 +36,10 @@ extern int return_child_result_value; extern int batch_silent; extern int batch_flag; +/* From mingw-hdep.c, used by main.c. */ + +/* Return argv[0] in absolute form, if possible, or ARGV0 if not. The + return value is in malloc'ed storage. */ +extern char *windows_get_absolute_argv0 (const char *argv0); + #endif diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c index 2613495..efc9848 100644 --- a/gdb/mingw-hdep.c +++ b/gdb/mingw-hdep.c @@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "defs.h" +#include "main.h" #include "serial.h" #include "event-loop.h" @@ -80,6 +81,19 @@ safe_strerror (int errnum) return buffer; } +/* Return an absolute file name of the running GDB, if possible, or + ARGV0 if not. The return value is in malloc'ed storage. */ + +char * +windows_get_absolute_argv0 (const char *argv0) +{ + char full_name[PATH_MAX]; + + if (GetModuleFileName (NULL, full_name, PATH_MAX)) + return xstrdup (full_name); + return xstrdup (argv0); +} + /* Wrapper for select. On Windows systems, where the select interface only works for sockets, this uses the GDB serial abstraction to handle sockets, consoles, pipes, and serial ports. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 805ab30..c44314b 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -597,18 +597,6 @@ failed: return 0; /* failure */ } -/* Return an absolute file name of the running GDB, if possible, or - ARGV0 if not. The return value is in malloc'ed storage. */ -char * -windows_get_absolute_argv0 (const char *argv0) -{ - char full_name[PATH_MAX]; - - if (GetModuleFileName (NULL, full_name, PATH_MAX)) - return xstrdup (full_name); - return xstrdup (argv0); -} - /* Encapsulate the information required in a call to symbol_file_add_args. */ struct safe_symbol_file_add_args diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h index 0691e9e..55624ee 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -28,9 +28,5 @@ typedef int (segment_register_p_ftype) (int regnum); whether a given register is a segment register or not. */ extern void windows_set_segment_register_p (segment_register_p_ftype *fun); -/* Return argv[0] in absolute form, if possible, or ARGV0 if not. The - return value is in malloc'ed storage. */ -extern char *windows_get_absolute_argv0 (const char *argv0); - #endif |