mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	added a module to load symbol map files for debugging
This commit is contained in:
		
							
								
								
									
										33
									
								
								src/core/arm/disassembler/load_symbol_map.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								src/core/arm/disassembler/load_symbol_map.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
// Copyright 2014 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
#include "common/symbols.h"
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
#include "common/file_util.h"
 | 
			
		||||
 | 
			
		||||
#include "core/arm/disassembler/load_symbol_map.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Loads a symbol map file for use with the disassembler
 | 
			
		||||
 * @param filename String filename path of symbol map file
 | 
			
		||||
 */
 | 
			
		||||
void LoadSymbolMap(std::string filename) {
 | 
			
		||||
    std::ifstream infile(filename);
 | 
			
		||||
 | 
			
		||||
    std::string address_str, function_name, line;
 | 
			
		||||
    u32 size, address;
 | 
			
		||||
 | 
			
		||||
    while (std::getline(infile, line)) {
 | 
			
		||||
        std::istringstream iss(line);
 | 
			
		||||
        if (!(iss >> address_str >> size >> function_name)) { 
 | 
			
		||||
            break; // Error parsing 
 | 
			
		||||
        }
 | 
			
		||||
        u32 address = std::stoul(address_str, nullptr, 16);
 | 
			
		||||
 | 
			
		||||
        Symbols::Add(address, function_name, size, 2);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										13
									
								
								src/core/arm/disassembler/load_symbol_map.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/core/arm/disassembler/load_symbol_map.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
// Copyright 2014 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Loads a symbol map file for use with the disassembler
 | 
			
		||||
 * @param filename String filename path of symbol map file
 | 
			
		||||
 */
 | 
			
		||||
void LoadSymbolMap(std::string filename);
 | 
			
		||||
		Reference in New Issue
	
	Block a user