[PATCH 4/5] Hurd, C++: kern_return_t vs. error_t

2016-12-07 Thread Thomas Schwinge
GNU/Hurd uses its own "typedef enum __error_t_codes error_t;" ([glibc]/sysdeps/mach/hurd/bits/errno.h), contrary to the default "typedef int error_t;" ([glibc]/stdlib/errno.h). The Mach/Hurd RPCs return kern_return_t values, for which, upon assigning them to an error_t variable, GCC in C++ mode te

[PATCH 3/5] Hurd, C++: Avoid "const char *" to "char *" casts

2016-12-07 Thread Thomas Schwinge
... by a bit of code refactoring: gdb/ * gnu-nat.c (set_task_pause_cmd, set_signals_cmd) (set_exceptions_cmd): Add variants taking an "int arg" instead of a "char *". Make the "char *" variants use the former. (set_noninvasive_cmd): Also use the "int arg" v

[PATCH 5/5] Hurd, C++: Mach/Hurd headers and MIG stubs are not yet fit for C++

2016-12-07 Thread Thomas Schwinge
..., so handle these in "C" mode still: gdb/ * config/i386/i386gnu.mh (%_S.o %_U.o): Add "-x c" to "COMPILE.post". * gnu-nat.c: #include Mach/Hurd headers before all others. Wrap Mach/Hurd headers and MIG stubs' prototypes in 'extern "C"'. * i386-gn

[PATCH 1/5] Hurd, C++: Explicitly cast "void *"

2016-12-07 Thread Thomas Schwinge
C++ doesn't do implicit type conversions from "void *", so we have to... gdb/ * i386-gnu-nat.c (i386_gnu_dr_set_control_one) (i386_gnu_dr_set_addr_one): Explicitly cast "void *". --- gdb/ChangeLog | 5 + gdb/i386-gnu-nat.c | 4 ++-- 2 files changed, 7 insertions(+

[PATCH 2/5] Hurd, C++: Avoid GNU C nested functions

2016-12-07 Thread Thomas Schwinge
..., which C++ doesn't allow, so... gdb/ * gnu-nat.c (gnu_create_inferior): Move nested "trace_me" function... (gnu_ptrace_me): ... here. --- gdb/ChangeLog | 4 gdb/gnu-nat.c | 20 +++- 2 files changed, 15 insertions(+), 9 deletions(-) diff -

Fix C++ compilation of the Hurd port

2016-12-07 Thread Thomas Schwinge
Hi! I hear, GDB is now a C++ code base? ;-) (Actually, to the best of my knowledge, that makes GDB the first C++ project to use low-level Mach/Hurd interfaces.) No doubt this will need to be polished some more, but to at least restore the build, I committed the following five patches to fix C++

Re: Hurd port for gcc go PATCH 1-4(23)

2016-12-07 Thread Ian Lance Taylor
On Wed, Dec 7, 2016 at 2:02 PM, Svante Signell wrote: > > I'm sorry but neither of you or I are in the position to request changes of > already existing file names e.g. replacing linux with glibc in: > os/pipe_linux.go > crypto/x509/root_linux.go > syscall/errstr_linux.go As you know, the name "l

Re: Hurd port for gcc go PATCH 1-4(23)

2016-12-07 Thread Svante Signell
On Wed, 2016-12-07 at 17:25 +0100, Samuel Thibault wrote: > Svante Signell, on Wed 07 Dec 2016 15:32:31 +0100, wrote: > > On Wed, 2016-12-07 at 15:08 +0100, Samuel Thibault wrote: > > > Ok, but then I'd say move the function which change to a separate file, > > > so that the other functions are kep

Re: [PATCH v3 4/7] Per-inferior/Inferior-qualified thread IDs

2016-12-07 Thread Simon Marchi
On 16-12-07 04:09 PM, Thomas Schwinge wrote: > commit 14f6890677849172a4b13779acd9089c9baa3a81 > Author: Thomas Schwinge > Date: Tue May 24 19:36:57 2016 +0200 > > Hurd: Adjust to "Per-inferior/Inferior-qualified thread IDs" changes > > [...]/gdb/gnu-nat.c: In function 'set_sig

Re: [PATCH v3 4/7] Per-inferior/Inferior-qualified thread IDs

2016-12-07 Thread Thomas Schwinge
Hi! Better late than never... ;-) On Thu, 07 Jan 2016 23:37:38 +, Pedro Alves wrote: > --- a/gdb/gdbthread.h > +++ b/gdb/gdbthread.h > -/* Translate the integer thread id (GDB's homegrown id, not the system's) > - into a "pid" (which may be overloaded with extra thread information). */

Re: Hurd port for gcc go PATCH 1-4(23)

2016-12-07 Thread Samuel Thibault
Svante Signell, on Wed 07 Dec 2016 15:32:31 +0100, wrote: > On Wed, 2016-12-07 at 15:08 +0100, Samuel Thibault wrote: > > Ok, but then I'd say move the function which change to a separate file, > > so that the other functions are kept shared. > > Otherwise it'll be tedious to maintain. > > One pro

Re: Hurd port for gcc go PATCH 1-4(23)

2016-12-07 Thread Svante Signell
On Wed, 2016-12-07 at 15:08 +0100, Samuel Thibault wrote: > Svante Signell, on Wed 07 Dec 2016 14:52:35 +0100, wrote: > > Since go does not have a preprocessor allowing conditional code paths this > > is > > how it should be done (and as I did): > > http://blog.ralch.com/tutorial/golang-conditional

Re: Hurd port for gcc go PATCH 1-4(23)

2016-12-07 Thread Samuel Thibault
Svante Signell, on Wed 07 Dec 2016 14:52:35 +0100, wrote: > Since go does not have a preprocessor allowing conditional code paths this is > how it should be done (and as I did): > http://blog.ralch.com/tutorial/golang-conditional-compilation/ Ok, but then I'd say move the function which change to

Re: Hurd port for gcc go PATCH 1-4(23)

2016-12-07 Thread Svante Signell
On Sun, 2016-11-27 at 18:02 +0100, Samuel Thibault wrote: > Hello, > > Svante Signell, on Sun 27 Nov 2016 17:33:52 +0100, wrote: > > > >  > > > And > > > src_libgo_go_syscall_syscall_gnu_test.go: New file: > > >   Define Type and Whence as 32bit in syscall.Flock_t > > > > > > Again, you'll probab