public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Doug Evans <dje@google.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,  gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] Support command "catch syscall" properly on different targets
Date: Tue, 03 Mar 2015 11:56:00 -0000	[thread overview]
Message-ID: <86twy2i9br.fsf@gmail.com> (raw)
In-Reply-To: <CADPb22ROeSMbzvRO9_JnqKrtRcGcqnMPRoSw5FNP56sqUn7+jw@mail.gmail.com>	(Doug Evans's message of "Fri, 27 Feb 2015 10:49:43 -0800")

Doug Evans <dje@google.com> writes:

> 1) Do we have a story yet for how to handle differences across
> multiple targets/inferiors?

I don't have such story in my mind.  Taking a look at
https://sourceware.org/gdb/wiki/MultiTarget and I don't see anything on
handling differences across multiple targets.

> E.g., while not completely supported today, what if I'm
> debugging two targets and one supports "catch syscall"
> and one doesn't? "break" applies across all inferiors
> (though I really don't like this as a default behaviour),
> and it would be odd if "catch" didn't work similarly
> by default.

When GDB goes to multi-target, syscall catchpoint should be skipped for
targets don't support it, IMO.

>
> We have "thread apply all ...".
> We could also have "inferior apply all ...".
> E.g., inferior apply all break foo
> [I gather itsets can help with this, but I like the consistency.]
>
> "catch syscall" is target(arch)-specific.
> Multi-arch doesn't work today (except for special cases),
> but we should understand how we want it to work tomorrow.
> And similarly for all such target-specific commands.

Oh, multi-arch is supported, isn't?  done by these two patch sets in
both GDB and GDBserver side respectively,

  https://sourceware.org/ml/gdb-patches/2012-11/msg00228.html
  https://sourceware.org/ml/gdb-patches/2013-05/msg01057.html

However, I'd say that multi-arch isn't widely used because it is hard to
find a case that more than one arch can exist in one single target.
Probably once multi-target is supported, multi-arch will be more used.

In the future, IMHO, each command has a scope, a term from itset
patches, and the command is applied to the given scope.  The scope
is a set of targets, inferiors and threads.  If "catch syscall" command
is applied to a scope in which one target doesn't support it, GDB can
report an error like "Target foo in scope bar doesn't support
'catch syscall'".

>
> 2) Another issue that comes to mind is "catch syscall"
> calls get_current_arch which is based on the current frame
> if the inferior is live. If I'm debugging a multi-arch inferior (e.g., cell),
> then when I do "catch syscall" I have to be cognizant of which frame
> I'm in when I do that. [Right?]

Yeah, I think so.  "catch syscall" support varies on different arches,
and the frames in the same call chain may have different arches.
so "catch syscall" is supported on some frames, and not supported on
other frames.

>
> 3) Does this mean that I now won't be able to do:
>
> bash$ gdb foo
> (gdb) catch syscall open # <-- target == "exec" at this point
> (gdb) run

Yes.

-- 
Yao (齐尧)

  reply	other threads:[~2015-03-03 11:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 14:23 Yao Qi
2015-02-27 18:49 ` Doug Evans
2015-03-03 11:56   ` Yao Qi [this message]
2015-03-03 12:14     ` Pedro Alves
2015-02-27 18:50 ` Pedro Alves
2015-03-03 12:06   ` Yao Qi
2015-03-03 12:38     ` Pedro Alves
2015-02-27 21:04 ` Sergio Durigan Junior
2015-03-03 12:11   ` Yao Qi
2015-03-03 12:29     ` Pedro Alves
2015-03-03 18:06       ` Sergio Durigan Junior
2015-03-03 18:18         ` Pedro Alves
2015-03-06 16:36         ` Yao Qi
2015-03-06 22:04           ` Sergio Durigan Junior
2015-03-09 14:29             ` Yao Qi
2015-03-10  4:53               ` Sergio Durigan Junior
2015-03-09 14:10         ` Yao Qi

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=86twy2i9br.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).