aboutsummaryrefslogtreecommitdiff
path: root/src/tools/linux
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-09-14 01:02:55 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-09-14 01:02:55 +0000
commit8d54c7509234e9a4918046c12dcb138489f06990 (patch)
tree3da356f2f0b5d4b281cb6394a8064fbee5fdd756 /src/tools/linux
parentRemove javascript_engine GYP variable. (diff)
downloadbreakpad-8d54c7509234e9a4918046c12dcb138489f06990.tar.xz
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
Diffstat (limited to 'src/tools/linux')
-rw-r--r--src/tools/linux/dump_syms/dump_syms.cc42
1 files changed, 31 insertions, 11 deletions
diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc
index f4c05cfc..adac216c 100644
--- a/src/tools/linux/dump_syms/dump_syms.cc
+++ b/src/tools/linux/dump_syms/dump_syms.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010, Google Inc.
+// Copyright (c) 2011, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,27 +27,47 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <iostream>
#include <stdio.h>
+
+#include <cstring>
+#include <iostream>
#include <string>
#include "common/linux/dump_symbols.h"
using google_breakpad::WriteSymbolFile;
+int usage(const char* self) {
+ fprintf(stderr, "Usage: %s [OPTION] <binary-with-debugging-info> "
+ "[directory-for-debug-file]\n\n", self);
+ fprintf(stderr, "Options:\n");
+ fprintf(stderr, " -c Do not generate CFI section\n");
+ return 1;
+}
+
int main(int argc, char **argv) {
- if (argc < 2 || argc > 3) {
- fprintf(stderr, "Usage: %s <binary-with-debugging-info> "
- "[directory-for-debug-file]\n", argv[0]);
- return 1;
- }
+ if (argc < 2 || argc > 4)
+ return usage(argv[0]);
- const char *binary = argv[1];
+ bool cfi = true;
+ if (strcmp("-c", argv[1]) == 0)
+ cfi = false;
+ if (!cfi && argc == 2)
+ return usage(argv[0]);
+
+ const char *binary;
std::string debug_dir;
- if (argc == 3)
- debug_dir = argv[2];
+ if (cfi) {
+ binary = argv[1];
+ if (argc == 3)
+ debug_dir = argv[2];
+ } else {
+ binary = argv[2];
+ if (argc == 4)
+ debug_dir = argv[3];
+ }
- if (!WriteSymbolFile(binary, debug_dir, std::cout)) {
+ if (!WriteSymbolFile(binary, debug_dir, cfi, std::cout)) {
fprintf(stderr, "Failed to write symbol file.\n");
return 1;
}