gdb Digest 13 Aug 2002 16:12:56 -0000 Issue 925

Jim Ingham jingham@apple.com
Tue Aug 13 13:47:00 GMT 2002


Keith,

Was this really hard to get working?  I don't remember it being 
particularly difficult when I did it the first time.

It isn't all that practical for using the MI in another program, but it 
is very sweet when you are developing new MI commands, or when you are 
debugging an MI problem.  If you have this, you can start up in the 
console, navigate using the more user-friendly interpreter to the point 
where you wanted to debug, then pop into the MI and go from there.  
If/when we get the Tcl interpreter hooked into this (shouldn't be 
impossible) or equivalently when the forces of GNU orthodoxy come 
through with a Guile interpreter, it would also be nice to be able to 
drop into the scripting interpreter for some particular task, then pop 
out again to do your normal gdb-thing...

BTW, this latter use could be handled by having a cli 
"interpreter-exec" type command, or better yet, making some generic 
architecture for cross-interpreter execution.  You in fact need to do 
something like this, because otherwise handling breakpoint commands 
(which the user probably entered as CLI commands) while running under 
the MI is sort of hacky.  I had to do something like:

       if (gdb_current_interpreter_is_named ("mi"))
         {
           char *argv[2];
           int argc = 2;
           argv[0] = "console";
           argv[1] = new_line;
           mi_cmd_interpreter_exec (new_line, argv, argc);
         }
       else
         execute_command (new_line, 0);

in execute_control_command.  It would be better if this were not so 
mi-specific.

So for the really crucial things, I guess the interpreter switching is 
not essential.  But it is so handy that I would hate to lose it...

Maybe tell me off line what problems you were having, and I will see if 
I remember what I did?

Jim

P.S. If we had to tell people that they couldn't switch interpreters in 
the interpreter-exec command, I wouldn't consider that a fatal design 
flaw.  There is a straightforward way to do the same thing, and folks 
who do things like that deserve what they get.  Didn't their mothers 
tell them not to taunt the interpreter...

Jim

From: Keith Seitz <keiths@redhat.com>
> Date: Mon Aug 12, 2002  3:54:35  PM US/Pacific
> To: Andrew Cagney <ac131313@ges.redhat.com>
> Cc: gdb@sources.redhat.com
> Subject: Re: [Interpeters] "set interpreter" useful?
>
>
>> Yes (how can you rip out something that was never fully
>> approved/committed? :-)
>
> :-)
>
>> Sounds like you've come up with a bit of doco that should go with
>> -interpreter-exec, explaining why ``-interpreter-set'' would be a bad
>> move :-)
>
> Yup, I'll comment on that. Thanks for the comment. Now that this 
> headache
> is over with (gee, and I almost got it working really well!), I'm gonna
> finish up some documentation changes and start submitting patches for
> review... Stay tuned!
>
> Keith
>
>
--
Jim Ingham                                   jingham@apple.com
Developer Tools - gdb
Apple Computer



More information about the Gdb mailing list