This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Port gdbserver to GNU/Hurd
- From: Yue Lu <hacklu dot newborn at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Thomas Schwinge <thomas at codesourcery dot com>, Luis Machado <lgustavo at codesourcery dot com>, bug-hurd at gnu dot org
- Date: Thu, 19 Sep 2013 15:40:40 +0800
- Subject: Re: [PATCH 1/2] Port gdbserver to GNU/Hurd
- Authentication-results: sourceware.org; auth=none
- References: <CAB8fV=jJ64i91VW52ZmdnEDZhd1ZGTAykDqoFyPJanCP=5beqA at mail dot gmail dot com> <CAB8fV=iw783uGF8sWyqJNcWR0j_jaY5XO+FR3TyPatMGJ8Fdjw at mail dot gmail dot com> <87txi2i6t6 dot fsf at kepler dot schwinge dot homeip dot net> <5225C3C6 dot 8090101 at redhat dot com> <CAB8fV=gXmHSqLF14aF3RUU6paExSHft-gqySCsvyxiYELY4V+A at mail dot gmail dot com> <5228DBA7 dot 9050408 at redhat dot com> <522A2497 dot 7090405 at redhat dot com> <CAB8fV=hcYutwy7KzeJyELziBaKZio0G9ZFX=FucRWav-T2_cnA at mail dot gmail dot com> <52399E7F dot 40304 at redhat dot com>
Hi,
On Wed, Sep 18, 2013 at 8:37 PM, Pedro Alves <palves@redhat.com> wrote:
> On 09/12/2013 04:05 AM, Yue Lu wrote:
>
>> On Sat, Sep 7, 2013 at 2:53 AM, Pedro Alves <palves@redhat.com> wrote:
>>> This is what I meant:
>>> https://sourceware.org/ml/gdb-patches/2013-09/msg00253.html
>>>
>>> I was thinking you'd wrap gnu_xfer_memory.
>>>
>>
>> I have study your patch,
>
> Thanks. Did you try building gdb with it, and does the
> resulting GDB still work?
First thank you to tell me how to apply patch from email. I used
webmail of gmail and directly copy patch from the email which often
apply failed, then I had to patch line by line. Now I used mutt to
save email to mbox file then apply it, life changed! Before you told
me this, I never imaged this, so thanks!
I have test your patch, seems need a tiny fix. This is just a spelling
mistaken I think.
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 07fe603..bc37bb8 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2493,14 +2493,14 @@ gnu_xfer_memory (gdb_byte *readbuf, const char
*writebuf,
{
inf_debug (gnu_current_inf, "writing %s[%s] <-- %s",
paddress (target_gdbarch (), memaddr), plongest (len),
- host_address_to_string (myaddr));
+ host_address_to_string (writebuf));
res = gnu_write_inferior (task, memaddr, writebuf, len);
}
else
{
inf_debug (gnu_current_inf, "reading %s[%s] --> %s",
paddress (target_gdbarch (), memaddr), plongest (len),
- host_address_to_string (myaddr));
+ host_address_to_string (readbuf));
res = gnu_read_inferior (task, memaddr, readbuf, len);
}
if (res == 0)
After add this change, the gdb can work. But I have found a little
strange from the origin gdb.
When I set a breakpoint, then I run the inferior, after hit the
breakpoint, I just input next next until the inferior exit, then the
gdb will complain this:
[Inferior 1 (bogus thread id 0) exited normally]
Thread-specific breakpoint -37 deleted - thread 4 is gone.
Thread-specific breakpoint -38 deleted - thread 4 is gone.
Thread-specific breakpoint -39 deleted - thread 4 is gone.
Thread-specific breakpoint 0 deleted - thread 4 is gone.
I am not sure why this will output or is reasonable.
I got this output like this:
$./gdb gdb
$b main
$r
$n
$n
...
$q (quit the debugged gdb)
--
Yue Lu (éå)