public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/5] let gdb reuse gcc'c C compiler
@ 2014-05-16 15:26 Tom Tromey
  2014-05-16 15:26 ` [PATCH 1/5] export finish_bitfield_layout from stor-layout Tom Tromey
                   ` (6 more replies)
  0 siblings, 7 replies; 101+ messages in thread
From: Tom Tromey @ 2014-05-16 15:26 UTC (permalink / raw)
  To: gcc-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] 101+ messages in thread
* Re: [PATCH 5/5] add libcc1
@ 2014-10-28  3:19 Dominique Dhumieres
  2014-10-28  8:36 ` Jakub Jelinek
  0 siblings, 1 reply; 101+ messages in thread
From: Dominique Dhumieres @ 2014-10-28  3:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: tromey, jakub, law, pmuldoon

> This patch has now been committed.

It breaks bootstap on x86_64-apple-darwin14:

...
make[3]: Entering directory `/opt/gcc/p_build/libcc1'
make  all-am
make[4]: Entering directory `/opt/gcc/p_build/libcc1'
make[4]: *** No rule to make target `../libiberty/pic/libiberty.a', needed by `libcc1.la'.  Stop.
make[4]: Leaving directory `/opt/gcc/p_build/libcc1'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/opt/gcc/p_build/libcc1'
make[2]: *** [all-stage1-libcc1] Error 2
make[2]: Leaving directory `/opt/gcc/p_build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/gcc/p_build'
make: *** [all] Error 2

TIA

Dominique

^ permalink raw reply	[flat|nested] 101+ messages in thread
* Re: [PATCH 5/5] add libcc1
@ 2014-10-28  8:43 Uros Bizjak
  2014-10-28  8:55 ` Phil Muldoon
  2014-10-28  9:36 ` Jakub Jelinek
  0 siblings, 2 replies; 101+ messages in thread
From: Uros Bizjak @ 2014-10-28  8:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Tom Tromey, Jakub Jelinek, Jeff Law, pmuldoon

> This patch has now been committed.

Also breaks bootstap on x86_64-linux-gnu, CentOS 5.11:

