From 12cb400fd25863154c6d4d26427642cac0e52da1 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 4 Aug 2020 11:01:02 -0700 Subject: [PATCH] [llvm-symbolizer] Add compatibility aliases for --inlining={true,false} D83530 removed --inlining={true,false} which were used by old asan_symbolize.py script. Add compatibility aliases so that old asan_symbolize.py and sanitizer binaries can work with new llvm-symbolizer. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D85228 --- llvm/test/tools/llvm-symbolizer/output-style-inlined.test | 4 ++++ llvm/test/tools/llvm-symbolizer/sym.test | 4 ++++ llvm/tools/llvm-symbolizer/Opts.td | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/llvm/test/tools/llvm-symbolizer/output-style-inlined.test b/llvm/test/tools/llvm-symbolizer/output-style-inlined.test index daa9584..7e9f7e7 100644 --- a/llvm/test/tools/llvm-symbolizer/output-style-inlined.test +++ b/llvm/test/tools/llvm-symbolizer/output-style-inlined.test @@ -6,6 +6,10 @@ the option is not specified. RUN: llvm-symbolizer --no-inlines -e %p/Inputs/addr.exe 0x40054d \ RUN: | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo +## Before 2020-08-04, asan_symbolize.py passed --inlining=false if 'symbolize_inline_frames' +## is set to false. Support this compatibility alias for a while. +RUN: llvm-symbolizer --inlining=false -e %p/Inputs/addr.exe 0x40054d \ +RUN: | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo RUN: llvm-symbolizer --output-style=LLVM --no-inlines -e %p/Inputs/addr.exe 0x40054d \ RUN: | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo diff --git a/llvm/test/tools/llvm-symbolizer/sym.test b/llvm/test/tools/llvm-symbolizer/sym.test index 20377eb..73097b2 100644 --- a/llvm/test/tools/llvm-symbolizer/sym.test +++ b/llvm/test/tools/llvm-symbolizer/sym.test @@ -26,6 +26,10 @@ RUN: llvm-symbolizer -inlines -print-address -pretty-print -obj=%p/Inputs/addr.e RUN: llvm-symbolizer -inlines -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s RUN: llvm-symbolizer -i -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s RUN: llvm-symbolizer -i -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s +## Before 2020-08-04, asan_symbolize.py passed --inlining=true. +## Support this compatibility alias for a while. +RUN: llvm-symbolizer --inlining=true --print-address -p --obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s + RUN: echo "0x1" > %t.input RUN: llvm-symbolizer -obj=%p/Inputs/zero < %t.input | FileCheck -check-prefix="ZERO" %s diff --git a/llvm/tools/llvm-symbolizer/Opts.td b/llvm/tools/llvm-symbolizer/Opts.td index d83b796..66b3892 100644 --- a/llvm/tools/llvm-symbolizer/Opts.td +++ b/llvm/tools/llvm-symbolizer/Opts.td @@ -58,3 +58,7 @@ def : Flag<["-"], "i">, Alias, HelpText<"Alias for --inlines">; def : F<"inlining", "Alias for --inlines">, Alias; def : Flag<["-"], "p">, Alias, HelpText<"Alias for --pretty-print">; def : Flag<["-"], "s">, Alias, HelpText<"Alias for --basenames">; + +// Compatibility aliases for old asan_symbolize.py and sanitizer binaries (before 2020-08). +def : Flag<["--"], "inlining=true">, Alias, HelpText<"Alias for --inlines">; +def : Flag<["--"], "inlining=false">, Alias, HelpText<"Alias for --no-inlines">; -- 2.7.4