public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Robin Whittle <rw@firstpr.com.au>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Compiling and injecting code in GDB: C++ in addition to C?
Date: Fri, 10 Feb 2023 10:01:42 -0700	[thread overview]
Message-ID: <87k00pxxmx.fsf@tromey.com> (raw)
In-Reply-To: <1575f29a-498f-5c65-41cc-3ee134108d48@firstpr.com.au> (Robin Whittle's message of "Thu, 9 Feb 2023 03:34:43 +1100")

>>>>> "Robin" == Robin Whittle <rw@firstpr.com.au> writes:

Robin> Is it possible to inject C++ code, with any version of gdb and gcc/g++?

My experience is that the C++ plugin isn't very functional.  It seems to
have some bugs and crash pretty frequently as well.  Also, it seems like
nobody is actively working on it.

Robin> I want this capability so I can easily dump the contents of large,
Robin> complex, vectors of class objects to a text file, likely multiple
Robin> times the middle of a debug session.  Also I would like to be able to
Robin> modify such data programmatically.

I wonder if you could do some trick like have a library, then use
'compile' in C mode to dlopen it.  Not great of course.

Tom

  reply	other threads:[~2023-02-10 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 16:34 Robin Whittle
2023-02-10 17:01 ` Tom Tromey [this message]
2023-02-11  9:03   ` Robin Whittle

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=87k00pxxmx.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb@sourceware.org \
    --cc=rw@firstpr.com.au \
    /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).