This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

committed: jcf-dump support for SourceDebugExtension


I checked this into mainline.
JSR 45 defines a new "SourceDebugExtension" attribute
(which Kawa implements).
This patch adds supports to this attribute.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/
2005-03-01  Per Bothner  <per@bothner.com>

	* jcf-reader.c (get_attribute): Handle SourceDebugExtension (JSR 45)
	if HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE is defined.
	* jcf-dump.c (HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE): Print contents.

Index: jcf-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-dump.c,v
retrieving revision 1.64
diff -u -p -r1.64 jcf-dump.c
--- jcf-dump.c	25 Nov 2004 11:13:38 -0000	1.64
+++ jcf-dump.c	1 Mar 2005 16:57:39 -0000
@@ -342,6 +342,13 @@ utf8_equal_string (JCF *jcf, int index, 
 	fputc ('\n', out);						    \
 }
 
+#define HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE(LENGTH) \
+{ int i, n = (LENGTH), c = 0;					  \
+  COMMON_HANDLE_ATTRIBUTE(jcf, attribute_name, attribute_length); \
+  fputc ('\n', out); \
+  for (i = 0;  i < n;  i++) { c = JCF_readu(jcf); fputc(c, out); } \
+  if (c != '\r' && c != '\n') fputc('\n', out); }
+
 #define PROCESS_OTHER_ATTRIBUTE(JCF, INDEX, LENGTH) \
 { COMMON_HANDLE_ATTRIBUTE(JCF, INDEX, LENGTH); \
   fputc ('\n', out); JCF_SKIP (JCF, LENGTH); }
Index: jcf-reader.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-reader.c,v
retrieving revision 1.23
diff -u -p -r1.23 jcf-reader.c
--- jcf-reader.c	24 Feb 2003 02:14:49 -0000	1.23
+++ jcf-reader.c	1 Mar 2005 16:57:39 -0000
@@ -228,6 +228,13 @@ get_attribute (JCF *jcf)
     }
   else
 #endif
+#ifdef HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE
+  if (MATCH_ATTRIBUTE ("SourceDebugExtension")) /* JSR 45 */
+    {
+      HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE (attribute_length);
+    }
+  else
+#endif
     {
 #ifdef PROCESS_OTHER_ATTRIBUTE
       PROCESS_OTHER_ATTRIBUTE(jcf, attribute_name, attribute_length);

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