Consistently call BaseName() in various Usage() functions.

Make various tools print just their names as part of the usage
instructions, rather than the full path. Also fix a missing space in the
dump_syms usage output.

Change-Id: I2b796678cd47e7dbabcc03df2b57cdc3420c008c
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2787678
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Lei Zhang 2021-03-25 18:32:03 -07:00
parent 3bea2815bf
commit c484031f1f
9 changed files with 55 additions and 22 deletions

View file

@ -578,21 +578,24 @@ src_tools_linux_core2md_core2md_SOURCES = \
src/tools/linux/core2md/core2md.cc
src_tools_linux_core2md_core2md_LDADD = \
src/client/linux/libbreakpad_client.a
src/client/linux/libbreakpad_client.a \
src/common/path_helper.o
if HAVE_MEMFD_CREATE
src_tools_linux_core_handler_core_handler_SOURCES = \
src/tools/linux/core_handler/core_handler.cc
src_tools_linux_core_handler_core_handler_LDADD = \
src/client/linux/libbreakpad_client.a
src/client/linux/libbreakpad_client.a \
src/common/path_helper.o
endif
src_tools_linux_pid2md_pid2md_SOURCES = \
src/tools/linux/pid2md/pid2md.cc
src_tools_linux_pid2md_pid2md_LDADD = \
src/client/linux/libbreakpad_client.a
src/client/linux/libbreakpad_client.a \
src/common/path_helper.o
src_tools_linux_dump_syms_dump_syms_SOURCES = \
src/common/dwarf_cfi_to_module.cc \
@ -632,6 +635,7 @@ src_tools_linux_md2core_minidump_2_core_SOURCES = \
src_tools_linux_symupload_minidump_upload_SOURCES = \
src/common/linux/http_upload.cc \
src/common/path_helper.cc \
src/tools/linux/symupload/minidump_upload.cc
src_tools_linux_symupload_minidump_upload_LDADD = -ldl
@ -644,6 +648,7 @@ src_tools_linux_symupload_sym_upload_SOURCES = \
src/common/linux/symbol_collector_client.h \
src/common/linux/symbol_upload.cc \
src/common/linux/symbol_upload.h \
src/common/path_helper.cc \
src/tools/linux/symupload/sym_upload.cc
src_tools_linux_symupload_sym_upload_LDADD = -ldl
@ -1260,6 +1265,7 @@ noinst_SCRIPTS = $(check_SCRIPTS)
src_processor_minidump_dump_SOURCES = \
src/processor/minidump_dump.cc
src_processor_minidump_dump_LDADD = \
src/common/path_helper.o \
src/processor/basic_code_modules.o \
src/processor/convert_old_arm64_context.o \
src/processor/dump_context.o \

View file

