From patchwork Mon Jul 13 09:09:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= X-Patchwork-Id: 7658 Received: (qmail 47835 invoked by alias); 13 Jul 2015 09:09:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 47821 invoked by uid 89); 13 Jul 2015 09:08:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=ham version=3.3.2 X-HELO: scc-mailout-kit-02-aegee.scc.kit.edu Received: from scc-mailout-kit-02-aegee.scc.kit.edu (HELO scc-mailout-kit-02-aegee.scc.kit.edu) (129.13.231.100) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 13 Jul 2015 09:08:56 +0000 Received: from aegeepc1.aegee.uni-karlsruhe.de ([129.13.131.81] helo=smtp.aegee.org) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:RSA_CAMELLIA_256_CBC_SHA1:256) (envelope-from ) id 1ZEZjH-0003Dm-CN for gdb-patches@sourceware.org; Mon, 13 Jul 2015 11:08:52 +0200 Authentication-Results: aegeeserv.aegee.org; auth=pass (PLAIN) smtp.auth=didopalauzov DKIM-Filter: OpenDKIM Filter v2.10.3 smtp.aegee.org t6D98rkA030687 Authentication-Results: mail.aegee.org; dkim=none Received: from [192.168.178.22] (aftr-185-17-204-15.dynamic.mnet-online.de [185.17.204.15]) (authenticated bits=0) by smtp.aegee.org (8.15.1/8.15.1) with ESMTPSA id t6D98rkA030687 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 13 Jul 2015 09:08:54 GMT Message-ID: <55A38035.20602@aegee.org> Date: Mon, 13 Jul 2015 11:09:09 +0200 From: Dilyan Palauzov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [PATCH] use system rl headers, when --with-system-readline is provided PR gdb/17077 Use system readline headers, instead the bundled ones, when gdb is configured --with-system-readline When building tui/tui-io.c one can see in gcc -E still the bundled readline include files get used. # 32 "./../opcodes/../readline/rltypedefs.h" #define _FUNCTION_DEF As the libreadline.{a,so} is linked from system it may lead to incompatible ABI. The provided patch: -- makes use of the fact, that the preprocessor can differentiate between #include "file" and #include , when proceeding paths; -- substitutes all occurrences of #include "readline/{readline,history,tilde}.h" with #include ; -- enables the project root directory for includes (from opcode), unconditionally only for #include "file", and for all includes ("",<>), when the bundled readline is built (using -iquote in place of -I); -- does not approach the problem for sim/erc32/sis.c. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index dfaa8a3..579d0dd 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -468,7 +468,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a # versions? OP_INCLUDE = $(INCLUDE_DIR)/opcode # Some source files like to use #include "opcodes/file.h" -OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/.. +OPCODES_CFLAGS = -I$(OP_INCLUDE) -iquote$(OPCODES_SRC)/.. # The simulator is usually nonexistent; targets that include one # should set this to list all the .o or .a files to be linked in. diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 7da288f..879faa0 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -33,7 +33,7 @@ #include "cli/cli-decode.h" #include "cli/cli-setshow.h" #include "gdb_vecs.h" -#include "readline/tilde.h" +#include #include "completer.h" #include "fnmatch.h" #include "top.h" diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index af0d167..e7380d2 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -69,8 +69,8 @@ #include "format.h" /* readline include files */ -#include "readline/readline.h" -#include "readline/history.h" +#include +#include /* readline defines this. */ #undef savestring diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index 365c166..c784ea4 100644 --- a/gdb/bsd-kvm.c +++ b/gdb/bsd-kvm.c @@ -33,7 +33,7 @@ #include #endif #include -#include "readline/readline.h" +#include #include #include #include diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 2a83169..7c891d1 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -25,7 +25,7 @@ #include "cli-out.h" #include "completer.h" #include "vec.h" -#include "readline/readline.h" +#include typedef struct cli_ui_out_data cli_out_data; diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 2ec2dd3..07e6870 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -20,8 +20,8 @@ #include "defs.h" #include "arch-utils.h" #include "dyn-string.h" -#include "readline/readline.h" -#include "readline/tilde.h" +#include +#include #include "completer.h" #include "target.h" /* For baud_rate, remote_debug and remote_timeout. */ #include "gdb_wait.h" /* For shell escape implementation. */ diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 2449dc5..6851873 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -26,7 +26,7 @@ #include "completer.h" #include #include "target.h" -#include "readline/readline.h" +#include #include "gdbcore.h" #include "cli/cli-utils.h" #include "gdb_bfd.h" diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 8d01b52..7cf5b95 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -16,7 +16,7 @@ along with this program. If not, see . */ #include "defs.h" -#include "readline/tilde.h" +#include #include "value.h" #include #include "arch-utils.h" diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c index 8298748..9f17826 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -23,7 +23,7 @@ #include "command.h" #include "objfiles.h" #include "gdbcore.h" -#include "readline/tilde.h" +#include #include "bfdlink.h" #include "gdbcmd.h" #include "regcache.h" diff --git a/gdb/completer.c b/gdb/completer.c index fd52a04..abaeeb4 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -36,7 +36,7 @@ /* Needed for rl_completer_word_break_characters() and for rl_filename_completion_function. */ -#include "readline/readline.h" +#include /* readline defines this. */ #undef savestring diff --git a/gdb/corelow.c b/gdb/corelow.c index 9218003..ffe5e50 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -37,7 +37,7 @@ #include "regset.h" #include "symfile.h" #include "exec.h" -#include "readline/readline.h" +#include #include "solib.h" #include "filenames.h" #include "progspace.h" diff --git a/gdb/event-top.c b/gdb/event-top.c index e9cc2d7..61dcd46 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -39,8 +39,8 @@ #include "maint.h" /* readline include files. */ -#include "readline/readline.h" -#include "readline/history.h" +#include +#include /* readline defines this. */ #undef savestring diff --git a/gdb/exec.c b/gdb/exec.c index 3dfc437..b09674e 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -37,7 +37,7 @@ #include "gcore.h" #include -#include "readline/readline.h" +#include #include "gdbcore.h" #include diff --git a/gdb/gcore.c b/gdb/gcore.c index 44b9d0c..9da77e1 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -33,7 +33,7 @@ #include "regcache.h" #include "regset.h" #include "gdb_bfd.h" -#include "readline/tilde.h" +#include /* The largest amount of memory to read from the target at once. We must throttle it to limit the amount of memory used by GDB during diff --git a/gdb/inferior.c b/gdb/inferior.c index 5e98df5..dc47c09 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -34,7 +34,7 @@ #include "continuations.h" #include "arch-utils.h" #include "target-descriptions.h" -#include "readline/tilde.h" +#include void _initialize_inferiors (void); diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c index a0ed281..fecbba3 100644 --- a/gdb/mingw-hdep.c +++ b/gdb/mingw-hdep.c @@ -23,7 +23,7 @@ #include "event-loop.h" #include "gdb_select.h" -#include "readline/readline.h" +#include #include diff --git a/gdb/monitor.c b/gdb/monitor.c index 4657d73..1c22d4a 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -53,7 +53,7 @@ #include "srec.h" #include "regcache.h" #include "gdbthread.h" -#include "readline/readline.h" +#include #include "rsp-low.h" static char *dev_name; diff --git a/gdb/psymtab.c b/gdb/psymtab.c index ba677bc..b6b8ae5 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -29,7 +29,7 @@ #include "bcache.h" #include "ui-out.h" #include "command.h" -#include "readline/readline.h" +#include #include "gdb_regex.h" #include "dictionary.h" #include "language.h" diff --git a/gdb/python/python.c b/gdb/python/python.c index 4f88b0e..b176d9e 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -29,7 +29,7 @@ #include "language.h" #include "event-loop.h" #include "serial.h" -#include "readline/tilde.h" +#include #include "python.h" #include "extension-priv.h" #include "cli/cli-utils.h" diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 82c129d..319a676 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -38,7 +38,7 @@ #include "regcache.h" #include "sim-regno.h" #include "arch-utils.h" -#include "readline/readline.h" +#include #include "gdbthread.h" /* Prototypes */ diff --git a/gdb/solib.c b/gdb/solib.c index eb933c0..7495cbb 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -39,7 +39,7 @@ #include "exec.h" #include "solist.h" #include "observer.h" -#include "readline/readline.h" +#include #include "remote.h" #include "solib.h" #include "interps.h" diff --git a/gdb/source.c b/gdb/source.c index fbec0f1..b3460c7 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -41,7 +41,7 @@ #include "filenames.h" /* for DOSish file names */ #include "completer.h" #include "ui-out.h" -#include "readline/readline.h" +#include #define OPEN_MODE (O_RDONLY | O_BINARY) #define FDOPEN_MODE FOPEN_RB diff --git a/gdb/symfile.c b/gdb/symfile.c index 0c35ffa..ad76621 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -44,7 +44,7 @@ #include "completer.h" #include "bcache.h" #include "hashtab.h" -#include "readline/readline.h" +#include #include "block.h" #include "observer.h" #include "exec.h" diff --git a/gdb/symmisc.c b/gdb/symmisc.c index bee07ac..2758b81 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -36,7 +36,7 @@ #include "typeprint.h" #include "gdbcmd.h" #include "source.h" -#include "readline/readline.h" +#include #include "psymtab.h" diff --git a/gdb/top.c b/gdb/top.c index 1e30b1c..53ed999 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -51,8 +51,8 @@ #include "filenames.h" /* readline include files. */ -#include "readline/readline.h" -#include "readline/history.h" +#include +#include /* readline defines this. */ #undef savestring diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c index 9747036..9f2472a 100644 --- a/gdb/tracefile-tfile.c +++ b/gdb/tracefile-tfile.c @@ -19,7 +19,7 @@ #include "defs.h" #include "tracefile.h" -#include "readline/tilde.h" +#include #include "filestuff.h" #include "rsp-low.h" /* bin2hex */ #include "regcache.h" diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 7c04ecb..3094efc 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -57,8 +57,8 @@ #include "tracefile.h" /* readline include files */ -#include "readline/readline.h" -#include "readline/history.h" +#include +#include /* readline defines this. */ #undef savestring diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index c885108..8b32f73 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -52,7 +52,7 @@ /* This redefines CTRL if it is not already defined, so it must come after terminal state releated include files like and "gdb_curses.h". */ -#include "readline/readline.h" +#include int tui_target_has_run = 0; diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 1a5639d..3c353ec 100644 --- a/gdb/tui/tui-interp.c +++ b/gdb/tui/tui-interp.c @@ -25,7 +25,7 @@ #include "ui-out.h" #include "cli-out.h" #include "tui/tui-data.h" -#include "readline/readline.h" +#include #include "tui/tui-win.h" #include "tui/tui.h" #include "tui/tui-io.h" diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 97906ce..4b38e7c 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -43,7 +43,7 @@ /* This redefines CTRL if it is not already defined, so it must come after terminal state releated include files like and "gdb_curses.h". */ -#include "readline/readline.h" +#include int key_is_start_sequence (int ch) diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index cdf322b..6487166 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -48,7 +48,7 @@ #include "gdb_curses.h" #include -#include "readline/readline.h" +#include #include diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 838471d..7fa6e3c 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -53,7 +53,7 @@ /* This redefines CTRL if it is not already defined, so it must come after terminal state releated include files like and "gdb_curses.h". */ -#include "readline/readline.h" +#include /* Tells whether the TUI is active or not. */ int tui_active = 0; diff --git a/gdb/utils.c b/gdb/utils.c index acb4c7d..289a1a1 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -60,7 +60,7 @@ #include "gdb_curses.h" -#include "readline/readline.h" +#include #include #include