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] Add support for `user-defined` python commands


On Wed, May 18, 2011 at 7:54 PM, Scott Goldman <scottjg@vmware.com> wrote:
> Hi Doug.
>
>> I think there's a problem to solve here (finding one's way in the
>> myriad of available commands), but I'm not sure this is the way to go.
>> [Maybe it is though.]
>
> I think you made some interesting points. From what I make of your email, the question you've proposed is something like "should we even have user-defined category at all?". I'm sure there will be a lot of opinions on this. UI debates are tougher for me than technical ones :)
>
> I can see the discussion branching in two directions:
> 1) Yes, we should have a user-defined category, but we also want to either: subdivide the user-defined commands into prefix categories, or have additional custom categories.
>
> In this case, I think it follows that my patch should be applied pretty much as-is (pending any necessary refactoring as requested). If legacy gdb macros can enter the `user-defined` category, I don't see why new python gdb macros should be excluded. Further patches can add the support for additional custom categories, and this patch would be the first step: allowing python macros to be classified as `user-defined` at all.
>
> 2) No, we should not have a user-defined category, and it should be replaced by custom categories or prefix categories.
>
> In this case, my patch is pretty irrelevant.

I'm not sure it's either/or.
One *could* have both python "user-defined" commands and the ability
to add new command classes.
I don't think I would ever use "user-defined" except as a throwaway
for when I couldn't think of something better. :-)
But your patch could *still* be useful enough to add.

I think the absence of user-defined python commands is either an
oversight or just left out pending an actual need.
I only bring this up because after reading your patch, it made me
wonder if there isn't a more general problem here.
[At a former employer I think we did add user-specifiable command
classes - we added a lot of commands: gdb macros, lots of new
simulator commands, and commands from dlopen'd libraries.  The need
for organizing them was clear.]


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