This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/4] 'catch syscall' feature -- Architecture-independent part


El mar, 04-11-2008 a las 10:56 -0700, Tom Tromey escribiÃ:
> SÃrgio> +      for (i = 0; i < nargs; i++)
> SÃrgio> +        create_syscall_event_catchpoint (tempflag, syscalls_numbers[i],
> SÃrgio> +                                         &catch_syscall_breakpoint_ops);
> 
> This makes a separate catchpoint for each argument to "catch syscall".
> 
> I think it would be more useful to make a single catchpoint.  A single
> catchpoint gives the user a way to set commands, conditions, etc, for
> a whole range of syscalls at once.  It is analogous, I think, to
> having a breakpoint with multiple locations.
> 
> What do you think of that?

I think a better analogy is a breakpoint with a condition. Ideally, I
think you would do that by setting a catchpoint for all syscalls (which
SÃrgio's patch supports) and then put conditions to tell which syscalls
you are interested in. At least for me, it sounds more natural.

Except that there's no way to do that. :-) Perhaps we could create a
convenience function which would return the syscall name?

> It would mean some changes in the logic and some changes in the data
> structure -- but nothing too major.  Usually a catchpoint would have a
> small number of syscalls, so I'd say that just using a linked list
> would be fine.

With my suggestion, the logic would mostly stay the same, with a small
addition to evaluate an expression when the catchpoint triggers, IIUC.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]