This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] command trace / source verbose mode
- From: Daniel Jacobowitz <drow at false dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gdb-patches at sources dot redhat dot com
- Date: Thu, 6 Jul 2006 13:33:15 -0400
- Subject: Re: [PATCH] command trace / source verbose mode
- References: <437B6228.8010103@st.com> <ubr0k74p7.fsf@gnu.org> <437C9C07.4020707@st.com> <20060706131559.GA18827@nevyn.them.org> <44AD46E2.6020207@st.com>
On Thu, Jul 06, 2006 at 06:22:42PM +0100, Andrew STUBBS wrote:
> >On Thu, Nov 17, 2005 at 03:04:39PM +0000, Andrew STUBBS wrote:
> >>+/* Command tracing state. */
> >>+
> >>+int source_verbose = 0;
> >>+int commandtrace = 0;
> >
> >You've got two of these, but you always check them together. One
> >variable and incrementing/decrementing the trace level around source
> >would work too, right?
>
> Yeah, that might work too. But the downside is that if the 'set debug
> commandtrace on' is issued multiple times then the user will have to
> turn it off that many times also.
Oh, good point. Your way it is.
> >>+ /* Is there a '-v' in the string somewhere? */
> >>+ if (args && (minusv = strstr(args,"-v")))
> >
> >Is there any benefit to supporting this at the end? We've already got
> >some other commands that are strictly command [options] [args], I
> >think, or at least we do in MI; I would recommend following the same
> >model here. If it starts with -v it's an option.
>
> Does it do any harm beyond making the code a little more complex? I was
> rather expecting you to say something about the fact that it changes the
> argument to the --command option (I documented the change).
I think that's pretty strange too; I'd rather it didn't.
I don't know if it does any harm, but it does make the code more
complex, and I don't think it's particularly useful.
> I think keeping it under 'set debug' is a good idea, but maybe because
> it is for debugging other than GDB itself it should be promoted to
> somewhere more prominent. Hmmm, perhaps "set trace-commands" it the best
> option.
>
> I'll have a think about it, work on the other points you raised, and get
> back to you.
Sounds good. I think you're right about keeping it out of set debug
after all. Got to be careful here: we're debugging user commands
during debugging of a user program, but not debugging the debugger.
Say that three times fast, I dare you.
--
Daniel Jacobowitz
CodeSourcery