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

Tom Tromey
2013-05-23T17:08:04Z

>>>>> "Svante" == Svante Signell <svante.signell@gmail.com> writes:

Svante> In case you need feedback from me use Cc: since I'm not subscribed to
Svante> gdb-patches.

It needs a ChangeLog entry.

Svante> - xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian);
Svante> + arch_len = strlen (nto_root) + 1 + strlen (arch) + strlen (endian) + 1;
Svante> + arch_path = alloca (arch_len);
Svante> + xsnprintf (arch_path, arch_len, "%s/%s%s", nto_root, arch, endian);

Svante> - xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path);
Svante> + len = strlen (FMT) - 2 + strlen (arch_path) + 1;
Svante> + buf = alloca (len);
Svante> + xsnprintf (buf, len, FMT, arch_path);
Svante> execute_command (buf, 0);

I think it would be simpler to use a single xstrprintf plus a cleanup.

Tom