Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Startting remote program from GDB using "target remote"

Hi Mikhail,

See my comments inline.

>> 1) Now I execute "target remote" from the .gdbinit
>> file. This seems to work, but it is a bit annoying
for
>> the customers, who have to enter the path to this
file
>> for each project. Is it possible to sent this
command
>> directly to GDB somewhere in my launcher class or
in
>> some class derived from session classes?
>>
>
> You can resume your session from the launcher by
calling the "resume" method of IDebugTarget.

I don't quite understand you. How does "resume" method
helps me with establishing a remote connection? What I
need is the way to programmatically execute the
"target remote /dev/ttyS1" command, so that  the
embedded developers  do not need to enter the path to
the .gdbinit for each project. My guess is that it
should be done somewhere in a GDBCDIDebugger-derived
class, e.g. in createLaunchSession method. But when I
try to do something like:
 CommandFactory factory =
miSession.getCommandFactory();
 MIGDBSet set = factory.createMIGDBSet(new String[] {
"target remote myhostname:myportnumber" });
 miSession.postCommand(set);
 MIInfo info = set.getMIInfo();

 then it does not work as expected. What I'm doing
wrong?
 BTW, I haven't found any Command classes for
connections to remote targets. It is not supported by
CDT yet, isn't it?

>> 2) Almost the same question about the path to the
>> custom version of GDB. Can I preset this value
>> somewhere to point to our GDB executable and not to
>> the Cygwin's one by default? Should I redefine the
Tab
>> class for Debugger settings for it? Or may be
>> somewhere in the plugin.xml?
>>
>
> The "official" way is to define your own debugger by
using the 'org.eclipse.cdt.debug.core.CDebugger"
extension point and contribute UI for it using the
"org.eclipse.cdt.debug.ui.CDebuggerPage" extension
point. (see for example the implementations of Cygwin
debugger or gdb server).

I've done as you suggested and it seems to work!

>> 4) I've noticed that when GDB successfully connects
to
>> the target and establishes a  session, it is not
>> possible to enter GDB commands from the console any
>> more. On the other hand, if it cannot establish the
>> connection correctly, I can enter GDB commands from
>> the console. What I would like to have is the
>> possibility to enter GDB commands from console in
both
>> cases. I think it cab be useful in many situations.
>> Any ideas how to enable it?
>>
>
> I don't know why you can not enter commands to the
console. It should be possible if gdb is responsive
(the program is suspended).

Sorry, it was my fault. I looked at the application
console, instead looking at the GDB console.
Everything works as expected.

Regards,
 Roman




		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs


Back to the top