Skip to content

Commit

Permalink
mac: conditionally generate inlines
Browse files Browse the repository at this point in the history
Change-Id: I35d7a5e50537bd6f20bcb5a91d386ffee9325b18
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3098093
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
  • Loading branch information
Joshua Peraza committed Aug 16, 2021
1 parent bc7ddae commit 3c70e01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/tools/mac/dump_syms/dump_syms_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ 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;
const NXArchInfo *arch;
bool header_only;
bool cfi;
bool handle_inter_cu_refs;
bool handle_inlines;
};

static bool StackFrameEntryComparator(const Module::StackFrameEntry* a,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3c70e01

Please sign in to comment.