OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 | 52 |
53 void SelLdrLauncherStandalone::BuildCommandLine(vector<nacl::string>* command) { | 53 void SelLdrLauncherStandalone::BuildCommandLine(vector<nacl::string>* command) { |
54 assert(sel_ldr_ != NACL_NO_FILE_PATH); // Set by InitCommandLine(). | 54 assert(sel_ldr_ != NACL_NO_FILE_PATH); // Set by InitCommandLine(). |
55 if (!command_prefix_.empty()) | 55 if (!command_prefix_.empty()) |
56 command->insert(command->end(), | 56 command->insert(command->end(), |
57 command_prefix_.begin(), command_prefix_.end()); | 57 command_prefix_.begin(), command_prefix_.end()); |
58 if (!sel_ldr_bootstrap_.empty()) | 58 if (!sel_ldr_bootstrap_.empty()) |
59 command->push_back(sel_ldr_bootstrap_); | 59 command->push_back(sel_ldr_bootstrap_); |
60 command->push_back(sel_ldr_); | 60 command->push_back(sel_ldr_); |
61 if (!sel_ldr_bootstrap_.empty()) { | 61 if (!sel_ldr_bootstrap_.empty()) { |
62 command->push_back("--r_debug=0xXXXXXXXXXXXXXXXX"); | 62 static const nacl::string kTemplateDigits = "XXXXXXXXXXXXXXXX"; |
63 command->push_back("--reserved_at_zero=0xXXXXXXXX"); | 63 command->push_back("--r_debug=0x" + kTemplateDigits); |
Mark Seaborn
2012/07/30 18:51:12
You could avoid a runtime concatenation by inlinin
Austin Benson
2012/07/31 23:24:12
Inlined.
| |
64 command->push_back("--reserved_at_zero=0x" + kTemplateDigits); | |
64 } | 65 } |
65 command->push_back("-R"); // RPC will be used to point to the nexe. | 66 command->push_back("-R"); // RPC will be used to point to the nexe. |
66 | 67 |
67 command->insert(command->end(), sel_ldr_argv_.begin(), sel_ldr_argv_.end()); | 68 command->insert(command->end(), sel_ldr_argv_.begin(), sel_ldr_argv_.end()); |
68 | 69 |
69 struct NaClEnvCleanser env_cleanser; | 70 struct NaClEnvCleanser env_cleanser; |
70 NaClEnvCleanserCtor(&env_cleanser, 1); | 71 NaClEnvCleanserCtor(&env_cleanser, 1); |
71 if (!NaClEnvCleanserInit(&env_cleanser, GetEnviron(), NULL)) { | 72 if (!NaClEnvCleanserInit(&env_cleanser, GetEnviron(), NULL)) { |
72 NaClLog(LOG_FATAL, "Failed to initialise env cleanser\n"); | 73 NaClLog(LOG_FATAL, "Failed to initialise env cleanser\n"); |
73 } | 74 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 args_for_sel_ldr.push_back("-B"); | 143 args_for_sel_ldr.push_back("-B"); |
143 args_for_sel_ldr.push_back(irt_library_path); | 144 args_for_sel_ldr.push_back(irt_library_path); |
144 } | 145 } |
145 if (!StartViaCommandLine(prefix, args_for_sel_ldr, args_for_nexe)) { | 146 if (!StartViaCommandLine(prefix, args_for_sel_ldr, args_for_nexe)) { |
146 return false; | 147 return false; |
147 } | 148 } |
148 return true; | 149 return true; |
149 } | 150 } |
150 | 151 |
151 } // namespace nacl | 152 } // namespace nacl |
OLD | NEW |