Blame SOURCES/0001-Always-generate-bytecode-debuginfo.patch

7d4c9d
From e7ff390ef777bd818ccc6e6f8f3a56f36020abfe Mon Sep 17 00:00:00 2001
7d4c9d
From: Mat Booth <mat.booth@gmail.com>
7d4c9d
Date: Wed, 15 Sep 2021 10:21:53 +0100
7d4c9d
Subject: [PATCH 1/2] Always generate bytecode debuginfo
7d4c9d
7d4c9d
When ecj is used to build RPMs
7d4c9d
---
7d4c9d
 .../jdt/internal/compiler/batch/Main.java     | 23 +++++++++++++++++++
7d4c9d
 1 file changed, 23 insertions(+)
7d4c9d
7d4c9d
diff --git a/org/eclipse/jdt/internal/compiler/batch/Main.java b/org/eclipse/jdt/internal/compiler/batch/Main.java
7d4c9d
index f77372d..73a0d24 100644
7d4c9d
--- a/org/eclipse/jdt/internal/compiler/batch/Main.java
7d4c9d
+++ b/org/eclipse/jdt/internal/compiler/batch/Main.java
7d4c9d
@@ -3109,6 +3109,29 @@ public void configure(String[] argv) {
7d4c9d
 		this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
7d4c9d
 	}
7d4c9d
 
7d4c9d
+	{
7d4c9d
+		// If we're building an RPM, force full debugging info to
7d4c9d
+		// be generated, no matter what options have been passed
7d4c9d
+		// by Ant.  This is something of a kludge, but it is far
7d4c9d
+		// better than the alternative, which is having class
7d4c9d
+		// files with debug info mysteriously missing.
7d4c9d
+
7d4c9d
+		String RpmPackageName = System.getenv("RPM_PACKAGE_NAME");
7d4c9d
+		String RpmArch = System.getenv("RPM_ARCH");
7d4c9d
+		String RpmBuildRoot = System.getenv("RPM_BUILD_ROOT");
7d4c9d
+		if (RpmPackageName != null && RpmArch != null && RpmBuildRoot != null) {
7d4c9d
+			this.options.put(
7d4c9d
+					CompilerOptions.OPTION_LocalVariableAttribute,
7d4c9d
+					CompilerOptions.GENERATE);
7d4c9d
+			this.options.put(
7d4c9d
+					CompilerOptions.OPTION_LineNumberAttribute,
7d4c9d
+					CompilerOptions.GENERATE);
7d4c9d
+			this.options.put(
7d4c9d
+					CompilerOptions.OPTION_SourceFileAttribute,
7d4c9d
+					CompilerOptions.GENERATE);
7d4c9d
+		}
7d4c9d
+	}
7d4c9d
+
7d4c9d
 	this.logger.logCommandLineArguments(newCommandLineArgs);
7d4c9d
 	this.logger.logOptions(this.options);
7d4c9d
 
7d4c9d
-- 
7d4c9d
2.31.1
7d4c9d