From 59058bae0aa58524530f437f1d1a6eb404c5cb3c Mon Sep 17 00:00:00 2001 From: Trevor Rudolph Date: Tue, 19 Jan 2021 15:03:30 -0500 Subject: [PATCH] Breakpoint from string flag parsing using token Since the string includes hex, the break_on_hit 'b' flag can be pulled from the address by accident istringstream for BreakPoint parsing --- Source/Core/Core/PowerPC/BreakPoints.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/PowerPC/BreakPoints.cpp b/Source/Core/Core/PowerPC/BreakPoints.cpp index bf1e1643d1..9a5ac01ed8 100644 --- a/Source/Core/Core/PowerPC/BreakPoints.cpp +++ b/Source/Core/Core/PowerPC/BreakPoints.cpp @@ -65,12 +65,13 @@ void BreakPoints::AddFromStrings(const TBreakPointsStr& bp_strings) for (const std::string& bp_string : bp_strings) { TBreakPoint bp; - std::stringstream ss; - ss << std::hex << bp_string; - ss >> bp.address; - bp.is_enabled = bp_string.find('n') != bp_string.npos; - bp.log_on_hit = bp_string.find('l') != bp_string.npos; - bp.break_on_hit = bp_string.find('b') != bp_string.npos; + std::string flags; + std::istringstream iss(bp_string); + iss >> std::hex >> bp.address; + iss >> flags; + bp.is_enabled = flags.find('n') != flags.npos; + bp.log_on_hit = flags.find('l') != flags.npos; + bp.break_on_hit = flags.find('b') != flags.npos; bp.is_temporary = false; Add(bp); }