Refactor source line resolver, add interface in supplier and resolver.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@711 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
SiyangXie@gmail.com 2010-10-07 20:31:36 +00:00
parent d35f113d02
commit 5b117cf53a
24 changed files with 1021 additions and 418 deletions

View file

@ -87,15 +87,18 @@ class StackwalkerARMFixture {
// By default, none of the modules have symbol info; call
// SetModuleSymbols to override this.
EXPECT_CALL(supplier, GetSymbolFile(_, _, _, _))
EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _))
.WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
}
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
void SetModuleSymbols(MockCodeModule *module, const string &info) {
EXPECT_CALL(supplier, GetSymbolFile(module, &system_info, _, _))
.WillRepeatedly(DoAll(SetArgumentPointee<3>(info),
unsigned int buffer_size = info.size() + 1;
char *buffer = reinterpret_cast<char*>(operator new(buffer_size));
strcpy(buffer, info.c_str());
EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _))
.WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
Return(MockSymbolSupplier::FOUND)));
}