gmake[4]: Entering directory `/home/uros/gcc-build/libcc1'
/bin/sh ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.
-I../../gcc-svn/trunk/libcc1  -I ../../gcc-svn/trunk/libcc1/../include
-I ../../gcc-svn/trunk/libcc1/../libgcc -I .././gcc
-I../../gcc-svn/trunk/libcc1/../gcc -I
../../gcc-svn/trunk/libcc1/../gcc/c -I
../../gcc-svn/trunk/libcc1/../gcc/c-family -I
../../gcc-svn/trunk/libcc1/../libcpp/include  -W -Wall -Werror -Werror
-fvisibility=hidden -g -MT plugin.lo -MD -MP -MF .deps/plugin.Tpo -c
-o plugin.lo ../../gcc-svn/trunk/libcc1/plugin.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I.
-I../../gcc-svn/trunk/libcc1 -I ../../gcc-svn/trunk/libcc1/../include
-I ../../gcc-svn/trunk/libcc1/../libgcc -I .././gcc
-I../../gcc-svn/trunk/libcc1/../gcc -I
../../gcc-svn/trunk/libcc1/../gcc/c -I
../../gcc-svn/trunk/libcc1/../gcc/c-family -I
../../gcc-svn/trunk/libcc1/../libcpp/include -W -Wall -Werror -Werror
-fvisibility=hidden -g -MT plugin.lo -MD -MP -MF .deps/plugin.Tpo -c
../../gcc-svn/trunk/libcc1/plugin.cc  -fPIC -DPIC -o .libs/plugin.o
cc1plus: warnings being treated as errors
../../gcc-svn/trunk/libcc1/../gcc/hash-table.h: In instantiation of
‘hash_table<pointer_hash<tree_node>, xcallocator, true>’:
../../gcc-svn/trunk/libcc1/plugin.cc:171:   instantiated from here
../../gcc-svn/trunk/libcc1/../gcc/hash-table.h:1161: warning: lowering
visibility of ‘void gt_ggc_mx(hash_table<T, xcallocator,
storage_tester<T,void>::value>*) [with T = T, Descriptor =
pointer_hash<tree_node>, Allocator = xcallocator]’ to match its type
../../gcc-svn/trunk/libcc1/../gcc/hash-table.h:1162: warning: lowering
visibility of ‘void gt_pch_nx(hash_table<T, xcallocator,
storage_tester<T,void>::value>*) [with T = T, Descriptor =
pointer_hash<tree_node>, Allocator = xcallocator]’ to match its type
../../gcc-svn/trunk/libcc1/../gcc/hash-table.h:1166: warning: lowering
visibility of ‘void gt_pch_nx(hash_map<T, U, V>*, void (*)(void*,
void*), void*) [with T = T, U = U, V = V, Descriptor =
pointer_hash<tree_node>, Allocator = xcallocator]’ to match its type
../../gcc-svn/trunk/libcc1/../gcc/hash-table.h:1169: warning: lowering
visibility of ‘void gt_pch_nx(hash_set<T, U>*, void (*)(void*, void*),
void*) [with T = T, U = U, Descriptor = pointer_hash<tree_node>,
Allocator = xcallocator]’ to match its type
../../gcc-svn/trunk/libcc1/../gcc/hash-table.h:1171: warning: lowering
visibility of ‘void gt_pch_nx(hash_table<T, xcallocator,
storage_tester<T,void>::value>*, void (*)(void*, void*), void*) [with
T = T, Descriptor = pointer_hash<tree_node>, Allocator = xcallocator]’
to match its type
gmake[4]: *** [plugin.lo] Error 1
gmake[4]: Leaving directory `/home/uros/gcc-build/libcc1'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/home/uros/gcc-build/libcc1'
gmake[2]: *** [all-stage1-libcc1] Error 2
gmake[2]: Leaving directory `/home/uros/gcc-build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/home/uros/gcc-build'
gmake: *** [all] Error 2

Uros.

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

end of thread, other threads:[~2014-10-30 10:11 UTC | newest]

Thread overview: 101+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16 15:26 [PATCH 0/5] let gdb reuse gcc'c C compiler Tom Tromey
2014-05-16 15:26 ` [PATCH 1/5] export finish_bitfield_layout from stor-layout Tom Tromey
2014-05-16 18:27   ` Jeff Law
2014-05-16 15:27 ` [PATCH 2/5] c_diagnostic_ignored_function hack Tom Tromey
2014-05-16 16:05   ` Joseph S. Myers
2014-06-19 20:46     ` Tom Tromey
2014-05-16 18:33   ` Jeff Law
2014-05-16 18:42     ` Tom Tromey
2014-05-16 15:27 ` [PATCH 3/5] introduce the binding oracle Tom Tromey
2014-05-16 19:12   ` Jeff Law
2014-06-05 15:31     ` Tom Tromey
2014-06-19 20:43     ` Tom Tromey
2014-05-16 15:27 ` [PATCH 4/5] add gcc/gdb interface files Tom Tromey
2014-05-22 12:52   ` Jeff Law
2014-05-22 13:16     ` Jakub Jelinek
2014-05-22 15:13       ` Jeff Law
2014-06-04 20:39       ` Tom Tromey
2014-06-05 19:23         ` Jeff Law
2014-06-05 19:30           ` Jakub Jelinek
2014-06-06  1:54             ` Tom Tromey
2014-06-06  5:35               ` Jakub Jelinek
2014-06-09 17:09               ` Jeff Law
2014-06-19 20:45                 ` Tom Tromey
2014-05-16 16:29 ` [PATCH 0/5] let gdb reuse gcc'c C compiler Mike Stump
2014-05-16 18:48 ` [PATCH 5/5] add libcc1 Tom Tromey
2014-05-16 20:29   ` Joseph S. Myers
2014-05-16 21:03     ` Tom Tromey
2014-06-18 21:07     ` Tom Tromey
2014-06-19 20:47     ` Tom Tromey
2014-05-16 21:36   ` Mike Stump
2014-05-16 22:17   ` Mike Stump
2014-06-05 19:34     ` Tom Tromey
2014-06-05 21:35       ` Mike Stump
2014-06-19 20:52   ` Tom Tromey
2014-06-19 21:45     ` Jakub Jelinek
2014-06-19 22:22       ` Tom Tromey
2014-06-20  3:11     ` Trevor Saunders
2014-06-20 15:34       ` Tom Tromey
2014-06-23 19:09         ` Jeff Law
2014-06-24  3:13           ` Trevor Saunders
2014-06-24 17:12             ` Tom Tromey
2014-06-24 18:10               ` Trevor Saunders
2014-07-18 19:00     ` Tom Tromey
2014-07-31  4:49     ` Jeff Law
2014-07-31  8:15       ` Richard Biener
2014-07-31 10:53         ` Trevor Saunders
2014-07-31 11:28           ` Richard Biener
2014-07-31 15:08             ` Joseph S. Myers
2014-07-31 19:20         ` Tom Tromey
2014-07-31 19:21           ` Jakub Jelinek
2014-07-31 19:51           ` Trevor Saunders
2014-07-31 20:07             ` Tom Tromey
2014-08-01  2:18               ` Trevor Saunders
2014-07-31 21:14       ` Mike Stump
2014-08-04 14:23         ` Tom Tromey
2014-08-05 19:34       ` Tom Tromey
2014-08-08 12:15         ` [PATCH 5/5] add libcc1 [gcc-5/changes.html] Jan Kratochvil
2014-08-31 15:12           ` Gerald Pfeifer
2014-09-14 15:07             ` Manuel López-Ibáñez
2014-09-17 14:14               ` Jan Kratochvil
2014-10-09  9:07       ` [PATCH 5/5] add libcc1 Phil Muldoon
2014-10-09  9:12         ` Jakub Jelinek
2014-10-09  9:18         ` Phil Muldoon
2014-10-10 22:31         ` Jeff Law
2014-10-24  7:43           ` Phil Muldoon
2014-10-24  7:53             ` Jakub Jelinek
2014-10-24 16:47             ` Jeff Law
2014-10-27 20:03               ` Phil Muldoon
2014-10-28 13:29                 ` Joseph S. Myers
2014-10-28 18:00                   ` Phil Muldoon
2014-10-29  3:32                     ` Joseph S. Myers
2014-10-29 10:29                     ` Jakub Jelinek
2014-10-29 10:45                       ` Paolo Bonzini
2014-10-29 10:58                         ` Jakub Jelinek
2014-10-29 10:59                           ` Paolo Bonzini
2014-10-29 11:03                             ` Jakub Jelinek
2014-10-29 15:00                               ` Paolo Bonzini
2014-10-29 11:10                             ` Phil Muldoon
2014-10-29 11:42                             ` Phil Muldoon
2014-10-30  5:37                       ` Jeff Law
2014-06-19 20:42 ` [PATCH 0/5] let gdb reuse gcc'c C compiler Tom Tromey
2014-07-30 16:28   ` Tom Tromey
2014-10-28  3:19 [PATCH 5/5] add libcc1 Dominique Dhumieres
2014-10-28  8:36 ` Jakub Jelinek
2014-10-28  8:46   ` Phil Muldoon
2014-10-28  8:50     ` Christophe Lyon
2014-10-28  9:09     ` Jakub Jelinek
2014-10-28  8:43 Uros Bizjak
2014-10-28  8:55 ` Phil Muldoon
2014-10-28  9:21   ` Uros Bizjak
2014-10-28  9:36 ` Jakub Jelinek
2014-10-28  9:58   ` Uros Bizjak
2014-10-28 10:51     ` Phil Muldoon
2014-10-28 10:56       ` Uros Bizjak
2014-10-28 11:16         ` Phil Muldoon
2014-10-28 11:53         ` Phil Muldoon
2014-10-28 12:24           ` Jakub Jelinek
2014-10-30  5:16             ` Jeff Law
2014-10-30  8:50             ` Thomas Schwinge
2014-10-30  8:56               ` Jakub Jelinek
2014-10-30 10:43                 ` Thomas Schwinge

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