Unofficial read-only mirror repository of the binutils-gdb project
  • C 50.5%
  • Makefile 22.6%
  • Assembly 13.2%
  • C++ 5.9%
  • Roff 1.5%
  • Other 5.7%
Find a file
Jakob Schäffeler fbe7f20a0f gdb/tui: fix unexpected reuse of color pairs
TUI translates ANSI styling sequences to curses color pairs.
Currently, this process uses COLOR_PAIR, which only returns values
from 0 to 255 which results in unexpected reuse of color pairs.

Replacing wattron/wattroff with wcolor_set avoids the 256 color pair
limit imposed by the COLOR_PAIR macro.  However, wcolor_set takes a
short for the pair index, limiting pairs to SHRT_MAX.

To support the full range of COLOR_PAIRS (up to 65536 with ncurses
6.1+), init_pair is replaced with init_extended_pair, and the pair
index is passed to wcolor_set via the opts parameter as an extended
color pair, a documented ncurses extension.

This also results in last_color_pair no longer being needed, and so it
is removed.

The extended color pair extension requires ncurses 6.1+, so a
configure check has been added.  The fallback path uses the older
color pair API which limits GDB to SHRT_MAX (32767) color pairs.

This patch was tested with make check-gdb TESTS="gdb.tui/*.exp"
Additionally, I tested this with the python extension from the bug
report.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34134

Approved-By: Andrew Burgess <aburgess@redhat.com>
2026-07-21 12:05:56 +01:00
archive [gdb] Move ChangeLog files to archive dir 2026-07-13 13:33:42 +02:00
bfd Automatic date update in version.in 2026-07-21 00:00:08 +00:00
binutils Change contact details for updating the sourceware crontab entry for the binutils. 2026-07-20 11:38:20 +01:00
config Support MinGW & 64-bit libraries/paths in Tcl autoconf scripts 2026-04-02 17:00:30 +02:00
contrib contrib: Make dg-extract-results.py tolerant of unparseable files 2026-05-29 17:28:56 -07:00
cpu Re: bfd/ELF: fold BFD_RELOC_<arch>_GOTOFF* 2026-07-12 21:43:19 +09:30
elfcpp gas, bfd, gold: Rename Arm v8/v9 architecture tags 2026-05-28 11:33:39 +00:00
etc Update year range in copyright notice of binutils files 2026-01-01 23:22:14 +10:30
gas convert dos eol to unix 2026-07-19 14:52:05 +09:30
gdb gdb/tui: fix unexpected reuse of color pairs 2026-07-21 12:05:56 +01:00
gdbserver [gdb] More codespell fixes 2026-07-13 15:23:12 +02:00
gdbsupport Document remote protocol pid and thread id sizes 2026-07-16 12:35:18 -06:00
gnulib gnulib: re-generate Makefile.in 2026-01-06 15:14:50 -05:00
gold convert dos eol to unix 2026-07-19 14:52:05 +09:30
gprof Change version number to 2.47.50 and regenerate files 2026-07-12 10:50:36 +01:00
gprofng convert dos eol to unix 2026-07-19 14:52:05 +09:30
include PE/COFF: raise normal PE section limit safely 2026-07-17 15:39:11 +02:00
ld init-mixed.c count 2026-07-19 17:58:39 +09:30
libbacktrace tidy m4 plugin config support 2025-11-03 10:59:50 +10:30
libctf libctf: bounds-check forward ctt_type before indexing pop[] 2026-07-16 09:47:42 +09:30
libdecnumber
libiberty libiberty d_compact_number signed integer overflow 2026-07-01 10:57:51 +09:30
libsframe libsframe testsuite format mismatches on 32-bit host 2026-04-06 10:46:06 +09:30
opcodes x86: accept LOCK on control register accesses only with ModR/M.reg == 0 2026-07-17 09:21:48 +02:00
readline
sim Fix typo in sim/ppc/std-config.h 2026-04-21 08:47:46 -06:00
texinfo
zlib tidy m4 plugin config support 2025-11-03 10:59:50 +10:30
.clang-format Remove ARI 2026-06-26 09:17:29 -06:00
.cvsignore
.editorconfig toplevel: unify the GCC and GDB/binutils .editorconfig files 2025-10-01 16:20:29 +01:00
.gitattributes binutils-gdb/git: Handle *.ac and *.m4 files in .gitattributes 2025-12-18 10:00:54 +01:00
.gitignore Add .clang-format 2026-02-11 07:53:01 -07:00
.pre-commit-config.yaml [pre-commit] Set stages for isort 2026-07-18 10:16:57 +02:00
ar-lib
ChangeLog Import the following commits from the master config sources: a2287c3041a3f2a204eb942e09c015eab00dc7dd 973e3e6af23b73a4f1b8d95680454cae22593bf8 3a71dc102953608d4592ec401b519837c28a672a f91a544533876c70f43b9fd51064b2bcf3fa7382 484648c73f3843b256dd011bd415e81594300a0a 7f4149527babe92cb5da1032734f5cb90cefdac5 9f6e0fe8ce04628bbd4a455118ff3f8309a1aef9 2026-01-08 11:20:38 +00:00
compile
config-ml.in
config.guess Import the following commits from the master config sources: a2287c3041a3f2a204eb942e09c015eab00dc7dd 973e3e6af23b73a4f1b8d95680454cae22593bf8 3a71dc102953608d4592ec401b519837c28a672a f91a544533876c70f43b9fd51064b2bcf3fa7382 484648c73f3843b256dd011bd415e81594300a0a 7f4149527babe92cb5da1032734f5cb90cefdac5 9f6e0fe8ce04628bbd4a455118ff3f8309a1aef9 2026-01-08 11:20:38 +00:00
config.rpath
config.sub Import the following commits from the master config sources: a2287c3041a3f2a204eb942e09c015eab00dc7dd 973e3e6af23b73a4f1b8d95680454cae22593bf8 3a71dc102953608d4592ec401b519837c28a672a f91a544533876c70f43b9fd51064b2bcf3fa7382 484648c73f3843b256dd011bd415e81594300a0a 7f4149527babe92cb5da1032734f5cb90cefdac5 9f6e0fe8ce04628bbd4a455118ff3f8309a1aef9 2026-01-08 11:20:38 +00:00
configure AMDGCN: Disable subdirectory configuration for unsupported GAS and LD 2026-02-18 17:32:32 +00:00
configure.ac AMDGCN: Disable subdirectory configuration for unsupported GAS and LD 2026-02-18 17:32:32 +00:00
COPYING
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
COPYING3
COPYING3.LIB
depcomp
djunpack.bat
install-sh
libtool.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS
Makefile.def Sync top-level with GCC 2025-11-03 09:53:04 +00:00
Makefile.in Sync toplevel files from gcc 2025-10-02 07:42:18 +08:00
Makefile.tpl Sync toplevel files from gcc 2025-10-02 07:42:18 +08:00
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
SECURITY.txt
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README, and so on. That'll give you
info about this package -- supported targets, how to use it, how to report
bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.