Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>,
	       Gabriel Krisman Bertazi <gabriel@krisman.be>
Subject: Re: [PATCH 2/3] Adjust calls for setting "catch syscall" information
Date: Fri, 14 Nov 2014 23:18:00 -0000	[thread overview]
Message-ID: <87a93t74n5.fsf@redhat.com> (raw)
In-Reply-To: <54662585.5070205@redhat.com> (Pedro Alves's message of "Fri, 14	Nov 2014 15:53:41 +0000")

On Friday, November 14 2014, Pedro Alves wrote:

> On 11/13/2014 12:18 AM, Sergio Durigan Junior wrote:
>> --- a/gdb/breakpoint.c
>> +++ b/gdb/breakpoint.c
>> @@ -8607,10 +8607,11 @@ print_it_catch_syscall (bpstat bs)
>>    ptid_t ptid;
>>    struct target_waitstatus last;
>>    struct syscall s;
>> +  struct gdbarch *gdbarch = target_gdbarch ();
>
> I think this would better be bs->bp_location_at->gdbarch .
>
>> @@ -8653,6 +8654,7 @@ print_one_catch_syscall (struct breakpoint *b,
>>    struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
>>    struct value_print_options opts;
>>    struct ui_out *uiout = current_uiout;
>> +  struct gdbarch *gdbarch = target_gdbarch ();
>
> Here, we can use b->loc->gdbarch.
>
> Later, to handle the case "catch syscall open" with multiple
> inferiors of different archs, I think we'll end up with a
> location for each inferior, or for each arch, and we'll iterate
> over locations here.  For now, I think we can assume there's only
> one location.

Hm, thanks for this insight.  I was already wondering the best way to
deal with this problem.  I will give it a try later.

> Similarly for other places.
>
>> @@ -15343,7 +15348,7 @@ static VEC (char_ptr) *
>>  catch_syscall_completer (struct cmd_list_element *cmd,
>>                           const char *text, const char *word)
>>  {
>> -  const char **list = get_syscall_names ();
>> +  const char **list = get_syscall_names (target_gdbarch ());
>>    VEC (char_ptr) *retlist
>>      = (list == NULL) ? NULL : complete_on_enum (list, word, word);
>
> This one is handling user input, so should be "get_current_arch ()":
>
> /* Return "current" architecture.  If the target is running, this is
>    the architecture of the selected frame.  Otherwise, the "current"
>    architecture defaults to the target architecture.
>
>    This function should normally be called solely by the command
>    interpreter routines to determine the architecture to execute a
>    command in.  */
> struct gdbarch *
> get_current_arch (void)

Thanks for the review.  I fixed all the issues.  I will concentrate on
the testcase now in order to get this patch in.

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


  reply	other threads:[~2014-11-14 23:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  0:18 [PATCH] Partial fix for PR breakpoints/10737: Make syscall info be per-arch instead of global Sergio Durigan Junior
2014-11-13  0:18 ` [PATCH 1/3] Making syscall information be per-arch, " Sergio Durigan Junior
2014-11-14 15:53   ` Pedro Alves
2014-11-14 23:17     ` Sergio Durigan Junior
2014-11-13  0:18 ` [PATCH 3/3] Testcase Sergio Durigan Junior
2014-11-14 15:54   ` Pedro Alves
2014-11-18  3:30     ` Sergio Durigan Junior
2014-11-18 15:13       ` Pedro Alves
2014-11-18 20:20         ` Sergio Durigan Junior
2014-11-19  9:23           ` PowerPC: "set architecture" -> "Architecture not recognized" ? (was: Re: [PATCH 3/3] Testcase) Pedro Alves
2014-11-19 18:46             ` PowerPC: "set architecture" -> "Architecture not recognized" ? Sergio Durigan Junior
2014-11-20 10:48               ` Pedro Alves
2014-11-20 17:20                 ` Sergio Durigan Junior
2014-11-13  0:18 ` [PATCH 2/3] Adjust calls for setting "catch syscall" information Sergio Durigan Junior
2014-11-14 15:53   ` Pedro Alves
2014-11-14 23:18     ` Sergio Durigan Junior [this message]
2014-11-20 17:34 ` [PATCH] Partial fix for PR breakpoints/10737: Make syscall info be per-arch instead of global 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=87a93t74n5.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gabriel@krisman.be \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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