Unbreak Windows-hosted cross debugger builds.

* 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.
This commit is contained in:
Eli Zaretskii 2013-04-06 06:52:06 +00:00
parent 198f1157c9
commit d9ac066415
6 changed files with 30 additions and 19 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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