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


On Tue, Jan 7, 2014 at 4:48 PM, Siva Chandra <sivachandra@google.com> wrote:
> 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.

For the most part, correct.
Though I haven't seen a compelling argument to be different than how
pretty-printers do things.

> 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?

But if this single object isn't constructed at lookup time this would
be modifying, essentially, global state.
[Maybe I'm misunderstanding.]


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