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] Debug Methods in GDB Python


I am assuming you have not prescribed anything here, but are only
presenting pros of doing things in a certain way.  I am also assuming
that you are waiting for others to chime in with their views.

On Fri, Jan 3, 2014 at 10:52 AM, Doug Evans <dje@google.com> wrote:
> I like having the object gdb calls to do the lookup return another
> object that gdb calls to implement the functionality.
>
> 1) It supports more flexibility in how the user can organize things
> (e.g., one "lookup" object can handle different "worker" objects).

For doing such things, I had a design like this in mind: We setup up a
hierarchy of DebugMethod classes. The base class only does type and
method matching. The derived concrete classes extend the base class by
adding arg matching and the method invocation. This way, 'lookup' and
'worker' functionalities are separated code wise but still
encapsulated in a single DebugMethod object.

> 2) The worker object can obtain state at runtime (it is constructed at
> lookup time).

This can be done on a single object by providing a setter?


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