Title: [200447] trunk/Source/_javascript_Core
Revision
200447
Author
[email protected]
Date
2016-05-04 18:06:59 -0700 (Wed, 04 May 2016)

Log Message

Enable Dwarf2 debug information in offline assembler for clang compiler
https://bugs.webkit.org/show_bug.cgi?id=157364.

Reviewed by Mark Lam.

Added a new function shouldEnableDebugAnnotations() that determines if
we are using clang and a new enough version to support the debug annotations.

* offlineasm/config.rb:
(shouldEnableDebugAnnotations): Added.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (200446 => 200447)


--- trunk/Source/_javascript_Core/ChangeLog	2016-05-05 00:55:57 UTC (rev 200446)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-05-05 01:06:59 UTC (rev 200447)
@@ -1,3 +1,16 @@
+2016-05-04  Michael Saboff  <[email protected]>
+
+        Enable Dwarf2 debug information in offline assembler for clang compiler
+        https://bugs.webkit.org/show_bug.cgi?id=157364.
+
+        Reviewed by Mark Lam.
+
+        Added a new function shouldEnableDebugAnnotations() that determines if
+        we are using clang and a new enough version to support the debug annotations.
+
+        * offlineasm/config.rb:
+        (shouldEnableDebugAnnotations): Added.
+
 2016-05-04  Keith Miller  <[email protected]>
 
         Unreviewed, fix test for new ArrayIteratorPrototype.next() error message.

Modified: trunk/Source/_javascript_Core/offlineasm/config.rb (200446 => 200447)


--- trunk/Source/_javascript_Core/offlineasm/config.rb	2016-05-05 00:55:57 UTC (rev 200446)
+++ trunk/Source/_javascript_Core/offlineasm/config.rb	2016-05-05 01:06:59 UTC (rev 200447)
@@ -59,4 +59,25 @@
 # Turns on generation of DWARF2 debug annotions for file and line numbers.
 # Allows for source level debuging of the original .asm files in a debugger.
 #
-$enableDebugAnnotations = false
+def shouldEnableDebugAnnotations()
+    if ENV['GCC_VERSION'] =~ /\.clang\./ and ENV['TOOLCHAIN_DIR'] != ''
+        clangExecutable = ENV['TOOLCHAIN_DIR'] + '/usr/bin/clang'
+        if File.executable?(clangExecutable)
+            clangVersionOut = %x`#{clangExecutable} --version`
+            if ($? == 0)
+                # clang version 800.0.12 or higher is required for debug annotations
+                versionMatch = /clang-(\d+).(\d+).(\d+)/.match(clangVersionOut)
+                if versionMatch.length >= 4
+                    totalVersion = versionMatch[1].to_i * 1000000 + versionMatch[2].to_i * 1000 + versionMatch[3].to_i
+                    if totalVersion >= 800000012
+                        return true
+                    end
+                end
+            end
+        end
+    end
+
+    false
+end
+
+$enableDebugAnnotations = shouldEnableDebugAnnotations()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to