This is the mail archive of the insight@sources.redhat.com mailing list for the Insight 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: error ("") and -Wprintf


> I'm not sure what the code should be doing.  But perhaphs
>> throw_exception() should be called?
> 
> 
> That's pretty funny. I don't see why we just didn't use "error (msg);" to
> begin with. So what if we get it twice on windows (but only if invoked via
> a shell).
> 
> In any case, now that throw_exception is here, I don't see why we
> couldn't/wouldn't use that. (And you don't either.:-)

I've checked in the attached.

near enough I hope,
Andrew

2002-04-17  Andrew Cagney  <cagney@redhat.com>

	* generic/gdbtk.c (gdbtk_init): Use error or throw_exception to
	report an error.

Index: generic/gdbtk.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk/generic/gdbtk.c,v
retrieving revision 1.18
diff -u -r1.18 gdbtk.c
--- gdbtk.c	2002/03/25 16:45:52	1.18
+++ gdbtk.c	2002/04/17 18:07:19
@@ -635,12 +635,16 @@
 	msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY);
 
 #ifdef _WIN32
+	/* On windows, display the error using a pop-up message box.
+           If GDB wasn't started from the DOS prompt, the user won't
+           get to see the failure reason.  */
 	MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
+	throw_exception (RETURN_ERROR);
 #else
-	fprintf (stderr,msg);
+	/* FIXME: cagney/2002-04-17: Wonder what the lifetime of
+           ``msg'' is - does it need a cleanup?  */
+	error (msg);
 #endif
-
-	error ("");
       }
   }
 

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