[gcjx] Patch: FYI: fix -g parsing

Tom Tromey tromey@redhat.com
Tue Nov 29 17:04:00 GMT 2005


I'm checking this in on the gcjx branch.

This changes command line parsing for '-g' to recognize the other
forms.  This isn't ideal but it helps us a bit with compatibility.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* main.cc (class argument_parser): Recognize -g:none and others.

Index: main.cc
===================================================================
--- main.cc	(revision 107604)
+++ main.cc	(working copy)
@@ -447,8 +447,14 @@
 	  comp->warnings_are_errors = true;
         else if (arg == "-pedantic")
 	  comp->pedantic = true;
-        else if (arg == "-g")
-	  comp->target_debug = true;
+	else if (arg.length () >= 2 && ! strncmp (arg.c_str (), "-g" , 2))
+	  {
+	    // The real form is -g:none, or
+	    // -g:{lines,vars,source}.
+	    // Currently we don't differentiate this in the back end,
+	    // so we just handle all-or-nothing.
+	    comp->target_debug = (arg != "-g:none");
+	  }
         else if (arg == "-d")
 	  output = get_next_arg (it, arg);
 	else if (is_form_of (it, "-bootclasspath"))



More information about the Java-patches mailing list