From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/JavaScriptCore/offlineasm/config.rb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'Source/JavaScriptCore/offlineasm/config.rb') diff --git a/Source/JavaScriptCore/offlineasm/config.rb b/Source/JavaScriptCore/offlineasm/config.rb index 4c86eeceb..88a0cf5e8 100644 --- a/Source/JavaScriptCore/offlineasm/config.rb +++ b/Source/JavaScriptCore/offlineasm/config.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Apple Inc. All rights reserved. +# Copyright (C) 2012, 2016 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -55,3 +55,26 @@ $enableCodeOriginComments = true # ... # $enableInstrAnnotations = false + +# 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. +# +def shouldEnableDebugAnnotations() + if ENV['GCC_VERSION'] =~ /\.clang\./ and ENV['DT_TOOLCHAIN_DIR'] =~ /Xcode.app/ + clangVersionOut = %x`xcrun clang --version` + if ($? == 0) + # clang version 800.0.12 or higher is required for debug annotations + versionMatch = /clang-(\d{3,}).(\d{1,3}).(\d{1,3})/.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 + + false +end + +$enableDebugAnnotations = shouldEnableDebugAnnotations() -- cgit v1.2.1