[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] Port gdbserver to GNU/Hurd
From: |
Pedro Alves |
Subject: |
Re: [PATCH 1/2] Port gdbserver to GNU/Hurd |
Date: |
Fri, 06 Sep 2013 19:53:11 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
Hi!
On 09/05/2013 08:29 PM, Pedro Alves wrote:
>> > +static int
>> > +gnu_read_memory (CORE_ADDR addr, unsigned char *myaddr, int length)
>> > +{
>> > + int ret = 0;
>> > + task_t task = (gnu_current_inf
>> > + ? (gnu_current_inf->task
>> > + ? gnu_current_inf->task->port : 0) : 0);
>> > + if (task == MACH_PORT_NULL)
>> > + return 0;
>> > + ret = gnu_read_inferior (task, addr, myaddr, length);
>> > + if (length != ret)
>> > + {
>> > + gnu_debug ("gnu_read_inferior,length=%d, but return %d\n", length,
>> > ret);
>> > + return -1;
>> > + }
>> > + return 0;
>> > +}
>> > +
>> > +static int
>> > +gnu_write_memory (CORE_ADDR addr, const unsigned char *myaddr, int length)
>> > +{
>> > + int ret = 0;
>> > + task_t task = (gnu_current_inf
>> > + ? (gnu_current_inf->task
>> > + ? gnu_current_inf->task->port : 0) : 0);
>> > + if (task == MACH_PORT_NULL)
>> > + return 0;
>> > + ret = gnu_write_inferior (task, addr, myaddr, length);
>> > + if (length != ret)
>> > + {
>> > + gnu_debug ("gnu_write_inferior,length=%d, but return %d\n", length,
>> > + ret);
>> > + return -1;
>> > + }
>> > + return 0;
>> > +}
>> > +
> These should reall be wrappers around a common shared function. I have
> a patch that I think helps here. I'll post it in soon.
>
This is what I meant:
https://sourceware.org/ml/gdb-patches/2013-09/msg00253.html
I was thinking you'd wrap gnu_xfer_memory.
But I have to say I don't really understand the real need for
all those:
task_t task = (gnu_current_inf
? (gnu_current_inf->task
? gnu_current_inf->task->port : 0)
: 0);
int res;
if (task == MACH_PORT_NULL)
return 0;
checks in the existing code. I mean, why would we reach here with
an invalid inferior/task/port selected?
It just reads as workaround for some bug to me.
Thanks,
--
Pedro Alves
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, (continued)
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Pedro Alves, 2013/09/05
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Joel Brobecker, 2013/09/05
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Thomas Schwinge, 2013/09/05
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Yue Lu, 2013/09/08
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Thomas Schwinge, 2013/09/09
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Pedro Alves, 2013/09/18
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Yue Lu, 2013/09/18
- [Hurd/gnu-nat.c] Use ptid_t.lwpid to store, thread ids instead of ptid_t.tid. (was: Re: [PATCH 1/2] Port gdbserver to GNU/Hurd), Pedro Alves, 2013/09/18
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Pedro Alves, 2013/09/18
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Yue Lu, 2013/09/22
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd,
Pedro Alves <=
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Yue Lu, 2013/09/11
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Pedro Alves, 2013/09/18
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Pedro Alves, 2013/09/18
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Yue Lu, 2013/09/19
- FAIL: gdb.base/nextoverexit.exp: next over exit (the program exited) (was: [PATCH 1/2] Port gdbserver to GNU/Hurd), Thomas Schwinge, 2013/09/19
- Re: FAIL: gdb.base/nextoverexit.exp: next over exit (the program exited), Pedro Alves, 2013/09/19
- Re: [PATCH 1/2] Port gdbserver to GNU/Hurd, Yue Lu, 2013/09/09