mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-06 06:28:15 +01:00
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
This commit is contained in:
parent
3c27dcc1b6
commit
e219ba182e
3 changed files with 10 additions and 20 deletions
|
|
@ -616,7 +616,7 @@ class MmapWrapper {
|
|||
namespace google_breakpad {
|
||||
|
||||
bool DumpSymbols::WriteSymbolFile(const std::string &obj_file,
|
||||
const std::string &symbol_file) {
|
||||
int sym_fd) {
|
||||
int obj_fd = open(obj_file.c_str(), O_RDONLY);
|
||||
if (obj_fd < 0)
|
||||
return false;
|
||||
|
|
@ -636,16 +636,10 @@ bool DumpSymbols::WriteSymbolFile(const std::string &obj_file,
|
|||
if (!LoadSymbols(elf_header, &symbols))
|
||||
return false;
|
||||
// Write to symbol file.
|
||||
int sym_fd = open(symbol_file.c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0666);
|
||||
if (sym_fd < 0)
|
||||
return false;
|
||||
FDWrapper sym_fd_wrapper(sym_fd);
|
||||
if (WriteModuleInfo(sym_fd, elf_header->e_machine, obj_file) &&
|
||||
DumpStabSymbols(sym_fd, symbols))
|
||||
return true;
|
||||
|
||||
// Remove the symbol file if failed to write the symbols.
|
||||
unlink(symbol_file.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue