Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Interacting with GDB/MI through Eclipse console

I'm not 100% for CDI-GDB but for DSF-GDB this is what I have seen.
When GDB send queries, (e.g., "are you sure you want to quit (Y/N)"), they get answered automatically
by GDB because it is dealing with our Console which it does not consider a user console.
 
What I suggest is that you prompt the user for input directly in Eclipse (in a Dialog box or something)
and allow your MI command to send that input to GDB.
 
The way I see it, the MI interface is meant for Machines and is not built to deal with user input.
 
Marc
 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Rohit Girme
Sent: January-24-10 9:51 PM
To: elaskavaia.cdt@xxxxxxxxx; CDT General developers list.
Subject: Re: [cdt-dev] Interacting with GDB/MI through Eclipse console

Hello,

Thanks Alena !!!
I have been trying to do just that with no luck...
I will keep looking. If anyone knows something about this please suggest a way ahead..

Thank You,
Rohit

On Sun, Jan 24, 2010 at 8:14 AM, Alena Laskavaia <elaskavaia.cdt@xxxxxxxxx> wrote:
Try to find a command that does require user input and check how it is
implemented. I think command like to create a new gdb function (or
handler)
needs input (it is cdt command not mi - but should not be different)

On Sat, Jan 23, 2010 at 3:25 PM, Rohit Girme <rgirme@xxxxxxx> wrote:
> Hi guys,
>
> I have been partially able to add a new MI command to GDB and to CDT. I can
> call a test GDB/MI command which displays "Hello", from the Eclipse UI. I
> embedded a call to my function/ MI command in the stepinto() function. So
> when I press the stepinto button in Eclipse UI, my test command in 'gdb'
> gets called and "Hello" is displayed in the Eclipse Console.
> The real command which I now intend to call from Eclipse UI requires user
> input. It processes the user input and then displays the result. If I try
> calling this command using the method similar to the test command (the
> command displaying "Hello"), Eclipse hangs. Rather at the backend 'gdb'
> waits for user input which it does not receive. I have a scanf statement in
> the function corresponding to my gdb command. Since that scanf does not
> receive any data, everything stops working. I guess gdb when working through
> the MI interface requires some out of band result records like *stopped or
> ^running which it then interprets and displays result accordingly. Hence
> there is no output.
> If I hardcode the user input, without asking the user for it (commenting the
> scanf statement), and run Eclipse I receive the output on the Eclipse
> Console as necessary. Because this time at the end of the function gdb knows
> that the function for my command is over.
> But if I ask user to input the values, nothing happens as explained above. I
> thought that Eclipse will display the prompt "Enter your Choice" as my
> function in gdb does if I run the command in the Terminal. But that does not
> happen too. Is there any way to tell the GDB/MI that user input is needed
> and to display the prompt on the Eclipse console ? Because normal command
> like step or resume or step over do not need user input so I cannot make any
> sense even after reading that code.
> Can anyone please help me on this ? If you have not understood my issue
> please let me know I will try to further clarify it. Thanks for your help
> guys.
>
> --
> Thanks & Regards,
> Rohit Girme
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



--
Thanks & Regards,
Rohit Girme


Back to the top