| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <cstdio> | 5 #include <cstdio> |
| 6 #include <cstring> | 6 #include <cstring> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 while (i < argc) { | 43 while (i < argc) { |
| 44 if (strcmp(argv[i], kEvalCommand) == 0) { | 44 if (strcmp(argv[i], kEvalCommand) == 0) { |
| 45 i += 2; | 45 i += 2; |
| 46 continue; | 46 continue; |
| 47 } | 47 } |
| 48 if (strcmp(argv[i], kCommand) == 0) { | 48 if (strcmp(argv[i], kCommand) == 0) { |
| 49 // Command line shouldn't end with --command switch without value. | 49 // Command line shouldn't end with --command switch without value. |
| 50 i += 2; | 50 i += 2; |
| 51 CHECK_LE(i, argc); | 51 CHECK_LE(i, argc); |
| 52 std::string nacl_gdb_script(argv[i - 1]); | 52 std::string nacl_gdb_script(argv[i - 1]); |
| 53 file_util::WriteFile(base::FilePath::FromUTF8Unsafe(nacl_gdb_script), | 53 base::WriteFile(base::FilePath::FromUTF8Unsafe(nacl_gdb_script), |
| 54 kPass, strlen(kPass)); | 54 kPass, strlen(kPass)); |
| 55 continue; | 55 continue; |
| 56 } | 56 } |
| 57 // Unknown argument. | 57 // Unknown argument. |
| 58 NOTREACHED() << "Invalid argument " << argv[i]; | 58 NOTREACHED() << "Invalid argument " << argv[i]; |
| 59 } | 59 } |
| 60 CHECK_EQ(i, argc); | 60 CHECK_EQ(i, argc); |
| 61 file_util::WriteFile(base::FilePath::FromUTF8Unsafe(mock_nacl_gdb_file), | 61 base::WriteFile(base::FilePath::FromUTF8Unsafe(mock_nacl_gdb_file), |
| 62 kPass, strlen(kPass)); | 62 kPass, strlen(kPass)); |
| 63 return 0; | 63 return 0; |
| 64 } | 64 } |
| OLD | NEW |