From: Jim Ingham <jingham@apple.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: David Lamy-Charrier <david.lamy@gmail.com>,
GDB List <gdb@sources.redhat.com>
Subject: Re: breakpoint commands no more working due to MI front-end
Date: Tue, 24 Jan 2006 04:48:00 -0000 [thread overview]
Message-ID: <6C9EDB78-56F9-45EE-9529-E32DFE0374C5@apple.com> (raw)
In-Reply-To: <20060123175805.GA21860@nevyn.them.org>
At Apple, we chose to have the breakpoint commands treated as a list
of CLI commands. We emit the breakpoint commands output as console
output from gdb (with the ~"..." form) this way it goes to the gdb
console in Xcode, which is where we've trained folks to look for it...
Recently, we've also added support in Xcode to do a lot of this, more
along the lines of what Daniel was suggesting. So we have log
actions that are run from Xcode after the stop, and you can tell
Xcode to continue, etc... All this requires no support for
breakpoint commands through the MI, and works quite well. But still
if you have complicated tasks you want to perform in the breakpoint
command (like switch on values in the target or whatever) it is
useful to write bare gdb commands. Xcode still allows you to do that
- though I must admit this is mostly because I had already made it
work through the MI long before the Xcode guys got around to
implementing their version.
Anyway, here's how it looks from the mi side:
$ gdb ./gdb
...
(top-gdb) break captured_main
Breakpoint 3 at 0x23a64: file ../../gdb/src/gdb/main.c, line 156.
(top-gdb) commands 3
Type commands for when breakpoint 3 is hit, one per line.
End with a line saying just "end".
>print argc
>continue
>end
(top-gdb) set interpreter mi
-exec-run
~"[Switching to process 6350 local thread 0xf03]\n"
^running
(gdb)
~"$1 = 0"
~"\n"
~"Continuing.\n"
^continuing
*started,reason="breakpoint-command"
GNU gdb 6.3.50.20050815-cvs (Fri Jan 13 22:09:42 GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc-apple-darwin8.3.0".
No symbol table is loaded. Use the "file" command.
(gdb)
Note we had to emit "*started" to tell Xcode that the target had
continued from the breakpoint command. If there were no "continue"
in the command, you would have gotten a "*stopped". The
"^continuing" is a wart that I put in for the Xcode guys at one
point. I even forget why they wanted it now. The main thing is the
*started...
All the code to get this working is in the Apple gdb. Yet another
thing that would probably be worth working into a form where we could
submit it back, but sadly I don't see the time in my schedule to do
this in the next year at least. But it did take a little head
scratching to get it all working correctly, so if anybody wants to
take this on, you might want to glance at that first.
Jim
On Jan 23, 2006, at 9:58 AM, Daniel Jacobowitz wrote:
> On Mon, Jan 23, 2006 at 12:53:59PM -0500, Bob Rossi wrote:
>> I think not allowing this would severaly limit the use of GDB for
>> a lot
>> of users. People in general already have an entire set of breakpoint
>> commands written. I don't think it would be a good idea to make the
>> users translate these commands to a FE specific format, especially
>> since each front end would be different.
>
> Then what should GDB do? Treat the command list as CLI commands or
> current interpreter commands? How about the poster's original issue:
> should their output come out before the *stopped? After? Replacing
> it?
>
> That's why I called it presently poorly defined :-)
>
> --
> Daniel Jacobowitz
> CodeSourcery
prev parent reply other threads:[~2006-01-23 19:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-23 11:32 David Lamy-Charrier
2006-01-23 13:51 ` Daniel Jacobowitz
2006-01-23 15:52 ` David Lamy-Charrier
2006-01-23 17:05 ` Daniel Jacobowitz
2006-01-23 17:37 ` David Lamy-Charrier
2006-01-23 17:47 ` Daniel Jacobowitz
2006-01-23 17:53 ` David Lamy-Charrier
2006-01-23 17:58 ` Bob Rossi
2006-01-23 19:34 ` Daniel Jacobowitz
2006-01-24 4:48 ` Jim Ingham [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6C9EDB78-56F9-45EE-9529-E32DFE0374C5@apple.com \
--to=jingham@apple.com \
--cc=david.lamy@gmail.com \
--cc=drow@false.org \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox