From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26873 invoked by alias); 7 May 2008 04:33:14 -0000 Received: (qmail 26865 invoked by uid 22791); 7 May 2008 04:33:13 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 May 2008 04:32:36 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id m474WXjx085868 for ; Wed, 7 May 2008 04:32:33 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m474WXf02699366 for ; Wed, 7 May 2008 06:32:33 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m474WWrr022087 for ; Wed, 7 May 2008 06:32:32 +0200 Received: from bbkeks.de.ibm.com (dyn-9-152-248-39.boeblingen.de.ibm.com [9.152.248.39]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m474WVCq022076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 May 2008 06:32:32 +0200 Message-ID: <482130DF.5010703@de.ibm.com> Date: Wed, 07 May 2008 11:36:00 -0000 From: Markus Deuling User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Daniel Jacobowitz CC: GDB Patches , Ulrich Weigand Subject: Re: [patch]: User choice for multiply-defined symbols References: <481EBD33.6090704@de.ibm.com> <20080505114545.GA22274@caradoc.them.org> In-Reply-To: <20080505114545.GA22274@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2008-05/txt/msg00256.txt.bz2 Daniel Jacobowitz schrieb: > On Mon, May 05, 2008 at 09:54:27AM +0200, Markus Deuling wrote: >> Hello, >> >> the following patch makes use of the new "multiple-symbols" command introduced by Joel. > > Hi Markus, > > I'm totally confused by this explanation. What case are you handling > and what does it output before and after your patch? > Hi Daniel, I guess I should have explained it more in deep, sorry. I', referring to this discussion: http://sourceware.org/ml/gdb-patches/2008-01/msg00007.html By that time I also worked on a patch that implements a new command for users to enable a user choice for ambiguous symbols: http://sourceware.org/ml/gdb-patches/2008-01/msg00344.html The actual sense of the patch was to check for multiply-defined symbols at lookup time. If found and the user enabled user choice, a menu should appear to let the user choose which of the symbols to take. As Joel's patch introduces such a user command I made use of it and based my patch upon. So my current patch uses the new "multiple-symbols" command. If set to "ask" and ambiguous symbols are found, the user choice is called (output from testcase): (gdb) break foo [0] cancel [1] all [2] foo at ../../../../src/gdb/testsuite/gdb.base/multiple_symbols_mod.c:5 [3] foo at ../../../../src/gdb/testsuite/gdb.base/multiple_symbols.c:14 Without the patch GDB would take the first symbol "foo" it finds. I guess this would be the one in the main executable in this case. To set a breakpoint at "foo" in multiple_symbols_mod.c the user has to explicitly mention it. This exmaple shows the behaviour without patch: (gdb) break foo Breakpoint 2 at 0x100004b0: file ../../../../src/gdb/testsuite/gdb.base/multiple_symbols.c, line 14. My patch doesn't change the default behaviour of GDB as the default setting for "multiple-symbols" is all and the search for ambiguous symbols only takes place if set to "ask". Here's Joel's patch for the documentation changes: http://sourceware.org/ml/gdb-patches/2008-04/msg00044.html Regards, Markus -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com