public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* [cgen] suggestion: improve error message
@ 2005-10-22  0:08 DJ Delorie
  2005-10-22  2:15 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: DJ Delorie @ 2005-10-22  0:08 UTC (permalink / raw)
  To: binutils, cgen


If you use the wrong operand in an insn, you get a vague "assert:
indx" error.  This replaces it with a (hopefully) more instructive
message, hopefully allowing you to *find* the error.

	* operand.scm (-anyof-merge-syntax): Print a more useful error
	message.

Index: operand.scm
===================================================================
RCS file: /cvs/src/src/cgen/operand.scm,v
retrieving revision 1.11
diff -p -U3 -r1.11 operand.scm
--- operand.scm	29 Jul 2005 18:51:24 -0000	1.11
+++ operand.scm	22 Oct 2005 00:04:39 -0000
@@ -1120,7 +1120,9 @@
 			(if (anyof-operand? e)
 			    (let* ((name (obj:name e))
 				   (indx (element-lookup-index name value-names 0)))
-			      (assert indx)
+			      (if (not indx)
+				(error "Name " name " not one of " values)
+				)
 			      (-anyof-syntax (list-ref values indx)))
 			    e))
 		      syntax-elements)))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cgen] suggestion: improve error message
  2005-10-22  0:08 [cgen] suggestion: improve error message DJ Delorie
@ 2005-10-22  2:15 ` Frank Ch. Eigler
  2005-10-24 22:57   ` DJ Delorie
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2005-10-22  2:15 UTC (permalink / raw)
  To: DJ Delorie; +Cc: cgen

Hi -

dj wrote:
> If you use the wrong operand in an insn, you get a vague "assert:
> indx" error.  This replaces it with a (hopefully) more instructive
> message, hopefully allowing you to *find* the error.
> 
> 	* operand.scm (-anyof-merge-syntax): Print a more useful error
> 	message.
> [...]

Go ahead and commit, you radical.
Finding errors.
Humbug.

- FChE

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cgen] suggestion: improve error message
  2005-10-22  2:15 ` Frank Ch. Eigler
@ 2005-10-24 22:57   ` DJ Delorie
  0 siblings, 0 replies; 3+ messages in thread
From: DJ Delorie @ 2005-10-24 22:57 UTC (permalink / raw)
  To: fche; +Cc: cgen


> > 	* operand.scm (-anyof-merge-syntax): Print a more useful error
> > 	message.
> > [...]
> 
> Go ahead and commit, you radical.

Done.  Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-24 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-22  0:08 [cgen] suggestion: improve error message DJ Delorie
2005-10-22  2:15 ` Frank Ch. Eigler
2005-10-24 22:57   ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).