public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Java to gdb
@ 2010-06-21 13:04 petrucristescu
  2010-06-21 13:20 ` Phil Muldoon
  0 siblings, 1 reply; 2+ messages in thread
From: petrucristescu @ 2010-06-21 13:04 UTC (permalink / raw)
  To: gdb


Hello,

I'm trying to interact wtih gdb from a Java application. What I want to do
is to create a Java GUI and form that GUI to send commands to gdb. So,
instead of writing commands in gdb command line interface I want to interact
via software with GDB. I know that is possible because in Eclipse this is
implemented.

What I tried is to send commands from Java to the pty where the gdb is
running. I've tried both with mi and cli but apparently I'm only able to
write in the terminal and not execute the commands.

Thanks in advance !

Petru
-- 
View this message in context: http://old.nabble.com/Java-to-gdb-tp28948301p28948301.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Java to gdb
  2010-06-21 13:04 Java to gdb petrucristescu
@ 2010-06-21 13:20 ` Phil Muldoon
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Muldoon @ 2010-06-21 13:20 UTC (permalink / raw)
  To: petrucristescu; +Cc: gdb

On 06/21/2010 02:04 PM, petrucristescu wrote:
> 
> Hello,
> 
> I'm trying to interact wtih gdb from a Java application. What I want to do
> is to create a Java GUI and form that GUI to send commands to gdb. So,
> instead of writing commands in gdb command line interface I want to interact
> via software with GDB. I know that is possible because in Eclipse this is
> implemented.

Eclipse is (I believe) implementing the MI protocol.  I think there
are various abstractions within Eclipse for this.

If you want to go that route, check out Chapter 27 "The gdb/mi
Interface" in the GDB on-line documentation. 

(http://sourceware.org/gdb/current/onlinedocs/gdb/)

 
> What I tried is to send commands from Java to the pty where the gdb is
> running. I've tried both with mi and cli but apparently I'm only able to
> write in the terminal and not execute the commands.

Yeah there are many different challenges with this.

You can use Python to script GDB if that will do.  There are few other
ways as well.  If you really want to go the way of using Java to
script GDB (and I would not recommend it), I would look at the Python
code in the python/ directory in GDB to understand the challenges
involved.

An in-depth discussion can be found at "23 Extending gdb"

and in particular

"23.2 Scripting gdb using Python"
 
Cheers,

Phil

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-21 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21 13:04 Java to gdb petrucristescu
2010-06-21 13:20 ` Phil Muldoon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).