From: Daniel Jacobowitz <drow@false.org>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb@sources.redhat.com
Subject: Re: The 'x' command: size problem
Date: Wed, 07 Sep 2005 13:14:00 -0000 [thread overview]
Message-ID: <20050907131319.GA2963@nevyn.them.org> (raw)
In-Reply-To: <dfm2pe$maa$1@sea.gmane.org>
On Wed, Sep 07, 2005 at 10:53:34AM +0400, Vladimir Prus wrote:
> By "asynchronous" I mean that after sending a command to gdb, I can't just
> immediately get the result. I need to return to Qt message loop and wait
> why gdb reply is sent to my object. So, instead of:
>
> unsigned size = gdb_eval("sizeof(g)");
>
> I need to add another method to my class that will be called when result of
> "sizeof" arrives, and this complicates the implementation quite a bit.
This is a problem people have solved a thousand times...
> > And it'll give you a whole new host of issues keeping up with the
> > changing interface.
>
> But at least (assuming the interface is a nice C++ one), something like:
>
> get_memory(std::vector<char>& c)
>
> is crystal clear, while documentation of MI's -data-read-memory output
> format is very unclear. It does not document what's "table", or "next page"
> is and does not link to any definitions of those terms.
Please, then, feel free to improve the documentation. Really, a C++
interface would be just as complicated. Even in your example. Where
would you get the memory from? How much would you get? What would it
do on errors?
> > I don't see how it would eliminate the need for asynchronous
> > interfaces, either.
>
> I'd be talking with gdb in a separate thread. At least in Qt4, it will be
> possible to send requests from GUI thread to debugger controller thread,
> fully transparently. For Qt3, I'd implement such
> across-threads-command-queue myself.
Then you're going to need to asynchronously wait for the gdb thread to
return data to your GUI thread. If you're willing to block waiting for
that, then block waiting for GDB to print output! Really, it takes
about the same amount of time.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-09-07 13:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-06 15:04 Vladimir Prus
2005-09-06 15:25 ` Daniel Jacobowitz
2005-09-06 15:35 ` Vladimir Prus
2005-09-06 15:42 ` Daniel Jacobowitz
2005-09-07 6:55 ` Vladimir Prus
2005-09-07 13:14 ` Daniel Jacobowitz [this message]
2005-09-07 13:42 ` Vladimir Prus
2005-09-07 18:02 ` Eli Zaretskii
2005-09-06 19:17 ` Eli Zaretskii
2005-09-06 19:29 ` Daniel Jacobowitz
2005-09-07 6:40 ` Vladimir Prus
[not found] ` <17181.45190.337014.159288@gargle.gargle.HOWL>
2005-09-06 15:27 ` Vladimir Prus
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=20050907131319.GA2963@nevyn.them.org \
--to=drow@false.org \
--cc=gdb@sources.redhat.com \
--cc=ghost@cs.msu.su \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).