NFC: use enum SymbolData as flags

To make it easier to add flags when adding new options in SymbolData.

Example:
I want to add a flag to disable inline record for https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2915828.
Change-Id: Ifc5da27c01efa0b0bc21cfcf769d4e6d604a63c6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2984198
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Zequan Wu
2021-06-30 12:27:45 -07:00
committed by Joshua Peraza
parent 04a9ffbe59
commit 68735f74e7
9 changed files with 35 additions and 16 deletions

View File

@@ -127,7 +127,8 @@ int main(int argc, char** argv) {
return 1;
}
} else {
SymbolData symbol_data = cfi ? ALL_SYMBOL_DATA : NO_CFI;
SymbolData symbol_data =
INLINES | (cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES;
google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs);
if (!WriteSymbolFile(binary, obj_name, obj_os, debug_dirs, options,
std::cout)) {

View File

@@ -107,7 +107,8 @@ static void CopyCFIDataBetweenModules(Module* to_module,
}
static bool Start(const Options& options) {
SymbolData symbol_data = options.cfi ? ALL_SYMBOL_DATA : NO_CFI;
SymbolData symbol_data =
INLINES | (options.cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES;
DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs);
// For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the

View File

@@ -421,7 +421,7 @@ static void SetupOptions(int argc, const char* argv[], Options* options) {
if (!isBreakpadUpload && hasCodeFile && !hasDebugID &&
([options->type isEqualToString:kMachOSymbolType] ||
[options->type isEqualToString:kDSYMSymbolType])) {
DumpSymbols dump_symbols(NO_CFI, false);
DumpSymbols dump_symbols(SYMBOLS_AND_FILES | INLINES, false);
if (dump_symbols.Read(argv[optind])) {
std::string identifier = dump_symbols.Identifier();
if (identifier.empty()) {