From 97cef9bf60ac09723ffdb9c69a164a87e32ce68c Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Fri, 5 Dec 2025 01:05:49 -0300 Subject: [PATCH] GDB: Guile: Remove procedures ineffectual since Guile 2.2 The manual mentions since GDB 10 that the functions for getting and setting the size of memory port buffers are deprecated, and don't work when using Guile 2.2 or later. Since now GDB only supports Guile 2.2 and newer, perform the promised removal. Reviewed-By: Eli Zaretskii Approved-By: Tom Tromey --- gdb/NEWS | 8 ++++++ gdb/doc/guile.texi | 35 ------------------------ gdb/guile/lib/gdb.scm | 4 --- gdb/guile/scm-ports.c | 62 ------------------------------------------- 4 files changed, 8 insertions(+), 101 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 3b0a7f7c3d3..0eff1d551a3 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -137,6 +137,14 @@ qExecAndArgs contains the gdb.Corefile object if a core file is loaded into the inferior, otherwise, this contains None. +* Guile API + + ** Procedures 'memory-port-read-buffer-size', + 'set-memory-port-read-buffer-size!', 'memory-port-write-buffer-size', + and 'set-memory-port-write-buffer-size!' have been removed. They were + deprecated since GDB 10. Users who need to control the size of a + memory port's internal buffer can use the 'setvbuf' procedure. + *** Changes in GDB 17 * Debugging Linux programs that use x86-64 or x86-64 with 32-bit pointer diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi index 83ea3e09c30..cbb3e257efa 100644 --- a/gdb/doc/guile.texi +++ b/gdb/doc/guile.texi @@ -3666,41 +3666,6 @@ of two elements: @code{(start end)}. The range is @var{start} to @var{end} inclusive. @end deffn -@deffn {Scheme Procedure} memory-port-read-buffer-size memory-port -Return the size of the read buffer of @code{} -@var{memory-port}. - -This procedure is deprecated and will be removed in @value{GDBN} 11. -It returns 0 when using Guile 2.2 or later. -@end deffn - -@deffn {Scheme Procedure} set-memory-port-read-buffer-size! memory-port size -Set the size of the read buffer of @code{} -@var{memory-port} to @var{size}. The result is unspecified. - -This procedure is deprecated and will be removed in @value{GDBN} 11. -When @value{GDBN} is built with Guile 2.2 or later, you can call -@code{setvbuf} instead (@pxref{Buffering, @code{setvbuf},, guile, GNU -Guile Reference Manual}). -@end deffn - -@deffn {Scheme Procedure} memory-port-write-buffer-size memory-port -Return the size of the write buffer of @code{} -@var{memory-port}. - -This procedure is deprecated and will be removed in @value{GDBN} 11. -It returns 0 when @value{GDBN} is built with Guile 2.2 or later. -@end deffn - -@deffn {Scheme Procedure} set-memory-port-write-buffer-size! memory-port size -Set the size of the write buffer of @code{} -@var{memory-port} to @var{size}. The result is unspecified. - -This procedure is deprecated and will be removed in @value{GDBN} 11. -When @value{GDBN} is built with Guile 2.2 or later, you can call -@code{setvbuf} instead. -@end deffn - A memory port is closed like any other port, with @code{close-port}. Combined with Guile's @code{bytevectors}, memory ports provide a lot diff --git a/gdb/guile/lib/gdb.scm b/gdb/guile/lib/gdb.scm index d02729707a6..bf554eadcaf 100644 --- a/gdb/guile/lib/gdb.scm +++ b/gdb/guile/lib/gdb.scm @@ -307,10 +307,6 @@ open-memory memory-port? memory-port-range - memory-port-read-buffer-size - set-memory-port-read-buffer-size! - memory-port-write-buffer-size - set-memory-port-write-buffer-size! ;; with-gdb-output-to-port, with-gdb-error-to-port are in experimental.scm. ;; scm-pretty-print.c diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c index de0cf800084..1f31071f8b1 100644 --- a/gdb/guile/scm-ports.c +++ b/gdb/guile/scm-ports.c @@ -716,42 +716,6 @@ gdbscm_memory_port_range (SCM port) return scm_list_2 (gdbscm_scm_from_ulongest (iomem->start), gdbscm_scm_from_ulongest (iomem->end)); } - -/* (memory-port-read-buffer-size port) -> integer */ - -static SCM -gdbscm_memory_port_read_buffer_size (SCM port) -{ - return scm_from_uint (0); -} - -/* (set-memory-port-read-buffer-size! port size) -> unspecified - An exception is thrown if read data is still buffered or if the port - is unbuffered. */ - -static SCM -gdbscm_set_memory_port_read_buffer_size_x (SCM port, SCM size) -{ - return scm_setvbuf (port, scm_from_utf8_symbol ("block"), size); -} - -/* (memory-port-write-buffer-size port) -> integer */ - -static SCM -gdbscm_memory_port_write_buffer_size (SCM port) -{ - return scm_from_uint (0); -} - -/* (set-memory-port-write-buffer-size! port size) -> unspecified - An exception is thrown if write data is still buffered or if the port - is unbuffered. */ - -static SCM -gdbscm_set_memory_port_write_buffer_size_x (SCM port, SCM size) -{ - return scm_setvbuf (port, scm_from_utf8_symbol ("block"), size); -} /* Initialize gdb ports. */ @@ -788,32 +752,6 @@ Return #t if the object is a memory port." }, "\ Return the memory range of the port as (start end)." }, - { "memory-port-read-buffer-size", 1, 0, 0, - as_a_scm_t_subr (gdbscm_memory_port_read_buffer_size), - "\ -Return the size of the read buffer for the memory port." }, - - { "set-memory-port-read-buffer-size!", 2, 0, 0, - as_a_scm_t_subr (gdbscm_set_memory_port_read_buffer_size_x), - "\ -Set the size of the read buffer for the memory port.\n\ -\n\ - Arguments: port integer\n\ - Returns: unspecified." }, - - { "memory-port-write-buffer-size", 1, 0, 0, - as_a_scm_t_subr (gdbscm_memory_port_write_buffer_size), - "\ -Return the size of the write buffer for the memory port." }, - - { "set-memory-port-write-buffer-size!", 2, 0, 0, - as_a_scm_t_subr (gdbscm_set_memory_port_write_buffer_size_x), - "\ -Set the size of the write buffer for the memory port.\n\ -\n\ - Arguments: port integer\n\ - Returns: unspecified." }, - END_FUNCTIONS }; -- 2.47.3