binutils-gdb/gdb/cli
Tom de Vries 658a03e9e8 [gdbsupport] Add gdb::{waitpid,read,write,close}
We have gdb::handle_eintr, which allows us to rewrite:
...
  ssize_t ret;
    do
      {
        errno = 0;
        ret = ::write (pipe[1], "+", 1);
      }
    while (ret == -1 && errno == EINTR);
...
into:
...
  ssize_t ret = gdb::handle_eintr (-1, ::write, pipe[1], "+", 1);
...

However, the call to write got a bit mangled, requiring effort to decode it
back to its original form.

Instead, add a new function gdb::write that allows us to write:
...
  ssize_t ret = gdb::write (pipe[1], "+", 1);
...

Likewise for waitpid, read and close.

Tested on x86_64-linux.
2024-11-22 17:44:29 +01:00
..
cli-cmds.c [gdbsupport] Add gdb::{waitpid,read,write,close} 2024-11-22 17:44:29 +01:00
cli-cmds.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
cli-decode.c gdb: deprecated filename_completer and associated functions 2024-09-07 20:28:58 +01:00
cli-decode.h Wrap help options when building help string 2024-11-11 07:45:02 -07:00
cli-dump.c gdb: deprecated filename_completer and associated functions 2024-09-07 20:28:58 +01:00
cli-interp.c Use std::make_unique in more places 2024-10-20 10:13:05 -06:00
cli-interp.h Remove gdb_stdtargerr 2024-05-17 10:01:13 -06:00
cli-logging.c gdb: remove gdbcmd.h 2024-04-25 12:59:02 -04:00
cli-option.c Wrap help options when building help string 2024-11-11 07:45:02 -07:00
cli-option.h gdb: add filename option support 2024-11-04 15:56:01 +00:00
cli-script.c gdb: remove gdbcmd.h 2024-04-25 12:59:02 -04:00
cli-script.h gdb: move enum compile_i_scope_types to compile/compile.h 2024-04-22 21:34:19 -04:00
cli-setshow.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
cli-setshow.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
cli-style.c Add line-number styling 2024-09-30 13:23:35 -06:00
cli-style.h Add line-number styling 2024-09-30 13:23:35 -06:00
cli-utils.c Wrap help strings at 80 columns 2024-11-11 07:44:27 -07:00
cli-utils.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00