aboutsummaryrefslogtreecommitdiff
path: root/readline/chardefs.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-10-05 16:39:44 -0600
committerTom Tromey <tom@tromey.com>2019-10-23 15:16:48 -0600
commit6999161a2a3b3cbd918570e094199184331d4f81 (patch)
tree4c20bbd8c1c19e2e7ebcc55d821957e22c4ab9e8 /readline/chardefs.h
parent12e7c35ec3c09793ed9613cdf696b9f0f4dd86ec (diff)
downloadgdb-6999161a2a3b3cbd918570e094199184331d4f81.zip
gdb-6999161a2a3b3cbd918570e094199184331d4f81.tar.gz
gdb-6999161a2a3b3cbd918570e094199184331d4f81.tar.bz2
Move readline to the readline/readline subdirectory
readline turns out to be a bit of a stumbling block for the project to move gdbsupport (and then gdbserver) to the top-level. The issue is that readline headers are intended to be included with names like "readline/readline.h". To support this, gdb effectively adds a -I option pointing to the top-level source directory -- but, importantly, this option is not used when the system readline is used. For gdbsupport, a -I option like this would always be needed, but that in turn would break the system readline case. This was PR build/17077, fixed in commit a8a5dbcab8df0b3a9e04745d4fe8d64740acb323. Previously, we had discussed this on the gdb-patches list in terms of removing readline from the tree https://sourceware.org/ml/gdb-patches/2019-09/msg00317.html However, Eli expressed some concerns, and Joel did as well (off-list). Given those concerns, and the fact that a patch-free local readline is relatively new in gdb (it was locally patched for years), I changed my mind and decided to handle this situation by moving the readline sources down a level. That is, upstream readline is now in readline/readline, and the top-level readline directory just contains the minimal configury needed to build that. This fixes the problem because, when gdb unconditionally adds a -I$(top_srcdir), this will not find readline headers. A separate -I will be needed instead, which is exactly what's needed for --with-system-readline. gdb/ChangeLog 2019-10-23 Tom Tromey <tom@tromey.com> * Makefile.in (READLINE_DIR): Update. gdb/doc/ChangeLog 2019-10-23 Tom Tromey <tom@tromey.com> * Makefile.in (READLINE_DIR): Update. readline/ChangeLog 2019-10-23 Tom Tromey <tom@tromey.com> Move old contents to readline/ subdirectory. * aclocal.m4, configure, configure.ac, .gitignore, Makefile.am, Makefile.in, README: New files. Change-Id: Ice156a2ee09ea68722b48f64d97146d7428ea9e4
Diffstat (limited to 'readline/chardefs.h')
-rw-r--r--readline/chardefs.h164
1 files changed, 0 insertions, 164 deletions
diff --git a/readline/chardefs.h b/readline/chardefs.h
deleted file mode 100644
index 3cf1326..0000000
--- a/readline/chardefs.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* chardefs.h -- Character definitions for readline. */
-
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
-
- This file is part of the GNU Readline Library (Readline), a library
- for reading lines of text with interactive input and history editing.
-
- Readline is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Readline is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Readline. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _CHARDEFS_H_
-#define _CHARDEFS_H_
-
-#include <ctype.h>
-
-#if defined (HAVE_CONFIG_H)
-# if defined (HAVE_STRING_H)
-# if ! defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
-# include <memory.h>
-# endif
-# include <string.h>
-# endif /* HAVE_STRING_H */
-# if defined (HAVE_STRINGS_H)
-# include <strings.h>
-# endif /* HAVE_STRINGS_H */
-#else
-# include <string.h>
-#endif /* !HAVE_CONFIG_H */
-
-#ifndef whitespace
-#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
-#endif
-
-#ifdef CTRL
-# undef CTRL
-#endif
-#ifdef UNCTRL
-# undef UNCTRL
-#endif
-
-/* Some character stuff. */
-#define control_character_threshold 0x020 /* Smaller than this is control. */
-#define control_character_mask 0x1f /* 0x20 - 1 */
-#define meta_character_threshold 0x07f /* Larger than this is Meta. */
-#define control_character_bit 0x40 /* 0x000000, must be off. */
-#define meta_character_bit 0x080 /* x0000000, must be on. */
-#define largest_char 255 /* Largest character value. */
-
-#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
-#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
-
-#define CTRL(c) ((c) & control_character_mask)
-#define META(c) ((c) | meta_character_bit)
-
-#define UNMETA(c) ((c) & (~meta_character_bit))
-#define UNCTRL(c) _rl_to_upper(((c)|control_character_bit))
-
-#if defined STDC_HEADERS || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-
-#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
-# define isxdigit(c) (isdigit((unsigned char)(c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
-#endif
-
-#if defined (CTYPE_NON_ASCII)
-# define NON_NEGATIVE(c) 1
-#else
-# define NON_NEGATIVE(c) ((unsigned char)(c) == (c))
-#endif
-
-/* Some systems define these; we want our definitions. */
-#undef ISPRINT
-
-/* Beware: these only work with single-byte ASCII characters. */
-
-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum ((unsigned char)c))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha ((unsigned char)c))
-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit ((unsigned char)c))
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower ((unsigned char)c))
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint ((unsigned char)c))
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper ((unsigned char)c))
-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit ((unsigned char)c))
-
-#define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
-#define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
-#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
-
-#define _rl_pure_alphabetic(c) (NON_NEGATIVE(c) && ISALPHA(c))
-#define ALPHABETIC(c) (NON_NEGATIVE(c) && ISALNUM(c))
-
-#ifndef _rl_to_upper
-# define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)c) : (c))
-# define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)c) : (c))
-#endif
-
-#ifndef _rl_digit_value
-# define _rl_digit_value(x) ((x) - '0')
-#endif
-
-#ifndef _rl_isident
-# define _rl_isident(c) (ISALNUM(c) || (c) == '_')
-#endif
-
-#ifndef ISOCTAL
-# define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
-#endif
-#define OCTVALUE(c) ((c) - '0')
-
-#define HEXVALUE(c) \
- (((c) >= 'a' && (c) <= 'f') \
- ? (c)-'a'+10 \
- : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0')
-
-#ifndef NEWLINE
-#define NEWLINE '\n'
-#endif
-
-#ifndef RETURN
-#define RETURN CTRL('M')
-#endif
-
-#ifndef RUBOUT
-#define RUBOUT 0x7f
-#endif
-
-#ifndef TAB
-#define TAB '\t'
-#endif
-
-#ifdef ABORT_CHAR
-#undef ABORT_CHAR
-#endif
-#define ABORT_CHAR CTRL('G')
-
-#ifdef PAGE
-#undef PAGE
-#endif
-#define PAGE CTRL('L')
-
-#ifdef SPACE
-#undef SPACE
-#endif
-#define SPACE ' ' /* XXX - was 0x20 */
-
-#ifdef ESC
-#undef ESC
-#endif
-#define ESC CTRL('[')
-
-#endif /* _CHARDEFS_H_ */