diff options
author | luly81 <luly81@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-05-02 19:13:09 +0000 |
---|---|---|
committer | luly81 <luly81@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-05-02 19:13:09 +0000 |
commit | e219ba182e00794dee6046b01df467e030ca6390 (patch) | |
tree | d338b5898e5c3629910558113e9e20c4402d4e53 /src/tools | |
parent | Minidump without context crashes the processor (#153). r=bryner (diff) | |
download | breakpad-e219ba182e00794dee6046b01df467e030ca6390.tar.xz |
Merge Ted's patch for writing symbols to stdout for linux.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@149 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/linux/dump_syms/dump_syms.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index 3eca3745..e7eb0a2d 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -28,29 +28,25 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <string> +#include <cstdio> #include "common/linux/dump_symbols.h" using namespace google_breakpad; int main(int argc, char **argv) { - if (argc < 2 || argc > 3) { - fprintf(stderr, - "Usage: %s <binary-with-stab-symbol> [output-symbol-file]\n", - argv[0]); + if (argc != 2) { + fprintf(stderr, "Usage: %s <binary-with-stab-symbol>\n", argv[0]); return 1; } const char *binary = argv[1]; - std::string symbol_file(binary); - symbol_file += ".sym"; - if (argc == 3) - symbol_file = argv[2]; DumpSymbols dumper; - if (dumper.WriteSymbolFile(binary, symbol_file)) - printf("Symbol file successfully written: %s\n", symbol_file.c_str()); - else - printf("Failed to write symbol file.\n"); + if (!dumper.WriteSymbolFile(binary, fileno(stdout))) { + fprintf(stderr, "Failed to write symbol file.\n"); + return 1; + } + return 0; } |