mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 22:00:05 +00:00 
			
		
		
		
	Use BreakpointAddress struct instead of passing address directly
This commit is contained in:
		
							parent
							
								
									6ea428addf
								
							
						
					
					
						commit
						42928659e8
					
				
					 3 changed files with 18 additions and 8 deletions
				
			
		|  | @ -231,13 +231,18 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| PAddr GetNextBreakpointFromAddress(PAddr addr, BreakpointType type) { | ||||
| BreakpointAddress GetNextBreakpointFromAddress(PAddr addr, BreakpointType type) { | ||||
|     std::map<u32, Breakpoint>& p = GetBreakpointList(type); | ||||
|     auto next_breakpoint = p.lower_bound(addr); | ||||
|     u32 breakpoint = -1; | ||||
|     BreakpointAddress breakpoint; | ||||
| 
 | ||||
|     if (next_breakpoint != p.end()) | ||||
|         breakpoint = next_breakpoint->first; | ||||
|     if (next_breakpoint != p.end()) { | ||||
|         breakpoint.address = next_breakpoint->first; | ||||
|         breakpoint.type = type; | ||||
|     } else { | ||||
|         breakpoint.address = 0; | ||||
|         breakpoint.type = BreakpointType::None; | ||||
|     } | ||||
| 
 | ||||
|     return breakpoint; | ||||
| } | ||||
|  |  | |||
|  | @ -18,6 +18,11 @@ enum class BreakpointType { | |||
|     Access    ///< Access (R/W) Breakpoint
 | ||||
| }; | ||||
| 
 | ||||
| struct BreakpointAddress { | ||||
|     PAddr address; | ||||
|     BreakpointType type; | ||||
| }; | ||||
| 
 | ||||
| /// If set to false, the server will never be started and no gdbstub-related functions will be executed.
 | ||||
| extern std::atomic<bool> g_server_enabled; | ||||
| 
 | ||||
|  | @ -63,7 +68,7 @@ void HandlePacket(); | |||
|  * @param addr Address to search from. | ||||
|  * @param type Type of breakpoint. | ||||
|  */ | ||||
| PAddr GetNextBreakpointFromAddress(u32 addr, GDBStub::BreakpointType type); | ||||
| BreakpointAddress GetNextBreakpointFromAddress(u32 addr, GDBStub::BreakpointType type); | ||||
| 
 | ||||
| /**
 | ||||
|  * Check if a breakpoint of the specified type exists at the given address. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue