Lines Matching refs:string
40 static std::string tmpnam_; // NOLINT [runtime/string] [4]
45 AssemblerTestInfrastructure(std::string architecture,
46 std::string as,
47 std::string as_params,
48 std::string objdump,
49 std::string objdump_params,
50 std::string disasm,
51 std::string disasm_params,
73 std::string asm_tool = FindTool(assembler_cmd_name_);
82 std::string objdump_tool = FindTool(objdump_cmd_name_);
92 std::string disassembler = GetDisassembleCommand();
94 std::string disassembler_tool = FindTool(disassembler_cmd_name_);
113 const std::string& assembly_text,
114 const std::string& test_name) {
150 virtual std::string GetAssemblerCommand() {
156 std::string line = FindTool(assembler_cmd_name_);
167 virtual std::string GetObjdumpCommand() {
173 std::string line = FindTool(objdump_cmd_name_);
184 virtual std::string GetDisassembleCommand() {
190 std::string line = FindTool(disassembler_cmd_name_);
204 std::string error_msg;
205 std::string base_name;
211 bool Assemble(const char* from_file, const char* to_file, std::string* error_msg) {
218 std::vector<std::string> args;
220 // Encaspulate the whole command line in a single string passed to
227 std::string cmd = android::base::Join(args, ' ');
237 for (const std::string& arg : args) {
246 std::string Objdump(const std::string& file) {
253 std::string error_msg;
254 std::vector<std::string> args;
256 // Encaspulate the whole command line in a single string passed to
263 std::string cmd = android::base::Join(args, ' ');
276 std::string line;
297 const std::string& test_name) {
298 std::string disassembler = GetDisassembleCommand();
304 std::string data_name = WriteToFile(data, test_name + ".ass");
305 std::string error_msg;
312 std::string as_name = WriteToFile(as, test_name + ".gcc");
333 bool DisassembleBinary(const std::string& file, std::string* error_msg) {
334 std::vector<std::string> args;
336 // Encaspulate the whole command line in a single string passed to
344 std::string cmd = android::base::Join(args, ' ');
354 std::string WriteToFile(const std::vector<uint8_t>& buffer, const std::string& test_name) {
355 std::string file_name = GetTmpnam() + std::string("---") + test_name;
363 bool CompareFiles(const std::string& f1, const std::string& f2) {
378 bool Compile(const std::string& assembly_code,
380 const std::string& test_name) {
384 res->base_name = GetTmpnam() + std::string("---") + test_name;
401 std::string odump = Objdump(res->base_name + ".o");
408 std::istream_iterator<std::string> start(iss);
409 std::istream_iterator<std::string> end;
410 std::vector<std::string> tokens(start, end);
422 std::string lengthToken = "0x" + tokens[2];
425 std::string offsetToken = "0x" + tokens[5];
449 static bool FileExists(const std::string& file) {
456 if (last_slash == std::string::npos) {
462 if (space_index == std::string::npos) {
466 std::string copy = file.substr(0, space_index - 1);
473 static std::string GetGCCRootPath() {
477 static std::string GetRootPath() {
481 return std::string(build_top) + "/";
486 return getcwd(temp, 1024) ? std::string(temp) + "/" : std::string("");
489 std::string FindTool(const std::string& tool_name) {
490 // Find the current tool. Wild-card pattern is "arch-string*tool-name".
491 std::string gcc_path = GetRootPath() + GetGCCRootPath();
492 std::vector<std::string> args;
503 std::string tmp_file = GetTmpnam();
506 std::string sh_args = android::base::Join(args, ' ');
513 std::string error_msg;
520 std::string line;
533 static void FindToolDumpPrintout(const std::string& name_predicate,
534 const std::string& tmp_file) {
535 std::string gcc_path = GetRootPath() + GetGCCRootPath();
536 std::vector<std::string> args;
547 std::string sh_args = android::base::Join(args, ' ');
554 std::string error_msg;
564 std::string line;
574 void FindToolDump(const std::string& tool_name) {
581 std::string GetTmpnam() {
591 std::string architecture_string_;
594 std::string assembler_cmd_name_;
595 std::string assembler_parameters_;
597 std::string objdump_cmd_name_;
598 std::string objdump_parameters_;
600 std::string disassembler_cmd_name_;
601 std::string disassembler_parameters_;
603 std::string resolved_assembler_cmd_;
604 std::string resolved_objdump_cmd_;
605 std::string resolved_disassemble_cmd_;
607 std::string android_data_;