From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1127 invoked by alias); 19 Sep 2013 07:41:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1112 invoked by uid 89); 19 Sep 2013 07:40:59 -0000 Received: from mail-lb0-f177.google.com (HELO mail-lb0-f177.google.com) (209.85.217.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Sep 2013 07:40:59 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GARBLED_BODY,KHOP_THREADED,NO_RELAYS,WEBMAIL_BODY autolearn=no version=3.3.2 X-HELO: mail-lb0-f177.google.com Received: by mail-lb0-f177.google.com with SMTP id w7so7449672lbi.22 for ; Thu, 19 Sep 2013 00:40:55 -0700 (PDT) X-Received: by 10.112.51.101 with SMTP id j5mr704726lbo.17.1379576455753; Thu, 19 Sep 2013 00:40:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.130.194 with HTTP; Thu, 19 Sep 2013 00:40:40 -0700 (PDT) In-Reply-To: <52399E7F.40304@redhat.com> References: <87txi2i6t6.fsf@kepler.schwinge.homeip.net> <5225C3C6.8090101@redhat.com> <5228DBA7.9050408@redhat.com> <522A2497.7090405@redhat.com> <52399E7F.40304@redhat.com> From: Yue Lu Date: Thu, 19 Sep 2013 07:41:00 -0000 Message-ID: Subject: Re: [PATCH 1/2] Port gdbserver to GNU/Hurd To: Pedro Alves Cc: gdb-patches , Thomas Schwinge , Luis Machado , bug-hurd@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00641.txt.bz2 Hi, On Wed, Sep 18, 2013 at 8:37 PM, Pedro Alves wrote: > On 09/12/2013 04:05 AM, Yue Lu wrote: > >> On Sat, Sep 7, 2013 at 2:53 AM, Pedro Alves 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 =3D 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 =3D gnu_read_inferior (task, memaddr, readbuf, len); } if (res =3D=3D 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) --=20 Yue Lu (=E9=99=86=E5=B2=B3)