mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-01 20:24:40 +01:00
Add functionality to read the .gnu_debuglink section and load symbols from a debug ELF file.
Review URL: http://breakpad.appspot.com/126001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@624 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
0dd6c95b3f
commit
56eac4dd7a
3 changed files with 280 additions and 86 deletions
|
|
@ -32,17 +32,21 @@
|
|||
|
||||
#include "common/linux/dump_symbols.h"
|
||||
|
||||
using namespace google_breakpad;
|
||||
using google_breakpad::WriteSymbolFile;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s <binary-with-debugging-info>\n", argv[0]);
|
||||
if (argc < 2 || argc > 3) {
|
||||
fprintf(stderr, "Usage: %s <binary-with-debugging-info> "
|
||||
"[directory-for-debug-file]\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *binary = argv[1];
|
||||
std::string debug_dir;
|
||||
if (argc == 3)
|
||||
debug_dir = argv[2];
|
||||
|
||||
if (!WriteSymbolFile(binary, stdout)) {
|
||||
if (!WriteSymbolFile(binary, debug_dir, stdout)) {
|
||||
fprintf(stderr, "Failed to write symbol file.\n");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue