Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: petrucristescu <petru.cristescu@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Java to gdb
Date: Mon, 21 Jun 2010 13:20:00 -0000	[thread overview]
Message-ID: <4C1F6713.1040000@redhat.com> (raw)
In-Reply-To: <28948301.post@talk.nabble.com>

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


      reply	other threads:[~2010-06-21 13:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 13:04 petrucristescu
2010-06-21 13:20 ` Phil Muldoon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C1F6713.1040000@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=petru.cristescu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox