Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Xiaozhu Meng <mxz297@gmail.com>
To: John Baldwin <jhb@freebsd.org>
Cc: gdb@sourceware.org
Subject: Re: icache-dcache coherence on ARM
Date: Tue, 07 May 2019 02:52:00 -0000	[thread overview]
Message-ID: <CALjUE38AvjJQeF9AHwgAgw-0hcZG3FN4hT7CM5so68pUO9k=Cw@mail.gmail.com> (raw)
In-Reply-To: <1b15495b-eb18-d910-2c0b-b446f5649b67@FreeBSD.org>

Hi John,

Thanks for hinting that GDB may also use procfs. I replaced ptrace() with
procfs to write code to the inferior and my code is now always working as
expected!

I appreciate your helps!

Thanks,

--Xiaozhu

On Mon, May 6, 2019 at 4:37 PM John Baldwin <jhb@freebsd.org> wrote:

> 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-07  2:52 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
2019-05-07  2:52       ` Xiaozhu Meng [this message]

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='CALjUE38AvjJQeF9AHwgAgw-0hcZG3FN4hT7CM5so68pUO9k=Cw@mail.gmail.com' \
    --to=mxz297@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=jhb@freebsd.org \
    /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