From 8d54c7509234e9a4918046c12dcb138489f06990 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Wed, 14 Sep 2011 01:02:55 +0000 Subject: Linux/Mac: Add option to omit the CFI section in dump_syms. Review URL: http://breakpad.appspot.com/304001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@835 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/tools/mac/dump_syms/dump_syms_tool.mm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/tools/mac') diff --git a/src/tools/mac/dump_syms/dump_syms_tool.mm b/src/tools/mac/dump_syms/dump_syms_tool.mm index 3f1f03b6..92ebf211 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.mm +++ b/src/tools/mac/dump_syms/dump_syms_tool.mm @@ -1,6 +1,6 @@ // -*- mode: c++ -*- -// Copyright (c) 2006, Google Inc. +// Copyright (c) 2011, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -45,9 +45,10 @@ using google_breakpad::DumpSymbols; using std::vector; struct Options { - Options() : srcPath(), arch() { } + Options() : srcPath(), arch(), cfi(true) { } NSString *srcPath; const NXArchInfo *arch; + bool cfi; }; //============================================================================= @@ -82,17 +83,18 @@ static bool Start(const Options &options) { return false; } } - - return dump_symbols.WriteSymbolFile(std::cout); + + return dump_symbols.WriteSymbolFile(std::cout, options.cfi); } //============================================================================= static void Usage(int argc, const char *argv[]) { fprintf(stderr, "Output a Breakpad symbol file from a Mach-o file.\n"); - fprintf(stderr, "Usage: %s [-a ARCHITECTURE] \n", + fprintf(stderr, "Usage: %s [-a ARCHITECTURE] [-c] \n", argv[0]); fprintf(stderr, "\t-a: Architecture type [default: native, or whatever is\n"); fprintf(stderr, "\t in the file, if it contains only one architecture]\n"); + fprintf(stderr, "\t-c: Do not generate CFI section\n"); fprintf(stderr, "\t-h: Usage\n"); fprintf(stderr, "\t-?: Usage\n"); } @@ -102,7 +104,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { extern int optind; signed char ch; - while ((ch = getopt(argc, (char * const *)argv, "a:h?")) != -1) { + while ((ch = getopt(argc, (char * const *)argv, "a:ch?")) != -1) { switch (ch) { case 'a': { const NXArchInfo *arch_info = NXGetArchInfoFromName(optarg); @@ -114,6 +116,9 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { options->arch = arch_info; break; } + case 'c': + options->cfi = false; + break; case '?': case 'h': Usage(argc, argv); @@ -121,7 +126,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { break; } } - + if ((argc - optind) != 1) { fprintf(stderr, "Must specify Mach-o file\n"); Usage(argc, argv); @@ -137,7 +142,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) { int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; Options options; - bool result; + bool result; SetupOptions(argc, argv, &options); result = Start(options); -- cgit v1.2.1