aboutsummaryrefslogtreecommitdiff
path: root/src/tools/linux
diff options
context:
space:
mode:
authorNelson Billing <nbilling@google.com>2020-02-19 15:32:08 -0800
committerNelson Billing <nbilling@google.com>2020-02-20 16:50:31 +0000
commitbbad9f255d76cf7dcd11d15800e508d9849826af (patch)
treee3697362db759c72f9529931f733e1e6058ee790 /src/tools/linux
parentUpdate Xcode project files to fix build errors. (diff)
downloadbreakpad-bbad9f255d76cf7dcd11d15800e508d9849826af.tar.xz
Add optional new symbol upload API to sym_upload.
Change-Id: I6a49e9f4a699fa6f5f8e9f0fc86afb4cb342a442 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1422400 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'src/tools/linux')
-rw-r--r--src/tools/linux/symupload/sym_upload.cc41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/tools/linux/symupload/sym_upload.cc b/src/tools/linux/symupload/sym_upload.cc
index 9eeb2d44..cb5321a7 100644
--- a/src/tools/linux/symupload/sym_upload.cc
+++ b/src/tools/linux/symupload/sym_upload.cc
@@ -41,25 +41,43 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "common/linux/symbol_upload.h"
+using google_breakpad::sym_upload::UploadProtocol;
using google_breakpad::sym_upload::Options;
//=============================================================================
static void
Usage(int argc, const char *argv[]) {
fprintf(stderr, "Submit symbol information.\n");
- fprintf(stderr, "Usage: %s [options...] <symbols> <upload-URL>\n", argv[0]);
+ fprintf(stderr, "Usage: %s [options...] <symbol-file> <upload-URL>\n",
+ argv[0]);
fprintf(stderr, "Options:\n");
- fprintf(stderr, "<symbols> should be created by using the dump_syms tool.\n");
+ fprintf(stderr, "<symbol-file> should be created by using the dump_syms"
+ "tool.\n");
fprintf(stderr, "<upload-URL> is the destination for the upload\n");
+ fprintf(stderr, "-p:\t <protocol> One of ['sym-upload-v1',"
+ " 'sym-upload-v2'], defaults to 'sym-upload-v1'.\n");
+ fprintf(stderr, "-k:\t <API-key> A secret used to authenticate with the"
+ " API [Only supported when using 'sym-upload-v2' protocol].\n");
+ fprintf(stderr, "-f:\t Force symbol upload if already exists [Only"
+ " supported when using 'sym-upload-v2' protocol].\n");
fprintf(stderr, "-v:\t Version information (e.g., 1.2.3.4)\n");
fprintf(stderr, "-x:\t <host[:port]> Use HTTP proxy on given port\n");
fprintf(stderr, "-u:\t <user[:password]> Set proxy user and password\n");
fprintf(stderr, "-h:\t Usage\n");
fprintf(stderr, "-?:\t Usage\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Examples:\n");
+ fprintf(stderr, " With 'sym-upload-v1':\n");
+ fprintf(stderr, " %s path/to/symbol_file http://myuploadserver\n",
+ argv[0]);
+ fprintf(stderr, " With 'sym-upload-v2':\n");
+ fprintf(stderr, " %s -p sym-upload-v2 -k mysecret123! "
+ "path/to/symbol_file http://myuploadserver\n", argv[0]);
}
//=============================================================================
@@ -68,7 +86,7 @@ SetupOptions(int argc, const char *argv[], Options *options) {
extern int optind;
int ch;
- while ((ch = getopt(argc, (char * const *)argv, "u:v:x:h?")) != -1) {
+ while ((ch = getopt(argc, (char * const *)argv, "u:v:x:p:k:hf?")) != -1) {
switch (ch) {
case 'h':
case '?':
@@ -84,6 +102,23 @@ SetupOptions(int argc, const char *argv[], Options *options) {
case 'x':
options->proxy = optarg;
break;
+ case 'p':
+ if (strcmp(optarg, "sym-upload-v2") == 0) {
+ options->upload_protocol = UploadProtocol::SYM_UPLOAD_V2;
+ } else if (strcmp(optarg, "sym-upload-v1") == 0) {
+ options->upload_protocol = UploadProtocol::SYM_UPLOAD_V1;
+ } else {
+ fprintf(stderr, "Invalid protocol '%c'\n", optarg);
+ Usage(argc, argv);
+ exit(1);
+ }
+ break;
+ case 'k':
+ options->api_key = optarg;
+ break;
+ case 'f':
+ options->force = true;
+ break;
default:
fprintf(stderr, "Invalid option '%c'\n", ch);