This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Small patch to enable build of gdb-7.6 for GNU/Hurd
- From: Svante Signell <svante dot signell at gmail dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Sergio Durigan Junior <sergiodj at redhat dot com>, Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Mon, 27 May 2013 14:21:18 +0200
- Subject: Re: Small patch to enable build of gdb-7.6 for GNU/Hurd
- References: <1369326967 dot 8127 dot 33 dot camel at s1499 dot it dot kth dot se> <m3mwrlm6al dot fsf at redhat dot com> <20130524042734 dot GG4017 at adacore dot com> <519F2A7A dot 4050002 at redhat dot com> <1369386446 dot 8127 dot 51 dot camel at s1499 dot it dot kth dot se> <m3hahslp0a dot fsf at redhat dot com> <1369654913 dot 8127 dot 84 dot camel at s1499 dot it dot kth dot se> <20130527121028 dot GB5751 at adacore dot com>
On Mon, 2013-05-27 at 16:10 +0400, Joel Brobecker wrote:
> > 2013-05-27 Svante Signell <srs@hurd-2013.my.own.domain>
> >
> > * nto-tdep.c (nto_init_solib_absolute_prefix): Solve build
> > problems for systems not defining PATH_MAX by using xstrprintf and
> > a cleanup.
>
> Is the domain name above really valid?
No, it's a local one. I forgot to change that one.
> > Attached is an updated patch for the build problems on systems where
> > PATH_MAX is not defined.
>
> In this case, I think you need to use what we call a "cleanup",
> because execute_command might trigger an "error" (GDB's poor man's
> exception mechanism), thus prevening the last xfree from releasing
> buf.
I thought of that problem and looking into the code for execute_command
convinced me that that command should always return. Obviously I was
wrong, you are the experts.
> A formatting nit: The GNU Coding Standard, which we follow in GDB,
> requires a space before opening parens.
I just realized that after submitting the mail.
> While looking at this code, I don't think you'll need 2 xstrprintf
> either. Can you try the attached patch?
Yes, of course this code is much neater. I will report build status
soon.