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: [PATCH] Please define thread_info as struct thread_info (and other stuff)


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!


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