Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Implement qXfer:libraries for Linux/gdbserver
Date: Mon, 08 Aug 2011 21:31:00 -0000	[thread overview]
Message-ID: <CALoOobMhYmehcttV9vsqL5=bSMHGLFp4p9CGN57YkX_EzMxoBA@mail.gmail.com> (raw)
In-Reply-To: <20110808210938.GA19337@host1.jankratochvil.net>

On Mon, Aug 8, 2011 at 2:09 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:

> with:
> ./gdbserver :1234 ~/t/pause64
> ../gdb ~/t/pause64 -ex 'target remote localhost:1234' -ex 'b main' -ex c
>
> it falls back back memory-transfers as DT_DEBUG is zero initially at _start.
>
> just to get the patch integrated on some final patches assembly.

Thanks.

A patch incorporating that change is attached. Or not.

I see you've reworked some of the gdbserver code as well. I'll update
the original thread with a unified patch.


> gdb/gdbserver/
> 2011-08-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
>
>        Fix initial zero DT_DEBUG.
>        * linux-low.c (linux_add_process): Remove r_debug initialization.
>        (get_r_debug): Update function comment.  Return -1 when DT_DEBUG is not
>        found.
>        (linux_qxfer_libraries): Call get_r_debug on -1 (not 0).  Return on
>        both -1 or 0.
>
> --- a/gdb/gdbserver/linux-low.c
> +++ b/gdb/gdbserver/linux-low.c
> @@ -264,7 +264,6 @@ linux_add_process (int pid, int attached)
>
>   proc = add_process (pid, attached);
>   proc->private = xcalloc (1, sizeof (*proc->private));
> -  proc->private->r_debug = (CORE_ADDR) -1;
>
>   if (the_low_target.new_process != NULL)
>     proc->private->arch_private = the_low_target.new_process ();
> @@ -4863,7 +4862,8 @@ get_dynamic (const int pid, const int is_elf64)
>   return 0;
>  }
>
> -/* Return &_r_debug in the inferior, or 0 if not present.  */
> +/* Return &_r_debug in the inferior, or -1 if not present.  Return value
> +   can be 0 if the inferior does not yet have the library list initialized.  */
>
>  static CORE_ADDR
>  get_r_debug (const int pid, const int is_elf64)
> @@ -4874,7 +4874,7 @@ get_r_debug (const int pid, const int is_elf64)
>
>   dynamic_memaddr = get_dynamic (pid, is_elf64);
>   if (dynamic_memaddr == 0)
> -    return 0;
> +    return (CORE_ADDR) -1;

I've updated the other return from get_r_debug() (if no DT_DEBUG
found) to also return -1.

Thanks,
-- 
Paul Pluzhnikov


  reply	other threads:[~2011-08-08 21:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 18:11 [patch] Implement qXfer:libraries for Linux/gdbserver [Was: Re: [RFC] Make target_read_string faster over high-latency links.] Paul Pluzhnikov
2011-08-08 18:36 ` Jan Kratochvil
2011-08-08 18:56   ` Paul Pluzhnikov
2011-08-08 21:24     ` [patch] Implement qXfer:libraries for Linux/gdbserver Jan Kratochvil
2011-08-09 18:25       ` Daniel Jacobowitz
2011-08-08 21:10 ` Jan Kratochvil
2011-08-08 21:31   ` Paul Pluzhnikov [this message]
2011-08-08 21:38     ` Jan Kratochvil
2011-08-08 23:50       ` Paul Pluzhnikov
2011-08-09  9:07         ` Jan Kratochvil
2011-08-09 16:57           ` Paul Pluzhnikov
2011-08-14 16:36             ` Jan Kratochvil
2011-10-03 21:57               ` IMO-obsolste: " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALoOobMhYmehcttV9vsqL5=bSMHGLFp4p9CGN57YkX_EzMxoBA@mail.gmail.com' \
    --to=ppluzhnikov@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox