From 3c70e0145e5c9372ba290885a0c7a342e5ef5a6d Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 16 Aug 2021 11:51:57 -0700 Subject: [PATCH] mac: conditionally generate inlines Change-Id: I35d7a5e50537bd6f20bcb5a91d386ffee9325b18 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3098093 Reviewed-by: Joshua Peraza --- src/tools/mac/dump_syms/dump_syms_tool.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index df2f49f10..fcbb91695 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -52,7 +52,7 @@ using std::vector; struct Options { Options() : srcPath(), dsymPath(), arch(), header_only(false), - cfi(true), handle_inter_cu_refs(true) {} + cfi(true), handle_inter_cu_refs(true), handle_inlines(false) {} string srcPath; string dsymPath; @@ -60,6 +60,7 @@ struct Options { bool header_only; bool cfi; bool handle_inter_cu_refs; + bool handle_inlines; }; static bool StackFrameEntryComparator(const Module::StackFrameEntry* a, @@ -108,7 +109,8 @@ static void CopyCFIDataBetweenModules(Module* to_module, static bool Start(const Options& options) { SymbolData symbol_data = - INLINES | (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; + (options.handle_inlines ? INLINES : NO_DATA) | + (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs); // For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the @@ -202,6 +204,7 @@ static void Usage(int argc, const char *argv[]) { "Mach-o file\n"); fprintf(stderr, "\t-c: Do not generate CFI section\n"); fprintf(stderr, "\t-r: Do not handle inter-compilation unit references\n"); + fprintf(stderr, "\t-d: Generate INLINE and INLINE_ORIGIN records\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); } @@ -236,6 +239,8 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { case 'r': options->handle_inter_cu_refs = false; break; + case 'd': + options->handle_inlines = true; case '?': case 'h': Usage(argc, argv);