public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/14] let gdb reuse gcc's C compiler
@ 2014-05-16 15:26 Tom Tromey
  2014-05-16 15:26 ` [PATCH 07/14] add infcall_mmap and gcc_target_options gdbarch methods Tom Tromey
                   ` (13 more replies)
  0 siblings, 14 replies; 35+ messages in thread
From: Tom Tromey @ 2014-05-16 15:26 UTC (permalink / raw)
  To: gdb-patches

Hi!

This patch series is half of a project to let gdb reuse gcc (which
half depends on which list you are seeing this on), so that users can
compile small snippets of code and evaluate them in the current
context of the inferior.

This first series implements this idea for C.  A user can compile a
code snippet and it will be inserted into the inferior and evaluated.
Declarations needed by the snippet are supplied by gdb, and there is a
bit of magic so that the snippets can refer to local variables in the
current frame.

The new command allows for arbitrary code to be inserted -- not just
expressions.  For example:

    (gdb) compile code int i; for (i = 0; i < 3; ++i) printf ("#%d\n", i)
    #0
    #1
    #2

This series supplies a gcc plugin to do most of the work, so that any
gcc crashes -- seen during development due to translation bugs -- do
not also crash gdb.

The interface between gdb and gcc is defined by a few files added to
include/.

There is a new shared library which gdb loads in order to communicate
with the gcc plugin.  This library communicates with the gcc plugin
using a simple, ad-hoc RPC mechanism.

This shared library exports a single public function which is used to
instantiate any needed objects.  This makes it simple to version the
API and avoid undue synchronization between gcc and gdb.

We think the plugin is best suited to be put into the gcc repository
because it is coupled more tightly to gcc than to gdb.

To try it out, just build gcc and gdb with the patches applied.  Then
set your PATH and LD_LIBRARY_PATH to point to the right subdirectories
of the new gcc install directory.

In later series we plan to extend this functionality; either on the
gcc side, say by writing a similar plugin for C++; or on the gdb side,
say by making it possible to compile breakpoint conditions.  However,
we haven't yet decided exactly which future projects we will tackle or
in what order.


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

end of thread, other threads:[~2014-06-21  7:32 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16 15:26 [PATCH 00/14] let gdb reuse gcc's C compiler Tom Tromey
2014-05-16 15:26 ` [PATCH 07/14] add infcall_mmap and gcc_target_options gdbarch methods Tom Tromey
2014-05-19  6:13   ` Yao Qi
2014-05-19  6:41     ` Jan Kratochvil
2014-05-19  6:47       ` Jan Kratochvil
2014-05-19  7:42       ` Yao Qi
2014-05-19  8:26         ` Agovic, Sanimir
2014-05-19 11:15           ` Jan Kratochvil
2014-05-16 15:26 ` [PATCH 02/14] add gcc/gdb interface files Tom Tromey
2014-05-19  8:06   ` Yao Qi
2014-05-19 13:53     ` Tom Tromey
2014-05-16 15:26 ` [PATCH 01/14] introduce ui_file_write_for_put Tom Tromey
2014-05-16 15:26 ` [PATCH 08/14] introduce call_function_by_hand_dummy Tom Tromey
2014-05-16 15:26 ` [PATCH 10/14] make dwarf_expr_frame_base_1 public Tom Tromey
2014-05-16 15:26 ` [PATCH 03/14] add some missing ops to DWARF assembler Tom Tromey
2014-05-16 15:27 ` [PATCH 14/14] the "compile" command Tom Tromey
2014-06-16  9:55   ` (Doc ping [for news and manual]) -- " Phil Muldoon
2014-06-16 15:25     ` Eli Zaretskii
2014-06-20  9:17       ` Phil Muldoon
2014-06-20  9:42         ` Eli Zaretskii
2014-06-20 10:01           ` Phil Muldoon
2014-06-20 12:37             ` Eli Zaretskii
2014-06-20 14:42             ` Tom Tromey
2014-06-20 19:00               ` Eli Zaretskii
2014-06-21  7:32                 ` Eli Zaretskii
2014-05-16 15:41 ` [PATCH 05/14] change how the CLI handles comments Tom Tromey
2014-05-18 23:26   ` Doug Evans
2014-05-19 14:07     ` Phil Muldoon
2014-06-03  7:04       ` Doug Evans
2014-05-16 15:43 ` [PATCH 09/14] split dwarf2_fetch_cfa_info from dwarf2_compile_expr_to_ax Tom Tromey
2014-05-16 15:43 ` [PATCH 13/14] add s390_gcc_target_options Tom Tromey
2014-05-16 15:43 ` [PATCH 12/14] add linux_infcall_mmap Tom Tromey
2014-05-16 15:56 ` [PATCH 04/14] add make_unqualified_type Tom Tromey
2014-05-16 16:18 ` [PATCH 11/14] export dwarf2_reg_to_regnum_or_error Tom Tromey
2014-05-16 16:18 ` [PATCH 06/14] add dummy frame destructor Tom Tromey

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).