From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28758 invoked by alias); 23 Mar 2013 10:51:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28745 invoked by uid 89); 23 Mar 2013 10:51:18 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL,TW_TD autolearn=no version=3.3.1 Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 23 Mar 2013 10:51:14 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MK300400ZXJ9H00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Sat, 23 Mar 2013 12:50:43 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MK40035L0SIWOC0@a-mtaout20.012.net.il>; Sat, 23 Mar 2013 12:50:43 +0200 (IST) Date: Sat, 23 Mar 2013 22:59:00 -0000 From: Eli Zaretskii Subject: Re: one week to gdb-7.6 release? In-reply-to: <83vc8myoyb.fsf@gnu.org> To: brobecker@adacore.com Cc: gdb-patches@sourceware.org, palves@redhat.com, jan.kratochvil@redhat.com, ralf.corsepius@rtems.org, vapier@gentoo.org, joel.sherrill@oarcorp.com Reply-to: Eli Zaretskii Message-id: <83ehf64cfs.fsf@gnu.org> References: <20130320160032.GC5447@adacore.com> <83vc8myoyb.fsf@gnu.org> X-SW-Source: 2013-03/txt/msg00873.txt.bz2 > Date: Wed, 20 Mar 2013 19:13:16 +0200 > From: Eli Zaretskii > Cc: gdb-patches@sourceware.org, palves@redhat.com, jan.kratochvil@redhat.com, ralf.corsepius@rtems.org, vapier@gentoo.org, joel.sherrill@oarcorp.com > > > Date: Wed, 20 Mar 2013 09:00:32 -0700 > > From: Joel Brobecker > > Cc: Pedro Alves , Jan Kratochvil , Ralf Corsepius , Mike Frysinger , Joel Sherrill > > > > We're about one week away from our tentative date for gdb-7.6 release, > > and I was wondering how we are doing, and whether there might be > > some issues that might prevent us from releasing around our planned > > date. > > > > I know of: > > > > * PR/15289 set remote hardware-watchpoint-limit" broken (zinteger commands) > > (regression) > > Easy to fix, or just revert the patch that caused the regression? > > > > * dv-sockser.o build issues in the sim. > > Looks like the thread lost steam a bit - can we stoke the fire again? > > I'd like my patch that deals with relocation to be committed to the > branch. I don't see it in the list archives, so cannot show a URL, > but Jan send a few comments that I want to incorporate and submit > tomorrow. Committed to the trunk as below. This incorporates comments from Jan. OK to commit the same to the 7.6 branch? 2013-03-18 Eli Zaretskii * windows-nat.c (windows_get_absolute_argv0): New function. * windows-nat.h: Add its prototype. * main.c (get_init_files): Use filename_ncmp instead of strncmp. Use IS_DIR_SEPARATOR instead of looking for a character inside SLASH_STRING. Include filenames.h. (captured_main) [__MINGW32__]: Make argv[0] absolute, so that relocate_gdb_directory works when passed gdb_program_name. Include windows-nat.h. --- gdb/main.c~0 2013-01-25 02:46:19.000000000 +0200 +++ gdb/main.c 2013-03-21 19:11:12.039633400 +0200 @@ -43,6 +43,11 @@ #include "objfiles.h" #include "auto-load.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 do_setshow_command will free it. */ @@ -180,15 +185,15 @@ get_init_files (char **system_gdbinit, has been provided, search for SYSTEM_GDBINIT there. */ if (gdb_datadir_provided && datadir_len < sys_gdbinit_len - && strncmp (SYSTEM_GDBINIT, GDB_DATADIR, datadir_len) == 0 - && strchr (SLASH_STRING, SYSTEM_GDBINIT[datadir_len]) != NULL) + && filename_ncmp (SYSTEM_GDBINIT, GDB_DATADIR, datadir_len) == 0 + && IS_DIR_SEPARATOR (SYSTEM_GDBINIT[datadir_len])) { /* Append the part of SYSTEM_GDBINIT that follows GDB_DATADIR to gdb_datadir. */ char *tmp_sys_gdbinit = xstrdup (SYSTEM_GDBINIT + datadir_len); char *p; - for (p = tmp_sys_gdbinit; strchr (SLASH_STRING, *p); ++p) + for (p = tmp_sys_gdbinit; IS_DIR_SEPARATOR (*p); ++p) continue; relocated_sysgdbinit = concat (gdb_datadir, SLASH_STRING, p, NULL); @@ -377,7 +382,13 @@ captured_main (void *data) gdb_stdtargerr = gdb_stderr; /* for moment */ gdb_stdtargin = gdb_stdin; /* for moment */ +#ifdef __MINGW32__ + /* On Windows, argv[0] is not necessarily set to absolute form when + GDB is found along PATH, without which relocation doesn't work. */ + gdb_program_name = windows_get_absolute_argv0 (argv[0]); +#else gdb_program_name = xstrdup (argv[0]); +#endif if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) /* Don't use *_filtered or warning() (which relies on @@ -411,7 +422,7 @@ captured_main (void *data) #ifdef RELOC_SRCDIR add_substitute_path_rule (RELOC_SRCDIR, - make_relative_prefix (argv[0], BINDIR, + make_relative_prefix (gdb_program_name, BINDIR, RELOC_SRCDIR)); #endif @@ -729,7 +740,7 @@ captured_main (void *data) /* Initialize all files. Give the interpreter a chance to take control of the console via the deprecated_init_ui_hook (). */ - gdb_init (argv[0]); + gdb_init (gdb_program_name); /* Now that gdb_init has created the initial inferior, we're in position to set args for that inferior. */ --- gdb/windows-nat.c~0 2013-02-27 21:42:26.000000000 +0200 +++ gdb/windows-nat.c 2013-03-21 19:05:21.642985800 +0200 @@ -597,6 +597,18 @@ 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 --- gdb/windows-nat.h~0 2013-02-12 21:03:54.000000000 +0200 +++ gdb/windows-nat.h 2013-03-21 19:05:19.068969300 +0200 @@ -28,5 +28,9 @@ 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