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


Hi Joel,

On Thu, 2008-10-02 at 14:12 -0700, Joel Brobecker wrote:
> > 	* breakpoint.h (enum bptype): Add syscall catchpoint and entry
> > 	breakpoint types.
> > 	(struct breakpoint): Add field 'syscall_number' (used to know
> > 	which syscall triggered the catchpoint) and
> > 	'syscall_to_be_caught' (used to know which syscall we are trying
> > 	to catch).
> 
> I would really like to try to avoid creating a different enum for
> each catchpoint type, if we can.  See for instance how I implemented
> Ada exception catchpoints:
> 
>     http://www.sourceware.org/ml/gdb-patches/2007-01/msg00102.html
> 
> Do you think we could leverage on the "breakpoint_ops" structure
> to implement this feature? Daniel, you know this part of the code
> really well, what do you think?
> 
> Obviously, his feature is a different kind of beast than Ada exception
> catchpoints (which behind the scene is just an elaborated breakpoint).
> So he won't be able to use the bp_breakpoint kind I used. Actually,
> I don't see any bptype kind that could be used, so we'll have to create
> one, but if the name could be generic enough to be used in other
> circumstances.

If I understood correctly, you think it's better to create a "generic"
bptype so that not only "catch syscall" can use it, right? That, or
figure out some other way to use "breakpoint_ops" in order to identify
if the catchpoint is a syscall one. Is it?

The way I see, there's no problem to implement "catch syscall" using
another way. However, and I think you already know that, the "catch
fork", "catch vfork" and "catch exec" are implemented using an entry on
"enum bptype" (and that's specific why I've chosen to do this). Do you
think we should change this, too?

> Similarly, the breakpoint_ops structure might need to be extended 
> a bit, to provide methods that would insert/remove the catchpoint.

I'm not sure if I understood this part correctly. Maybe my GDB-fu isn't
good enought yet :-). I'll take a look at breakpoint_ops to see if I can
understand better what you want.

Thanks for the review, by the way.

Regards,

-- 
Sérgio Durigan Júnior
Linux on Power Toolchain - Software Engineer
Linux Technology Center - LTC
IBM Brazil


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