This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Small patch to enable build of gdb-7.6 for GNU/Hurd


On Fri, 2013-05-24 at 06:13 -0300, Sergio Durigan Junior wrote:
> On Friday, May 24 2013, Svante Signell wrote:
> 
> > I will change to use xstrprintf instead. Updated patch with ChangeLog
> > entry will follow shortly. Is it OK to modify also the other (preceding)
> > function in the same way (for consistency)?
> 
> Thanks.  It is OK IMO, but I'd prefer if you did that in a separate
> patch.

Attached is an updated patch for the build problems on systems where
PATH_MAX is not defined.

Thanks,
Svante

--- a/gdb/nto-tdep.c	2013-05-23 14:28:24.000000000 +0000
+++ b/gdb/nto-tdep.c	2013-05-27 10:54:13.000000000 +0000
@@ -147,7 +147,7 @@ nto_find_and_open_solib (char *solib, un
 void
 nto_init_solib_absolute_prefix (void)
 {
-  char buf[PATH_MAX * 2], arch_path[PATH_MAX];
+  char *buf, *arch_path;
   char *nto_root, *endian;
   const char *arch;
 
@@ -172,10 +172,11 @@ nto_init_solib_absolute_prefix (void)
 	       == BFD_ENDIAN_BIG ? "be" : "le";
     }
 
-  xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian);
-
-  xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path);
+  arch_path = xstrprintf ("%s/%s%s", nto_root, arch, endian);
+  buf = xstrprintf ("set solib-absolute-prefix \"%s\"", arch_path);
+  xfree(arch_path);
   execute_command (buf, 0);
+  xfree(buf);
 }
 
 char **

Attachment: ChangeLog.solve_PATH_MAX_issue
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]