This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Tue, 13 Aug 2002, Jim Ingham wrote:

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

Yes and no. I do/did have it working, but it required some ugliness to pop 
back out of the command_loop into command_loop_hook.

The reason you didn't find much difficulty doing it is because I've 
massaged your code a little, particularly in the area of interpreter-exec.

For example, compare what I've proposed as the new MI output:

(gdb)
-interpreter-exec console "break main"
&"During symbol reading, couldn't parse type; debugger out of date?.\n"
&"During symbol reading, bad structure-type format.\n"
~"Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n"
=breakpoint-create,number="1"
^done
(gdb)
-interpreter-exec console list
~"734\t      catch_errors (captured_command_loop, 0, \"\", RETURN_MASK_ALL);\n"
~"735\t    }\n"
~"736\t  /* No exit -- exit is through quit_command.  */\n"
~"737\t}\n"
~"738\t\n"
~"739\tint\n"
~"740\tmain (int argc, char **argv)\n"
~"741\t{\n"
~"742\t  struct captured_main_args args;\n"
~"743\t  args.argc = argc;\n"
^done
(gdb)

As you can see, all the output is properly encapsulated to allow for 
asynchronous event notifications. The next step will be to get native 
inferiors to do proper I/O encapsulation.

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

I can certainly get it working, even though I think it is kinda messy. I 
can even clean that up, but I had to ask: is it really worth it? Maybe a
maintainence command or something would be better? I just don't want to 
see it be too easy for someone to really screw himself up.

(I'm glad I kept my patches for this lying around!)

In any case, if that's what people want, I can certainly put it back in 
after the "initial" implementation is approved and checked into cvs.

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]