Re: [PATCH v4] Disable get_ptrace_pid for NetBSD

Tom Tromey
2020-03-20T16:02:05Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> Ah, it's because ptrace returns long and not int on GNU/Linux.
Simon> So when we want to read a 64-bits word from memory, it gets
Simon> truncated. gdb_ptrace should return PTRACE_TYPE_RET.

FWIW it's also fine to just return long from our wrapper; at least if
all known ptrace implementations return some integer type.

Simon> In fact, to be consistent, all these gdb_ptrace functions should
Simon> be changed to return PTRACE_TYPE_RET (as a separate patch).

Now that we have C++ we could probably get rid of these autoconf checks
and just use the template instantiation or overloading tricks.

Tom