binutils-gdb/gdbsupport
Tom Tromey e88bc211ae Document remote protocol pid and thread id sizes
The recent ptid work came from a bug where a problem was observed due
to sign extension.  That bug also suggested documenting the guaranteed
range of thread- and process-ids in the remote protocol.

This patch documents these as being 32-bit values at minimum.  I also
added static asserts to ensure this is true -- note that although
'int' may be 16 bit per the C standard, I doubt gdb would build on
such a host.

I didn't specify a maximum because it is host-dependent.  This is
perhaps something to change, and while I do have some work in this
area, it's quite invasive.  Also, while widening the range here would
be good, it would also be incompatible in a sense, where a newer
protocol implementation may end up using values not supported by older
versions of gdb.  Perhaps one idea would be to simply change these
both to int32_t and move on.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33979
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2026-07-16 12:35:18 -06:00
..
unordered_dense gdbsupport: bump unordered_dense to 4.8.0 2025-10-30 12:31:34 -04:00
.dir-locals.el Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
.gitattributes [gdb] Fix whitespace in *.def 2025-12-10 00:25:20 +01:00
acinclude.m4 gdb: move libiberty.m4 to gdbsupport 2024-01-10 19:52:52 -05:00
aclocal.m4 [gdbsupport] Rerun autoreconf -f 2024-11-23 12:40:36 +01:00
agent.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
agent.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
alt-stack.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
array-view.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
ax.def Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
block-signals.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
break-common.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
btrace-common.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
btrace-common.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
buildargv.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
byte-vector.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
check-defines.el Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
cleanups.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
cleanups.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
common-debug.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
common-debug.h gdb/elfread: add debug output for GNU ifunc resolution 2026-02-13 14:03:21 -05:00
common-defs.h [gdb] Remove unnecessary defs.h/common-defs.h includes 2026-04-21 23:12:13 +02:00
common-exceptions.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
common-exceptions.h [gdb] Convert anonymous struct typedefs 2026-07-13 15:06:35 +02:00
common-gdbthread.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
common-inferior.cc gdb/gdbserver: move argument setting complexity into gdbsupport/ 2026-02-13 16:37:38 +00:00
common-inferior.h gdb/gdbserver: move argument setting complexity into gdbsupport/ 2026-02-13 16:37:38 +00:00
common-regcache.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
common-regcache.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
common-types.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
common-utils.cc Remove ARI 2026-06-26 09:17:29 -06:00
common-utils.h gdb: refuse to produce .gdb_index when skeletonless type units are present 2026-05-08 18:56:27 -04:00
common.m4 Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
compiler-type.m4 Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
config.in GDB: aarch64-linux: Fix build failure on musl systems 2026-03-16 23:17:52 -03:00
configure Add two new warnings to warning.m4 2026-06-05 14:51:13 -06:00
configure.ac GDB: aarch64-linux: Fix build failure on musl systems 2026-03-16 23:17:52 -03:00
create-version.sh Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
cxx-thread.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
def-vector.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
default-init-alloc.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
eintr.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
enum-flags.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
enumerate.h gdbsupport: add gdb::ranges::views::enumerate util 2026-04-16 15:43:55 -04:00
environ.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
environ.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
errors.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
errors.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
event-loop.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
event-loop.h [gdb] Use using instead of typedef some more (part 2) 2026-07-13 15:06:35 +02:00
event-pipe.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
event-pipe.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
fileio.cc Use enum types for remote fileio flags 2026-02-27 13:58:04 -07:00
fileio.h [gdb] Use using instead of typedef some more (part 1) 2026-07-13 15:06:35 +02:00
filestuff.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
filestuff.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
filtered-iterator.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
format.cc gdb, gdbsupport, gdbserver: add support for printf 't' length modifier 2026-01-15 14:34:54 -05:00
format.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
forward-scope-exit.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
function-view.h Include traits.h in function-view.h 2026-04-29 12:36:34 -06:00
gdb-checked-static-cast.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb-dlfcn.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb-dlfcn.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
gdb-hashtab.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
gdb-sigmask.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb-xfree.h Remove ARI 2026-06-26 09:17:29 -06:00
gdb_argv_vec.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_assert.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_binary_search.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_file.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
gdb_locale.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_obstack.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_obstack.h Introduce character-printing class 2026-01-31 11:38:47 -07:00
gdb_proc_service.h [gdb] Convert anonymous struct typedefs 2026-07-13 15:06:35 +02:00
gdb_ref_ptr.h Use gdb::Requires in gdb::ref_ptr 2026-05-29 12:45:07 -06:00
gdb_regex.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_regex.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_select.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_setjmp.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_signals.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_splay_tree.h [gdb] Convert template typedefs to using 2026-07-13 15:06:35 +02:00
gdb_sys_time.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_tilde_expand.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_tilde_expand.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_unique_ptr.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_unlinker.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_vecs.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_vecs.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_wait.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
gdb_wait.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
host-defs.h [gdb] Remove '/* *' multi-line comment marker 2026-06-01 20:14:37 +02:00
intrusive_list.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
iteration-status.h gdbsupport: remove iteration_status_str 2026-04-17 22:50:59 -04:00
iterator-range.h [gdbsupport] Add parameterless iterator_range constructor 2026-04-24 14:17:29 +02:00
job-control.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
job-control.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
libiberty.m4 Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
Makefile.am Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
Makefile.in [gdbsupport] Regenerate Makefile.in 2026-01-11 10:53:26 +01:00
netstuff.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
netstuff.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
new-op.cc Remove ARI 2026-06-26 09:17:29 -06:00
next-iterator.h [gdbsupport] Use using instead of typedef in next_iterator 2026-06-09 14:37:16 +02:00
observable.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
offset-type.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
osabi.cc gdb, gdbserver, gdbsupport: replace many uses of strcmp with streq 2026-03-16 13:24:00 -04:00
osabi.def Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
osabi.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
owning_intrusive_list.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
packed.h Do not use ENUM_BITFIELD 2026-05-29 14:39:55 -06:00
parallel-for.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
pathstuff.cc Windows: Normalize backslashes to forward slashes 2026-07-06 22:13:07 +01:00
pathstuff.h Windows: Normalize backslashes to forward slashes 2026-07-06 22:13:07 +01:00
poison.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
preprocessor.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
print-utils.cc [gdbsupport] Fix get_print_cell use in threads 2026-01-06 21:05:46 +01:00
print-utils.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
ptid.cc Handle -1 in ptid_t::parse 2026-07-02 12:55:33 -06:00
ptid.h Document remote protocol pid and thread id sizes 2026-07-16 12:35:18 -06:00
ptrace.m4 Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
range-chain.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
README
refcounted-object.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
reference-to-pointer-iterator.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
remote-args.cc [gdb] Remove unnecessary defs.h/common-defs.h includes 2026-04-21 23:12:13 +02:00
remote-args.h gdb/gdbserver: move argument setting complexity into gdbsupport/ 2026-02-13 16:37:38 +00:00
rsp-low.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
rsp-low.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
run-time-clock.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
run-time-clock.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
safe-iterator.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
safe-strerror.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scope-exit.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scoped_fd.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scoped_ignore_signal.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scoped_ignore_sigttou.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scoped_mmap.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scoped_mmap.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
scoped_restore.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
scoped_signal_handler.h gdb: remove an unintended #undef 2026-04-16 17:38:19 +02:00
search.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
search.h [gdb] Use using instead of typedef some more (part 2) 2026-07-13 15:06:35 +02:00
selftest.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
selftest.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
selftest.m4 Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
signals-state-save-restore.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
signals-state-save-restore.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
signals.cc gdb, gdbserver, gdbsupport: replace many uses of strcmp with streq 2026-03-16 13:24:00 -04:00
string-set.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
symbol.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
task-group.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
task-group.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
tdesc.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
tdesc.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
thread-pool.cc Add lock_guard to thread_pool::thread_count 2026-03-20 13:04:03 -06:00
thread-pool.h [gdb] Use using instead of typedef 2026-06-11 08:54:34 +02:00
traits.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
underlying.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
unordered_map.h gdbsupport: add gdb::unordered_string_map 2026-02-13 14:04:07 -05:00
unordered_set.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
valid-expr.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
version.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
warning.m4 Add two new warnings to warning.m4 2026-06-05 14:51:13 -06:00
work-queue.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
x86-xstate.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
xml-utils.cc Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00
xml-utils.h Update copyright dates to include 2026 2026-01-05 13:16:46 -07:00

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.