Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Xiaozhu Meng <mxz297@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: icache-dcache coherence on ARM
Date: Mon, 06 May 2019 21:37:00 -0000	[thread overview]
Message-ID: <1b15495b-eb18-d910-2c0b-b446f5649b67@FreeBSD.org> (raw)
In-Reply-To: <CALjUE38vyfzeg_-A7vzS+rGdADNMX2sDg4eRv393r6jeJyb_hw@mail.gmail.com>

On 5/6/19 2:17 PM, Xiaozhu Meng wrote:
> Hi John,
> 
> Thanks for your reply!
> 
> I asked this question because our project on Linux actually encountered
> this problem where we use ptrace to write new code into the inferior and
> then continue the inferior. The continued inferior sometimes works as
> expected, but sometimes crashes due to SIGILLs on seemingly legitimate
> instructions.
> 
> So, I am very interested in seeing how GDB deals with this problem on
> Linux.

I do not see any explicit cache management in linux-nat.c or arm-linux-nat.c,
so my best guess is that GDB is relying on the kernel to manage this on
Linux as well.  I do see that TARGET_OBJECT_MEMORY on Linux can sometimes
use /proc/<pid>/mem instead of ptrace().  I'm not very familiar with the
Linux kernel, but one thing to check might be that both ptrace and procfs
are doing the i-cache invalidation.

-- 
John Baldwin


  reply	other threads:[~2019-05-06 21:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 19:30 Xiaozhu Meng
2019-05-06 20:52 ` John Baldwin
2019-05-06 21:17   ` Xiaozhu Meng
2019-05-06 21:37     ` John Baldwin [this message]
2019-05-07  2:52       ` Xiaozhu Meng

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=1b15495b-eb18-d910-2c0b-b446f5649b67@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb@sourceware.org \
    --cc=mxz297@gmail.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