@ -1094,6 +1094,7 @@ am__src_processor_minidump_dump_SOURCES_DIST = \
src_processor_minidump_dump_OBJECTS = \
$(am_src_processor_minidump_dump_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@ -1450,13 +1451,15 @@ am__src_tools_linux_core2md_core2md_SOURCES_DIST = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_core2md_core2md_OBJECTS = src/tools/linux/core2md/core2md.$(OBJEXT)
src_tools_linux_core2md_core2md_OBJECTS = \
$(am_src_tools_linux_core2md_core2md_OBJECTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o
am__src_tools_linux_core_handler_core_handler_SOURCES_DIST = \
src/tools/linux/core_handler/core_handler.cc
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am_src_tools_linux_core_handler_core_handler_OBJECTS = src/tools/linux/core_handler/core_handler.$(OBJEXT)
src_tools_linux_core_handler_core_handler_OBJECTS = \
$(am_src_tools_linux_core_handler_core_handler_OBJECTS)
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_DEPENDENCIES = src/client/linux/libbreakpad_client.a
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_DEPENDENCIES = src/client/linux/libbreakpad_client.a \
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/common/path_helper.o
am__src_tools_linux_dump_syms_dump_syms_SOURCES_DIST = \
src/common/dwarf_cfi_to_module.cc \
src/common/dwarf_cu_to_module.cc \
@ -1529,11 +1532,13 @@ am__src_tools_linux_pid2md_pid2md_SOURCES_DIST = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_pid2md_pid2md_OBJECTS = src/tools/linux/pid2md/pid2md.$(OBJEXT)
src_tools_linux_pid2md_pid2md_OBJECTS = \
$(am_src_tools_linux_pid2md_pid2md_OBJECTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o
am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST = \
src/common/linux/http_upload.cc \
src/common/linux/http_upload.cc src/common/path_helper.cc \
src/tools/linux/symupload/minidump_upload.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_minidump_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload.$(OBJEXT)
src_tools_linux_symupload_minidump_upload_OBJECTS = \
$(am_src_tools_linux_symupload_minidump_upload_OBJECTS)
@ -1545,12 +1550,13 @@ am__src_tools_linux_symupload_sym_upload_SOURCES_DIST = \
src/common/linux/symbol_collector_client.cc \
src/common/linux/symbol_collector_client.h \
src/common/linux/symbol_upload.cc \
src/common/linux/symbol_upload.h \
src/common/linux/symbol_upload.h src/common/path_helper.cc \
src/tools/linux/symupload/sym_upload.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_sym_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.$(OBJEXT)
src_tools_linux_symupload_sym_upload_OBJECTS = \
$(am_src_tools_linux_symupload_sym_upload_OBJECTS)
@ -2783,19 +2789,22 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_LDADD = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_SOURCES = \
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/tools/linux/core_handler/core_handler.cc
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@src_tools_linux_core_handler_core_handler_LDADD = \
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \
@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/common/path_helper.o
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/pid2md/pid2md.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_pid2md_pid2md_LDADD = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.o
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
@ -2837,6 +2846,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_LDADD = -ldl
@ -2849,6 +2859,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_LDADD = -ldl
@ -3529,6 +3540,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump.cc
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \

View file

@ -36,6 +36,7 @@
#include <string.h>
#include <unistd.h>
#include "common/path_helper.h"
#include "common/scoped_ptr.h"
#include "google_breakpad/processor/minidump.h"
#include "processor/logging.h"
@ -233,7 +234,7 @@ Usage(int argc, char *argv[], bool error) {
" <minidump> should be a minidump.\n"
" -x:\t Display memory in a hexdump like format\n"
" -h:\t Usage\n",
argv[0]);
google_breakpad::BaseName(argv[0]).c_str());
}
//=============================================================================

View file

@ -33,13 +33,15 @@
#include "client/linux/minidump_writer/minidump_writer.h"
#include "client/linux/minidump_writer/linux_core_dumper.h"
#include "common/path_helper.h"
using google_breakpad::AppMemoryList;
using google_breakpad::MappingList;
using google_breakpad::LinuxCoreDumper;
static int ShowUsage(const char* argv0) {
fprintf(stderr, "Usage: %s <core file> <procfs dir> <output>\n", argv0);
fprintf(stderr, "Usage: %s <core file> <procfs dir> <output>\n",
google_breakpad::BaseName(argv0).c_str());
return 1;
}

View file

@ -40,6 +40,7 @@
#include "client/linux/minidump_writer/linux_core_dumper.h"
#include "client/linux/minidump_writer/minidump_writer.h"
#include "common/path_helper.h"
#include "common/scoped_ptr.h"
namespace {
@ -58,7 +59,8 @@ using google_breakpad::scoped_array;
const int core_read_size = 1024 * 1024;
void ShowUsage(const char* argv0) {
fprintf(stderr, "Usage: %s <process id> <minidump file>\n\n", argv0);
fprintf(stderr, "Usage: %s <process id> <minidump file>\n\n",
google_breakpad::BaseName(argv0).c_str());
fprintf(stderr,
"A tool which serves as a core dump handler and produces "
"minidump files.\n");

View file

@ -37,13 +37,16 @@
#include <vector>
#include "common/linux/dump_symbols.h"
#include "common/path_helper.h"
using google_breakpad::WriteSymbolFile;
using google_breakpad::WriteSymbolFileHeader;
int usage(const char* self) {
fprintf(stderr, "Usage: %s [OPTION] <binary-with-debugging-info> "
"[directories-for-debug-file]\n\n", self);
fprintf(stderr,
"Usage: %s [OPTION] <binary-with-debugging-info> "
"[directories-for-debug-file]\n\n",
google_breakpad::BaseName(self).c_str());
fprintf(stderr, "Options:\n");
fprintf(stderr, " -i: Output module header information only.\n");
fprintf(stderr, " -c Do not generate CFI section\n");

View file

@ -34,10 +34,12 @@
#include <unistd.h>
#include "client/linux/minidump_writer/minidump_writer.h"
#include "common/path_helper.h"
int main(int argc, char* argv[]) {
if (argc != 3) {
fprintf(stderr, "Usage: %s <process id> <minidump file>\n\n", argv[0]);
fprintf(stderr, "Usage: %s <process id> <minidump file>\n\n",
google_breakpad::BaseName(argv[0]).c_str());
fprintf(stderr,
"A tool to generate a minidump from a running process. The process "
"resumes its\nactivity once the operation is completed. Permission "

View file

@ -41,6 +41,7 @@
#include <string>
#include "common/linux/http_upload.h"
#include "common/path_helper.h"
#include "common/using_std_string.h"
using google_breakpad::HTTPUpload;
@ -91,8 +92,10 @@ static void Start(Options *options) {
static void
Usage(int argc, const char *argv[]) {
fprintf(stderr, "Submit minidump information.\n");
fprintf(stderr, "Usage: %s [options...] -p <product> -v <version> <minidump> "
"<upload-URL>\n", argv[0]);
fprintf(stderr,
"Usage: %s [options...] -p <product> -v <version> <minidump> "
"<upload-URL>\n",
google_breakpad::BaseName(argv[0]).c_str());
fprintf(stderr, "Options:\n");
fprintf(stderr, "<minidump> should be a minidump.\n");
fprintf(stderr, "<upload-URL> is the destination for the upload\n");

View file

@ -47,6 +47,7 @@
#include <locale>
#include "common/linux/symbol_upload.h"
#include "common/path_helper.h"
using google_breakpad::sym_upload::UploadProtocol;
using google_breakpad::sym_upload::Options;
@ -66,9 +67,10 @@ static void
Usage(int argc, const char *argv[]) {
fprintf(stderr, "Submit symbol information.\n");
fprintf(stderr, "Usage: %s [options...] <symbol-file> <upload-URL>\n",
argv[0]);
google_breakpad::BaseName(argv[0]).c_str());
fprintf(stderr, "Options:\n");
fprintf(stderr, "<symbol-file> should be created by using the dump_syms"
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',"