From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31044 invoked by alias); 30 May 2006 17:49:04 -0000 Received: (qmail 31014 invoked by uid 22791); 30 May 2006 17:49:03 -0000 X-Spam-Check-By: sourceware.org Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 30 May 2006 17:49:01 +0000 Received: from relay5.apple.com (a17-128-113-35.apple.com [17.128.113.35]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k4UHmvR2010776; Tue, 30 May 2006 10:48:57 -0700 (PDT) Received: from [17.201.22.244] (unknown [17.201.22.244]) by relay5.apple.com (Apple SCV relay) with ESMTP id EDCA2324014; Tue, 30 May 2006 10:48:54 -0700 (PDT) In-Reply-To: <7A4B9D88-47FB-4721-949F-632AF2E449FC@apple.com> References: <20060529122337.GB2021@brasko.net> <20060529144640.GA12145@nevyn.them.org> <20060530171518.GB31100@brasko.net> <7A4B9D88-47FB-4721-949F-632AF2E449FC@apple.com> Mime-Version: 1.0 (Apple Message framework v749.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: gdb@sources.redhat.com Content-Transfer-Encoding: 7bit From: Jim Ingham Subject: Re: MI query questions Date: Tue, 30 May 2006 17:55:00 -0000 To: Bob Rossi X-Mailer: Apple Mail (2.749.3) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00394.txt.bz2 Actually, to avoid confusion, this really looks like: (gdb) set interpreter mi1 -interpreter-exec console-quoted "break raise" ~"[0] cancel\n[1] all\n" ~"\nNon-debugging symbols:\n" ~"[2] -[NSException raise]\n" ~"[3] raise\n" =read-one-line,prompt="> " In our version of gdb the console interpreter really is the straight CLI console interpreter - this is required to get the "set interpreter" command to work. So we had to invent another interpreter that did the proper quoting. Anyway, this is what it would look like for you... Jim On May 30, 2006, at 10:41 AM, Jim Ingham wrote: > For that we added a "command_line_input_hook" which we run at the > beginning of command_line_input in top.c. We have an "mi running > cli" version that we put in place when we run -interpreter-exec. > This hook sends an async message like: > > (gdb) set interpreter mi1 > -interpreter-exec console "break raise" > [0] cancel > [1] all > > Non-debugging symbols: > [2] -[NSException raise] > [3] raise > =read-one-line,prompt="> " > > When the UI gets this, it can put up the prompt, and then send the > next line of input when it gets one. You have to do this not only > for the break command, but also so things like: > > -interpreter-exec console "define foo" > > and > > -interpreter-exec console "commands $bpnum" > > work properly. > > Looks like the hooks are all gone away from TOT gdb. I'm not sure > what is supposed to replace them in instances like this. But > anyway, something like this is what you will probably want to do. > > Jim > > On May 30, 2006, at 10:15 AM, Bob Rossi wrote: > >> On Tue, May 30, 2006 at 09:59:55AM -0700, Jim Ingham wrote: >>> What we did for this is along the lines Daniel suggested. When we >>> find multiple matches to a breakpoint, we return "matches", and then >>> a list of matches, something like: >>> >>> ^done,matches={b={index="0",canonical="-[NSException >>> raise]",binary="/ >>> System/Library/Frameworks/Foundation.framework/Versions/C/ >>> Foundation",line="0",addr="0x9294d008"},b= >>> {index="1",canonical="raise",binary="/usr/lib/ >>> libSystem.B.dylib",line="0",addr="0x9012f940"}} >>> >>> Then you have to provide some way for the UI to turn around and set >>> the breakpoints it wants to set. You aren't really guaranteed that >>> the UI will know how to cons up a breakpoint expression that will >>> return the breakpoint you want. We tried using the canonical form, >>> and with that and the shared library you could do it mostly, except >>> if we start doing things like template breakpoints. So we added >>> a -l >>> option to -break-insert that takes a list of the indices and sets >>> the >>> breakpoints for that list. >>> >>> It might have been cleaner to tie the list to the original -break- >>> insert command, like having -break-insert pass back a cookie along >>> with the matches, and then do: >>> >>> -break-confirm >>> >>> But I wanted to keep it stateless to make the implementation in gdb >>> simpler. So the UI just sends the -break-insert twice, the second >>> time with the list. You can also send "-1" for the list, and we >>> will >>> automatically accept all the breakpoints. >> >> What about the -interpreter-exec console "b A::func" case? >> >> Thanks, >> Bob Rossi >