Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1649)

Unified Diff: src/tools/mac/dump_syms/dump_syms_tool.cc

Issue 1340543002: Fix Mac Breakpad host tools to build in Linux cross-compile (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/tools/mac/dump_syms/dump_syms_tool.cc
diff --git a/src/tools/mac/dump_syms/dump_syms_tool.mm b/src/tools/mac/dump_syms/dump_syms_tool.cc
similarity index 93%
rename from src/tools/mac/dump_syms/dump_syms_tool.mm
rename to src/tools/mac/dump_syms/dump_syms_tool.cc
index 7d56809a885ebf92cc7ac9ac1133ac389fe64409..6cee6cb55f05f097d464a48480bf9502bd702250 100644
--- a/src/tools/mac/dump_syms/dump_syms_tool.mm
+++ b/src/tools/mac/dump_syms/dump_syms_tool.cc
@@ -29,7 +29,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// dump_syms_tool.mm: Command line tool that uses the DumpSymbols class.
+// dump_syms_tool.cc: Command line tool that uses the DumpSymbols class.
// TODO(waylonis): accept stdin
#include <mach-o/arch.h>
@@ -51,8 +51,9 @@ using std::vector;
struct Options {
Options()
: srcPath(), dsymPath(), arch(), cfi(true), handle_inter_cu_refs(true) {}
- NSString *srcPath;
- NSString *dsymPath;
+
+ string srcPath;
+ string dsymPath;
const NXArchInfo *arch;
bool cfi;
bool handle_inter_cu_refs;
@@ -115,7 +116,7 @@ static bool Start(const Options &options) {
// from the primary debug info file, the dSYM, and then dump additional CFI
// data from the source Mach-O file.
bool split_module = options.dsymPath && options.srcPath && options.cfi;
- NSString* primary_file = split_module ? options.dsymPath : options.srcPath;
+ string primary_file = split_module ? options.dsymPath : options.srcPath;
Mark Mentovai 2015/09/11 15:49:51 const string&
Ted Mielczarek 2015/09/15 12:58:36 Done.
if (!dump_symbols.Read(primary_file))
return false;
@@ -124,7 +125,7 @@ static bool Start(const Options &options) {
if (!dump_symbols.SetArchitecture(options.arch->cputype,
options.arch->cpusubtype)) {
fprintf(stderr, "%s: no architecture '%s' is present in file.\n",
- [primary_file fileSystemRepresentation], options.arch->name);
+ primary_file.c_str(), options.arch->name);
size_t available_size;
const SuperFatArch *available =
dump_symbols.AvailableArchitectures(&available_size);
@@ -214,8 +215,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
break;
}
case 'g':
- options->dsymPath = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:optarg length:strlen(optarg)];
+ options->dsymPath = optarg;
break;
case 'c':
options->cfi = false;
@@ -237,21 +237,16 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
exit(1);
}
- options->srcPath = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:argv[optind]
- length:strlen(argv[optind])];
+ options->srcPath = argv[optind];
}
//=============================================================================
int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Options options;
bool result;
SetupOptions(argc, argv, &options);
result = Start(options);
- [pool release];
-
return !result;
}

Powered by Google App Engine
This is Rietveld 408576698