This is the mail archive of the gdb-patches@sources.redhat.com 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] -stack-info-frames


 > >  > "No arguments required" doesn't make much sense as an error message; it
 > >  > suggests that no arguments are necessary, but not that any arguments
 > >  > are invalid.  But I see there are two uses of it already, and none of
 > >  > any other format for functions which take no arguements.  So the code
 > >  > parts of the patch are belatedly OK...
 > > 
 > > Where possible, I just copy what is already there.
 > 
 > That is not always a good idea.  Sometimes it is better to modify old
 > code/docs, instead of proliferating past blunders in the name of
 > consistency.

Currently:

(gdb)
-stack-info-frame 4
&"mi_cmd_stack_info_frame: No arguments required\n"
^error,msg="mi_cmd_stack_info_frame: No arguments required"
(gdb) 

(gdb) 
-stack-select-frame
&"mi_cmd_stack_select_frame: Usage: FRAME_SPEC\n"
^error,msg="mi_cmd_stack_select_frame: Usage: FRAME_SPEC"
(gdb) 


The other thing I find inappropriate about these messages is that they
print out the name of the procedure which is not of immediate interest.

How about changing the format (for all MI commands) to

-stack-info-frame 4
&"Usage: -stack-info-frame\n"
^error,msg="Usage: -stack-info-frame"
(gdb) 

(gdb) 
-stack-select-frame
&"Usage: -stack-select-frame FRAME_SPEC\n"
^error,msg="Usage: -stack-select-frame FRAME_SPEC"
(gdb) 

etc.

They should only occur when a developer is writing a frontend, not when it is
being used.  The procedure name is only of interest to someone writing MI code
For that person it should be quite easy to find the relevant code and, even if
it was not, it should only be printed if a debug flag is set.

Nick


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