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 2/6] Introduce throw_ptrace_error


On 03/06/2015 09:03 PM, Mark Kettenis wrote:
>> From: Pedro Alves <palves@redhat.com>
>> Date: Fri,  6 Mar 2015 19:58:02 +0000
>>
>> This adds a new function that is meant to be called instead of
>> perror_with_name whenever we get an error out of ptrace.  The
>> idea is to convert some errno errors to different GDB exceptions in
>> a following patch.
> 
> What is ptrace-specific about throwing an error?  This really feels
> like the wrong direction to me.

Not exactly sure what you mean.  Throwing an error is
of course not ptrace-specific.  What is ptrace-specific is the
interpretation of errno.  The end result of the series is that
an ESRCH as a result of a ptrace error ends up throwing
a THREAD_NOT_FOUND_ERROR error instead of a GENERIC_ERROR.  Then
callers up the chain can actually distinguish the errors.

Please take a look at patch 3.  It should make things clearer.

Thanks,
Pedro Alves


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