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: Andreas Schwab <schwab at linux-m68k dot org>, Tom Tromey <tom at tromey dot com>, Simon Marchi <simark at simark dot ca>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 16 Dec 2018 20:08:30 +0100
- Subject: Re: [PATCH] Please define thread_info as struct thread_info (and other stuff)
- References: <c43ca8d60ab8880408033a21901d544f3ec9de57.camel@gmail.com> <m2y38pddzs.fsf@linux-m68k.org>
- Reply-to: svante dot signell at gmail dot com
On Sun, 2018-12-16 at 10:20 +0100, Andreas Schwab wrote:
> On Dez 15 2018, Svante Signell <svante.signell@gmail.com> wrote:
>
> Try adding a forward declaration of struct thead_info. Note that
> config/i386/nm-i386gnu.h includes "regcache.h", making it unique among
> the nm.h files.
>From what I've leraned forward declarations is bad coding, an should be avoided
as much as possible. Right or wrong?
Furthermore, not defining thread_info as struct everywhere is in my opinion very
lazy coding. Another issue is to compile C-code (and C++-code) in *.c files.
Please rename these to *.cpp (and eventually the header files to *.hpp)! As it
is now it is very confusing.
Finally, I've found the problem (but no workaround yet): thread_info is an RPC
on GNU/Hurs, and including mach.h in gdb/config/i386/nm-i386gnu.h:#include
<mach.h> further includes <mach/mach_interface.h> which has the conflicting name
of that RPC:
kern_return_t thread_info
(
mach_port_t target_thread,
int flavor,
thread_info_t thread_info_out,
mach_msg_type_number_t *thread_info_outCnt
);
Please reconsider your coding stype for gdb.
Thanks!