From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17834 invoked by alias); 8 Aug 2011 21:31:46 -0000 Received: (qmail 17824 invoked by uid 22791); 8 Aug 2011 21:31:45 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 21:31:31 +0000 Received: from kpbe11.cbf.corp.google.com (kpbe11.cbf.corp.google.com [172.25.105.75]) by smtp-out.google.com with ESMTP id p78LVTxR031548 for ; Mon, 8 Aug 2011 14:31:30 -0700 Received: from gyb11 (gyb11.prod.google.com [10.243.49.75]) by kpbe11.cbf.corp.google.com with ESMTP id p78LUwEG025834 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Mon, 8 Aug 2011 14:31:28 -0700 Received: by gyb11 with SMTP id 11so1601453gyb.24 for ; Mon, 08 Aug 2011 14:31:28 -0700 (PDT) Received: by 10.150.32.16 with SMTP id f16mr1535361ybf.430.1312839088272; Mon, 08 Aug 2011 14:31:28 -0700 (PDT) Received: by 10.150.32.16 with SMTP id f16mr1535354ybf.430.1312839088118; Mon, 08 Aug 2011 14:31:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.48.15 with HTTP; Mon, 8 Aug 2011 14:30:58 -0700 (PDT) In-Reply-To: <20110808210938.GA19337@host1.jankratochvil.net> References: <20110808210938.GA19337@host1.jankratochvil.net> From: Paul Pluzhnikov Date: Mon, 08 Aug 2011 21:31:00 -0000 Message-ID: Subject: Re: [patch] Implement qXfer:libraries for Linux/gdbserver To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-08/txt/msg00158.txt.bz2 On Mon, Aug 8, 2011 at 2:09 PM, Jan Kratochvil 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 _sta= rt. > > 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 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0Fix initial zero DT_DEBUG. > =A0 =A0 =A0 =A0* linux-low.c (linux_add_process): Remove r_debug initiali= zation. > =A0 =A0 =A0 =A0(get_r_debug): Update function comment. =A0Return -1 when = DT_DEBUG is not > =A0 =A0 =A0 =A0found. > =A0 =A0 =A0 =A0(linux_qxfer_libraries): Call get_r_debug on -1 (not 0). = =A0Return on > =A0 =A0 =A0 =A0both -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) > > =A0 proc =3D add_process (pid, attached); > =A0 proc->private =3D xcalloc (1, sizeof (*proc->private)); > - =A0proc->private->r_debug =3D (CORE_ADDR) -1; > > =A0 if (the_low_target.new_process !=3D NULL) > =A0 =A0 proc->private->arch_private =3D the_low_target.new_process (); > @@ -4863,7 +4862,8 @@ get_dynamic (const int pid, const int is_elf64) > =A0 return 0; > =A0} > > -/* Return &_r_debug in the inferior, or 0 if not present. =A0*/ > +/* Return &_r_debug in the inferior, or -1 if not present. =A0Return val= ue > + =A0 can be 0 if the inferior does not yet have the library list initial= ized. =A0*/ > > =A0static CORE_ADDR > =A0get_r_debug (const int pid, const int is_elf64) > @@ -4874,7 +4874,7 @@ get_r_debug (const int pid, const int is_elf64) > > =A0 dynamic_memaddr =3D get_dynamic (pid, is_elf64); > =A0 if (dynamic_memaddr =3D=3D 0) > - =A0 =A0return 0; > + =A0 =A0return (CORE_ADDR) -1; I've updated the other return from get_r_debug() (if no DT_DEBUG found) to also return -1. Thanks, --=20 Paul Pluzhnikov