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: [RFA]: error_silent for use in pending breakpoint support


Jeff Johnston writes:
 > To properly support pending breakpoints, gdb needs to be able to 
 > suppress the "not found" messages at will, but it also needs to 
 > sometimes issue these messages and determine the cause of the error was 
 > a "not found" event.
 > 
 > To handle the problem, I propose two new useful functions in utils.c.  
 > The first is error_silent() which works just like error(), only it does 
 > not issue the error message.  Like error(), it stores the error message 
 > in gdb_lasterr.  This leads to the other new function: 
 > error_last_output() which is used to output the last error message.
 > 
 > This allows the pending breakpoint support to issue the error message 
 > when the user is doing the initial break command and to suppress it when 
 > shared libraries are being loaded or a pending breakpoint is reenabled.
 > 
 > Ok to commit?
 > 
 > 2003-12-18  Jeff Johnston  <jjohnstn@redhat.com>
 > 
 >         * linespec.c (decode_variable, symtab_from_filename):  Call
 >         error_silent with error message instead of throwing an exception
 >         directly.
 >         * defs.h (error_silent, error_last_output): Add prototypes.
 >         * utils.c (error_silent, error_last_output): New functions.
 > 
 > 

The linespec.c change depends on the rest being approved. If that
happens, this would be ok.

elena

 > Index: linespec.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/linespec.c,v
 > retrieving revision 1.53
 > diff -u -p -r1.53 linespec.c
 > --- linespec.c	17 Dec 2003 21:47:47 -0000	1.53
 > +++ linespec.c	18 Dec 2003 21:25:08 -0000
 > @@ -1469,7 +1469,7 @@ symtab_from_filename (char **argptr, cha
 >        if (not_found_ptr)
 >  	{
 >  	  *not_found_ptr = 1;
 > -	  throw_exception (RETURN_ERROR);
 > +	  error_silent ("No source file named %s.", copy);
 >  	}
 >        error ("No source file named %s.", copy);
 >      }
 > @@ -1684,7 +1684,7 @@ decode_variable (char *copy, int funfirs
 >    if (not_found_ptr)
 >      {
 >        *not_found_ptr = 1;
 > -      throw_exception (RETURN_ERROR);
 > +      error_silent ("Function \"%s\" not defined.", copy);
 >      }
 >    
 >    error ("Function \"%s\" not defined.", copy);


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