From: Doug Evans <xdje42@gmail.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Pedro Alves <palves@redhat.com>,
GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Improve and fix catch-syscall.exp
Date: Wed, 18 Dec 2013 21:10:00 -0000 [thread overview]
Message-ID: <CAP9bCMREgYYoBMh6EaSDBrg8xsVHCu0hkF7hFK6_oA4L+s2h9A@mail.gmail.com> (raw)
In-Reply-To: <m338lrwfbm.fsf@redhat.com>
On Tue, Dec 17, 2013 at 9:35 AM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> On Tuesday, December 17 2013, Pedro Alves wrote:
>
>> On 12/16/2013 11:09 PM, Sergio Durigan Junior wrote:
>>> + set close_syscall [get_integer_valueof "close_syscall" 0]
>>> + set chroot_syscall [get_integer_valueof "chroot_syscall" 0]
>>> + set all_syscalls_numbers [list $close_syscall $chroot_syscall]
>>> + set last_syscall_number [get_integer_valueof "exit_group_syscall" 0]
>>
>> Minor nit:
>>
>> As we saw in the other patch, using 0 for invalid syscall
>> number isn't a good idea. It shouldn't really matter much in
>> practice but for code clarity I suggest defaulting to -1 instead.
>
> Thanks, fixed.
>
> I also modified catch-syscall.c to use SYS_bla instead of __NR_bla,
> according to Doug's suggestion on IRC.
>
> I believe Pedro already gave an approval. Doug, are you OK with this
> version?
>
> --
> Sergio
>
> 2013-12-17 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * gdb.base/catch-syscall.c: Include <sys/syscall.h>.
> (close_syscall, chroot_syscall, exit_group_syscall): New
> variables.
> * gdb.base/catch-syscall.exp: Replace gdb_compile by
> prepare_for_testing. Call fill_all_syscalls_numbers before
> starting. Replace gdb_exit, gdb_start, gdb_reinitialize_dir and
> gdb_load by clean_restart.
> (check_info_bp_any_syscall, check_info_bp_specific_syscall)
> (check_info_bp_many_syscalls): Remove global gdb_prompt.
> (check_call_to_syscall): Likewise. Add global decimal. Improve
> testing regex.
> (check_return_from_syscall): Likewise.
> (check_continue, insert_catch_syscall_with_arg): Remove global
> gdb_prompt.
> (insert_catch_syscall_with_many_args): Likewise. Add global
> decimal. Fix $filter_str. Improve testing regex.
> (check_for_program_end): Remove global gdb_prompt.
> (test_catch_syscall_without_args): Likewise. Add global decimal.
> Improve testing regex.
> (test_catch_syscall_with_args, test_catch_syscall_with_many_args)
> (test_catch_syscall_with_wrong_args)
> (test_catch_syscall_restarting_inferior)
> (test_catch_syscall_fail_nodatadir): Remove global gdb_prompt.
> (do_syscall_tests): Likewise. Remove global srcdir.
> (test_catch_syscall_without_args_noxml): Remove global gdb_prompt.
> Add global last_syscall_number. Test for the exact syscall number
> to be caught.
> (test_catch_syscall_with_args_noxml): Remove global gdb_prompt.
> Add global all_syscalls_numbers. Test each syscall number to be
> caught, instead of only testing "close".
> (test_catch_syscall_with_wrong_args_noxml): Remove global gdb_prompt.
> (do_syscall_tests_without_xml): Likewise. Remove global srcdir.
> Remove stale comment.
> (fill_all_syscalls_numbers): Add global last_syscall_number. Fill
> the correct syscall numbers using information from the inferior.
Two nits. Ok with the changes below.
> @@ -428,47 +391,35 @@ proc do_syscall_tests_without_xml {} {
>
> # This procedure fills the vector "all_syscalls_numbers" with the proper
> # numbers for the used syscalls according to the architecture.
> +#
> +# These numbers were taken from the respective <asm/unistd.h> files
> +# from each architecture.
This comment can go (no longer needed).
>
> -gdb_exit
> -set do_xml_test ![gdb_skip_xml_test]
> -gdb_start
> -gdb_reinitialize_dir $srcdir/$subdir
> -gdb_load ${binfile}
> +# Filling all the syscalls numbers before starting anything.
s/Filling/Fill/
> +fill_all_syscalls_numbers
next prev parent reply other threads:[~2013-12-18 21:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 23:06 Sergio Durigan Junior
2013-12-15 18:31 ` Doug Evans
2013-12-15 18:44 ` Doug Evans
2013-12-16 4:24 ` Sergio Durigan Junior
2013-12-16 4:20 ` Sergio Durigan Junior
2013-12-16 23:09 ` Sergio Durigan Junior
2013-12-17 10:24 ` Pedro Alves
2013-12-17 17:35 ` Sergio Durigan Junior
2013-12-18 21:10 ` Doug Evans [this message]
2013-12-18 22:26 ` Sergio Durigan Junior
2013-12-16 17:50 ` Pedro Alves
2013-12-16 17:59 ` Sergio Durigan Junior
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=CAP9bCMREgYYoBMh6EaSDBrg8xsVHCu0hkF7hFK6_oA4L+s2h9A@mail.gmail.com \
--to=xdje42@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=sergiodj@redhat.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