diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/offlineasm/config.rb | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/offlineasm/config.rb')
-rw-r--r-- | Source/JavaScriptCore/offlineasm/config.rb | 25 |
1 files changed, 24 insertions, 1 deletions
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() |