aboutsummaryrefslogtreecommitdiff
path: root/src/tools/windows/dump_syms/dump_syms.cc
diff options
context:
space:
mode:
authorbryner <bryner@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-08-25 21:14:45 +0000
committerbryner <bryner@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-08-25 21:14:45 +0000
commitcb91a2f879250f2ef5f74321b5d08807247d41a7 (patch)
tree6eebf88acb8342b6c27d9c29df78f92cbb035c4d /src/tools/windows/dump_syms/dump_syms.cc
parentAdding a test html file (diff)
downloadbreakpad-cb91a2f879250f2ef5f74321b5d08807247d41a7.tar.xz
Initial import, which includes the Windows client-side dump_syms tool, and
part of the server-side dump processor. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@4 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/tools/windows/dump_syms/dump_syms.cc')
-rw-r--r--src/tools/windows/dump_syms/dump_syms.cc49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc
new file mode 100644
index 00000000..314e3ae4
--- /dev/null
+++ b/src/tools/windows/dump_syms/dump_syms.cc
@@ -0,0 +1,49 @@
+// Copyright (C) 2006 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Windows utility to dump the line number data from a pdb file to
+// a text-based format that we can use from the minidump processor.
+
+#include <stdio.h>
+#include <string>
+#include "pdb_source_line_writer.h"
+
+using std::wstring;
+
+int main(int argc, char **argv) {
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s <pdb file>", argv[0]);
+ return 1;
+ }
+
+ wchar_t filename[_MAX_PATH];
+ if (mbstowcs_s(NULL, filename, argv[1], _MAX_PATH) == -1) {
+ fprintf(stderr, "invalid multibyte character in %s\n", argv[1]);
+ return 1;
+ }
+
+ google_airbag::PDBSourceLineWriter writer;
+ if (!writer.Open(wstring(filename))) {
+ fprintf(stderr, "Open failed\n");
+ return 1;
+ }
+
+ if (!writer.WriteMap(stdout)) {
+ fprintf(stderr, "WriteMap failed\n");
+ return 1;
+ }
+
+ writer.Close();
+ return 0;
+}