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 1/2] Port gdbserver to GNU/Hurd


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 (éå)


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