From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>, Doug Evans <dje@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] Support command "catch syscall" properly on different targets
Date: Tue, 03 Mar 2015 12:14:00 -0000 [thread overview]
Message-ID: <54F5A5AC.4030503@redhat.com> (raw)
In-Reply-To: <86twy2i9br.fsf@gmail.com>
On 03/03/2015 11:55 AM, Yao Qi wrote:
> 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.
Pasting from:
https://sourceware.org/bugzilla/show_bug.cgi?id=10737#c5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A related question is how to handle syscalls by name ("catch syscall open"):
#1 - when the user kills the program, and then starts another one, of a different architecture, in the same inferior. E.g.,
- file prog64
- start
- catch syscall open
- kill
- file prog32
- run
#2 - similarly, when a 64-bit inferior execs a 32-bit inferior.
- file prog64
- start
- catch syscall open (2 on 64-bit)
- continue
- inferior execs prog32
- inferior now calls syscall 2, which is something else on i386.
These two cases may end up handled by the breakpoint_re_set machinery.
#3 - in the presence of multiple inferiors, each with its own arch.
- file prog64
- start
- add-inferior -exec prog32
- inferior 2
- start
- catch syscall open
- set schedule-multiple on
- c
- both inferiors call "open"
Here, I don't think we'll catch inferior 1's.
syscall catchpoints is presently inferior-specific; while I think it
should end up with a location per inferior instead, and "open" should be
parsed in each inferior's/location's arch.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>> 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.
Agreed.
>> "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
Yeah.
> 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'".
>
*nod*
FYI, I'm getting very close to posting the all-stop-on-top-of-non-stop
patch. The remaining dependency (that I had identified) was the
moribund locations rework posted recently. Itsets will follow.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-03-03 12:14 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
2015-03-03 12:14 ` Pedro Alves [this message]
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=54F5A5AC.4030503@redhat.com \
--to=palves@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).