From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12802 invoked by alias); 17 Nov 2007 11:55:04 -0000 Received: (qmail 12786 invoked by uid 22791); 17 Nov 2007 11:55:03 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (213.8.233.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 17 Nov 2007 11:55:00 +0000 Received: from HOME-C4E4A596F7 ([81.5.32.198]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id IIR58020 (AUTH halo1); Sat, 17 Nov 2007 13:52:20 +0200 (IST) Date: Sat, 17 Nov 2007 11:55:00 -0000 Message-Id: From: Eli Zaretskii To: Nick Roberts CC: gdb@sources.redhat.com, gdb-patches@sources.redhat.com In-reply-to: <18233.63439.953202.586908@kahikatea.snap.net.nz> (message from Nick Roberts on Wed, 14 Nov 2007 08:15:27 +1300) Subject: Re: Multiple breakpoint locations Reply-to: Eli Zaretskii References: <18233.63439.953202.586908@kahikatea.snap.net.nz> 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: 2007-11/txt/msg00350.txt.bz2 > From: Nick Roberts > Date: Wed, 14 Nov 2007 08:15:27 +1300 > > > The new code for breakpoints with multiple locations looks very good and > addresses a common complaint about GDB. I have a couple of points and > apologise if they have already been discussed. Thanks for your suggestions, I fixed the manual as shown below: 2007-11-17 Eli Zaretskii * gdb.texinfo (Set Breaks, Disabling): Clarify behavior of breakpoints with multiple locations. (Breakpoint Menus): Improve wording. Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.444 diff -u -r1.444 gdb.texinfo --- gdb/doc/gdb.texinfo 15 Nov 2007 18:43:23 -0000 1.444 +++ gdb/doc/gdb.texinfo 17 Nov 2007 11:48:53 -0000 @@ -2992,7 +2992,7 @@ @item Enabled or Disabled Enabled breakpoints are marked with @samp{y}. @samp{n} marks breakpoints that are not enabled. An optional @samp{(p)} suffix marks pending -breakpoints --- breakpoints for which address is either not yet +breakpoints---breakpoints for which address is either not yet resolved, pending load of a shared library, or for which address was in a shared library that was since unloaded. Such breakpoint won't fire until a shared library that has the symbol or line referred by @@ -3001,7 +3001,7 @@ Where the breakpoint is in your program, as a memory address. For a pending breakpoint whose address is not yet known, this field will contain @samp{}. A breakpoint with several locations will -have @samp{} in this field --- see below for details. +have @samp{} in this field---see below for details. @item What Where the breakpoint is in the source for your program, as a file and line number. For a pending breakpoint, the original string passed to @@ -3060,16 +3060,16 @@ In all those cases, @value{GDBN} will insert a breakpoint at all the relevant locations. -A breakpoint with multiple locations is displayed in the -breakpoint table using several rows --- one header row, followed -by one row for each breakpoint location. The header row -has @samp{} in the address column. The rows for -individual locations contain the actual addresses for locations, -and say what functions those locations are in. The number -column for a location has number in the format +A breakpoint with multiple locations is displayed in the breakpoint +table using several rows---one header row, followed by one row for +each breakpoint location. The header row has @samp{} in the +address column. The rows for individual locations contain the actual +addresses for locations, and show the functions to which those +locations belong. The number column for a location is of the form @var{breakpoint-number}.@var{location-number}. For example: + @smallexample Num Type Disp Enb Address What 1 breakpoint keep y @@ -3081,11 +3081,17 @@ Each location can be individually enabled or disabled by passing @var{breakpoint-number}.@var{location-number} as argument to the -@code{enable} and @code{disable} commands. +@code{enable} and @code{disable} commands. Note that you cannot +delete the individual locations from the list, you can only delete the +entire list of locations that be long to their parent breakpoint (with +the @kbd{delete @var{num}} command, where @var{num} is the number of +the parent breakpoint, 1 in the above example). Disabling or enabling +the parent breakpoint (@pxref{Disabling}) affects all of the locations +that belong to that breakpoint. @cindex pending breakpoints It's quite common to have a breakpoint inside a shared library. -The shared library may be loaded and unloaded explicitly, +Shared libraries can be loaded and unloaded explicitly, and possibly repeatedly, as the program is executed. To support this use case, @value{GDBN} updates breakpoint locations whenever any shared library is loaded or unloaded. Typically, you would @@ -3093,7 +3099,7 @@ debugging session, when the library is not loaded, and when the symbols from the library are not available. When you try to set breakpoint, @value{GDBN} will ask you if you want to set -a so called @dfn{pending breakpoint} --- breakpoint whose address +a so called @dfn{pending breakpoint}---breakpoint whose address is not yet resolved. After the program is run, whenever a new shared library is loaded, @@ -3544,6 +3550,9 @@ @code{info watch} to print a list of breakpoints, watchpoints, and catchpoints if you do not know which numbers to use. +Disabling and enabling a breakpoint that has multiple locations +affects all of its locations. + A breakpoint, watchpoint, or catchpoint can have any of four different states of enablement: @@ -3808,8 +3817,8 @@ to be defined several times, for application in different contexts. This is called @dfn{overloading}. When a function name is overloaded, @samp{break @var{function}} is not enough to tell @value{GDBN} where you want -a breakpoint. If you realize this is a problem, you can use -something like @samp{break @var{function}(@var{types})} to specify which +a breakpoint. You can use explicit signature of the function, as in +@samp{break @var{function}(@var{types})}, to specify which particular version of the function you want. Otherwise, @value{GDBN} offers you a menu of numbered choices for different possible breakpoints, and waits for your selection with the prompt @samp{>}. The first two