From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31692 invoked by alias); 4 Jun 2013 20:23:10 -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 31676 invoked by uid 89); 4 Jun 2013 20:23:08 -0000 X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 04 Jun 2013 20:23:08 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r54KN6kg007479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Jun 2013 16:23:06 -0400 Received: from host2.jankratochvil.net (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r54KN2nI027521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 4 Jun 2013 16:23:05 -0400 Date: Tue, 04 Jun 2013 20:23:00 -0000 From: Jan Kratochvil To: Ben Cheng Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Ignore the first entry returned by svr4_current_sos_via_xfer_libraries for dynamically linked programs Message-ID: <20130604202301.GA8999@host2.jankratochvil.net> References: <20130604180722.GA23588@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-06/txt/msg00056.txt.bz2 On Tue, 04 Jun 2013 20:18:10 +0200, Ben Cheng wrote: > Hmm this problem only shows up after I refresh gdbserver from the > unmodified gdb 7.6 tree. As you mentioned, gdb 7.1 did not support > library-list-svr4, so when I paired gdbserver 7.1 with gdb 7.6 they > also work fine. In such case there is a bug in FSF gdbserver as it ignores only entries with name "". Normal glibc uses name "" for the first entry for the executable but Android Bionic apparently uses "" as the first entry instead. The bug is in gdbserver/linux-low.c linux_qxfer_libraries_svr4() which should always ignore the first entry, even if it is not "". The test IGNORE_FIRST does not need to be done there. The check /* Assume that everything is a library if the dynamic loader was loaded late by a static executable. */ if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL) is in fact already done by gdbserver/linux-low.c get_dynamic(): If PT_DYNAMIC (".dynamic") is not found gdbserver will never send and solib-svr4.c falls back to the memory reads where it copes with static executables fine. Thanks, Jan