Pedro Alves wrote: > On Friday 11 February 2011 21:17:08, Tom Tromey wrote: >>>>>>> "Michael" == Michael Snyder writes: >> Pedro> Isn't there a property of the command we could check >> Pedro> instead of hardcoding specific command names? >> >> Michael> I'm open to suggestions. The only property I can think of is that >> Michael> there is no corresponding entry in "setlist". I could search >> Michael> setlist every time... >> >> You could stick a new flag on the command object. > > Yeah. You may even be able to set the flag from within > the add_setshow_... functions and friends. The flag could > mean "this show command shows something that is settable > in some way" (or the reverse). > >> Or there is cmd_cfunc_eq, which is used for a similar purpose in some >> places. I don't think this is super, but OTOH it isn't any worse than >> existing code. > > I think we shouldn't allow ourselves to broadcast bad design > when it's easy not to. The function Michael touched is within > gdb/cli/cli-setshow.c. I'd prefer to keep this and the other > core command files clean of specific knowledge of > any specific commands their clients register. OK, here's a new implementation in which I use the "class" field to flag the offending show commands. Better?