This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Please define thread_info as struct thread_info (and other stuff)
- From: Svante Signell <svante dot signell at gmail dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 16 Dec 2018 00:01:47 +0100
- Subject: Re: [PATCH] Please define thread_info as struct thread_info (and other stuff)
- References: <c43ca8d60ab8880408033a21901d544f3ec9de57.camel@gmail.com> <87tvje5rvh.fsf@tromey.com>
- Reply-to: svante dot signell at gmail dot com
On Sat, 2018-12-15 at 15:48 -0700, Tom Tromey wrote:
> > > > > > "Svante" == Svante Signell <svante.signell@gmail.com> writes:
>
> Svante> When building gdb version 8.2 on GNU/Hurd several problems arise that
> need to be
> Svante> solved. One problem is that most files in gdb/ have sloppy definitions
> of struct
> Svante> thread_info, causing a build stop fore every occurrence. They are
> excluding the
> Svante> struct part, making the build (and port) on Hurd very cumbersome. Can
> you please
> Svante> fix all bad references to thread_info upstream? I don't really
> understand how
> Svante> gcc can let these errors pass on GNU/Linux.
>
> In C++ there's an implicit typedef for a struct tag, so "struct
> thread_info" can also just be referred to as "thread_info". So, I tend
> to think the code is fine and something else is going wrong.
>
> You didn't post the text of the error or the version of the compiler
> that you are using, so it's hard to say more about what the problem is.
> Could you send that info?
A typical error output:
CXX target.o
/home/srs/DEBs/gdb/gdb-8.2/gdb/target.c: In function ‘int
dispose_inferior(inferior*, void*)’:
/home/srs/DEBs/gdb/gdb-8.2/gdb/target.c:2028:16: error: ‘thread’ was not
declared
in this scope
thread_info *thread = any_thread_of_inferior (inf);
^~~~~~
/home/srs/DEBs/gdb/gdb-8.2/gdb/target.c:2028:16: note: suggested alternative:
‘myread’
thread_info *thread = any_thread_of_inferior (inf);
^~~~~~
myread
Sorry, but the compiler directive is hidden from the output (by libtool??).
ii gcc 4:8.2.0-2 hurd-i386 GNU C compiler
ii g++ 4:8.2.0-2 hurd-i386 GNU C++ compiler
I would be very happy if you could be consistent in the coding: Either use
struct thread_info everywhere or not.
Thanks!