diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2016-11-25 11:02:17 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2016-12-08 08:27:07 +0100 |
commit | 0947023d1d4b5d8803a1065d622f707010b2bcdc (patch) | |
tree | 89739d759c325f3e99ddab9178a2d45f502a1be4 /gdb/i386-gnu-nat.c | |
parent | 785102a7d34f2d48f9a1616bf931fea6de2385fb (diff) | |
download | gdb-0947023d1d4b5d8803a1065d622f707010b2bcdc.zip gdb-0947023d1d4b5d8803a1065d622f707010b2bcdc.tar.gz gdb-0947023d1d4b5d8803a1065d622f707010b2bcdc.tar.bz2 |
Hurd, C++: kern_return_t vs. error_t
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 tells us "error: invalid conversion
from 'kern_return_t {aka int}' to 'error_t {aka __error_t_codes}'". Instead of
casting all these RPC return values to "error_t", just use "kern_return_t"
variables:
gdb/
* gnu-nat.c (proc_get_exception_port, proc_set_exception_port)
(INF_RESUME_MSGPORT_RPC, proc_get_state, _proc_get_exc_port)
(proc_steal_exc_port, proc_restore_exc_port, make_proc)
(inf_startup, inf_set_pid, inf_validate_procinfo)
(inf_validate_task_sc, inf_set_traced, inf_validate_procs)
(inf_signal, inf_continue, gnu_wait, S_exception_raise_request)
(do_mach_notify_dead_name, S_proc_wait_reply)
(S_msg_sig_post_untraced_reply, S_msg_sig_post_reply)
(port_msgs_queued, gnu_read_inferior, gnu_write_inferior)
(gnu_find_memory_regions, steal_exc_port, thread_takeover_sc_cmd)
(flush_inferior_icache): Instead of "error_t" use "kern_return_t".
* i386-gnu-nat.c (fetch_fpregs, store_fpregs, i386_gnu_dr_get)
(i386_gnu_dr_set): Likewise.
Diffstat (limited to 'gdb/i386-gnu-nat.c')
-rw-r--r-- | gdb/i386-gnu-nat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c index c6c53ca..add0aa4 100644 --- a/gdb/i386-gnu-nat.c +++ b/gdb/i386-gnu-nat.c @@ -58,7 +58,7 @@ fetch_fpregs (struct regcache *regcache, struct proc *thread) { mach_msg_type_number_t count = i386_FLOAT_STATE_COUNT; struct i386_float_state state; - error_t err; + kern_return_t err; err = thread_get_state (thread->port, i386_FLOAT_STATE, (thread_state_t) &state, &count); @@ -148,7 +148,7 @@ store_fpregs (const struct regcache *regcache, struct proc *thread, int regno) { mach_msg_type_number_t count = i386_FLOAT_STATE_COUNT; struct i386_float_state state; - error_t err; + kern_return_t err; err = thread_get_state (thread->port, i386_FLOAT_STATE, (thread_state_t) &state, &count); @@ -279,7 +279,7 @@ static void i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread) { mach_msg_type_number_t count = i386_DEBUG_STATE_COUNT; - error_t err; + kern_return_t err; err = thread_get_state (thread->port, i386_DEBUG_STATE, (thread_state_t) regs, &count); @@ -293,7 +293,7 @@ i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread) static void i386_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread) { - error_t err; + kern_return_t err; err = thread_set_state (thread->port, i386_DEBUG_STATE, (thread_state_t) regs, i386_DEBUG_STATE_COUNT); |