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: cleanup mi error message handling


On Tue, Mar 25, 2008 at 10:04:01AM +1200, Nick Roberts wrote:
> I think sometimes errors are just needed when debugging the frontend, e.g.,
> 
>   -thread-select
>   ^error,msg="mi_cmd_thread_select: USAGE: threadnum."
>   (gdb) 
> 
> where one error message is sufficient.  Here I think Gdb is trying to mimic
> perror by giving the name of the C procedure, but I think it's not desirable as
> this gets printed due to a frontend error, not a Gdb error.  So I would like to
> see:
> 
>   -thread-select
>   ^error,msg="USAGE: threadnum."
>   (gdb) 

I agree.

> At other times duplicated error messages are desirable, e.g.,
> 
>   -exec-continue 
>   ^running
>   (gdb) 
>   &"The program is not being run.\n"
>   ^error,msg="The program is not being run."
> 
> because the first goes to the console for the user to see, the second to
> the frontend to be handled as appropriate.

Could you explain why the duplication here is good?  It seems to me
that if the front end wants to display this error to the user in the
console, it can do so anyway, but it shouldn't have to.  Maybe this
requires a version bump, I don't know.

In Eclipse, this duplication leads to a bunch of error messages that
pop up in the console pane which don't come from anything the user
did.  It's very confusing.

-- 
Daniel Jacobowitz
CodeSourcery


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