aboutsummaryrefslogtreecommitdiff
path: root/src/common/windows/pdb_source_line_writer.cc
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-11-15 22:24:42 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-11-15 22:24:42 +0000
commit73cd14b4af906e77f3d8b019962fb9979ff12620 (patch)
treed24a12393c2f631c22db5b7e76e735b218025890 /src/common/windows/pdb_source_line_writer.cc
parentLimit use of default namespace in tests and utility programs (#71). r=bryner (diff)
downloadbreakpad-73cd14b4af906e77f3d8b019962fb9979ff12620.tar.xz
Airbag client libraries should compile under MSVC .NET 2003/7.1 (#64).
r=bryner http://groups.google.com/group/airbag-dev/browse_thread/thread/b838faeb50f71818 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@64 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/windows/pdb_source_line_writer.cc')
-rw-r--r--src/common/windows/pdb_source_line_writer.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc
index 58588089..c6c1d5c4 100644
--- a/src/common/windows/pdb_source_line_writer.cc
+++ b/src/common/windows/pdb_source_line_writer.cc
@@ -32,6 +32,8 @@
#include <dia2.h>
#include <stdio.h>
+#include "common/windows/string_utils-inl.h"
+
#include "common/windows/pdb_source_line_writer.h"
#include "common/windows/guid_string.h"
@@ -161,7 +163,7 @@ bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function) {
stack_param_size = GetFunctionStackParamSize(function);
}
- fprintf(output_, "FUNC %x %llx %x %ws\n",
+ fprintf(output_, "FUNC %x %" WIN_STRING_FORMAT_LL "x %x %ws\n",
rva, length, stack_param_size, name);
CComPtr<IDiaEnumLineNumbers> lines;
@@ -461,6 +463,11 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
// If a name comes from get_name because no undecorated form existed,
// it's already formatted properly to be used as output. Don't do any
// additional processing.
+ //
+ // MSVC7's DIA seems to not undecorate names in as many cases as MSVC8's.
+ // This will result in calling get_name for some C++ symbols, so
+ // all of the parameter and return type information may not be included in
+ // the name string.
} else {
// C++ uses a bogus "void" argument for functions and methods that don't
// take any parameters. Take it out of the undecorated name because it's
@@ -472,7 +479,8 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
if (length >= replace_length) {
wchar_t *name_end = *name + length - replace_length;
if (wcscmp(name_end, replace_string) == 0) {
- wcscpy_s(name_end, replace_length, replacement_string);
+ WindowsStringUtils::safe_wcscpy(name_end, replace_length,
+ replacement_string);
length = wcslen(*name);
}
}
@@ -501,13 +509,14 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
// Undecorate the name by moving it one character to the left in its
// buffer, and terminating it where the last '@' had been.
- wcsncpy_s(*name, length, *name + 1, last_at - *name - 1);
- } else if (*name[0] == '_') {
+ WindowsStringUtils::safe_wcsncpy(*name, length,
+ *name + 1, last_at - *name - 1);
+ } else if (*name[0] == '_') {
// This symbol's name is encoded according to the cdecl rules. The
// name doesn't end in a '@' character followed by a decimal positive
// integer, so it's not a stdcall name. Strip off the leading
// underscore.
- wcsncpy_s(*name, length, *name + 1, length - 1);
+ WindowsStringUtils::safe_wcsncpy(*name, length, *name + 1, length);
}
}
}