public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdbserver/linux: Access memory even if threads are running
Date: Thu, 31 Mar 2022 12:39:18 +0100	[thread overview]
Message-ID: <c0e12e1c-0ed0-e5b9-58e8-0cf8eb709073@palves.net> (raw)
In-Reply-To: <20220330132033.y3w4iyuedj76rfxd@ubuntu>

On 2022-03-30 14:22, Lancelot SIX wrote:
>> +/* 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.
> 

Doesn't hurt.  I've added that locally.  Thanks.

  reply	other threads:[~2022-03-31 11:39 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
2022-03-31 11:39     ` Pedro Alves [this message]
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=c0e12e1c-0ed0-e5b9-58e8-0cf8eb709073@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).