Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdbserver/linux: Access memory even if threads are running
Date: Wed, 30 Mar 2022 13:22:11 +0000	[thread overview]
Message-ID: <20220330132033.y3w4iyuedj76rfxd@ubuntu> (raw)
In-Reply-To: <20220330124319.2804582-3-pedro@palves.net>

> +/* Helper for read_memory/write_memory using /proc/PID/mem.  Because
> +   we can use a single read/write call, this can be much more
> +   efficient than banging away at PTRACE_PEEKTEXT.  Also, unlike
> +   PTRACE_PEEKTEXT/PTRACE_POKETEXT, this works with running threads.
> +   One an only one of READBUF and WRITEBUF is non-null.  If READBUF is
> +   not null, then we're reading, otherwise we're writing.  */

Hi,

Seems to me that this property can be asserted.  WDYT?

Something like

    gdb_assert ((readbuf == nullptr) != (writebuf == nullptr));

should do.

Best,
Lancelot.

> +
> +static int
> +proc_xfer_memory (CORE_ADDR memaddr, unsigned char *readbuf,
> +		  const gdb_byte *writebuf, int len)

  reply	other threads:[~2022-03-30 13:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 12:43 [PATCH 0/3] gdbserver/linux: access memory while threads are running without pausing Pedro Alves
2022-03-30 12:43 ` [PATCH 1/3] gdbserver/qXfer::threads, prepare_to_access_memory=>target_pause_all Pedro Alves
2022-03-30 12:43 ` [PATCH 2/3] gdbserver/linux: Access memory even if threads are running Pedro Alves
2022-03-30 13:22   ` Lancelot SIX via Gdb-patches [this message]
2022-03-31 11:39     ` Pedro Alves
2022-04-04 14:34       ` Pedro Alves
2022-03-30 12:43 ` [PATCH 3/3] gdbserver: Eliminate prepare_to_access_memory Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220330132033.y3w4iyuedj76rfxd@ubuntu \
    --to=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox