Skip to content

Commit f7deead

Browse files
committed
Fixed an issue with the WriteMemory command.
It would try to parse the write length as a decimal number instead of a hex number.
1 parent bce1275 commit f7deead

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Classix/Debug Stub/DebugStub.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ void DebugContext::Start(shared_ptr<WaitQueue<string>>& sink)
125125

126126
StackPreparator stackPrep;
127127
// Put the transition vector to DebugLib_GetExportedFunctions on the top of the stack
128-
// so the debugger can find it
128+
// so the debugger can find it. This is done with a linear search because we need the
129+
// index of the resolver.
129130
uint32_t index = 0;
130131
for (auto iter = fragmentManager.begin(); iter != fragmentManager.end(); iter++)
131132
{
@@ -167,7 +168,7 @@ void DebugContext::Start(shared_ptr<WaitQueue<string>>& sink)
167168

168169
assert(mainSymbol.Universe != SymbolUniverse::LostInTimeAndSpace);
169170

170-
// Start (but don't run) the main thread. We create it because once a thread is created, the DebugThreadManager
171+
// Create (but don't run) the main thread. We create it because once a thread is created, the DebugThreadManager
171172
// will stop its main loop if it reaches 0 threads again.
172173
const PEF::TransitionVector* vector = allocator->ToPointer<PEF::TransitionVector>(mainSymbol.Address);
173174
auto& thread = threads.StartThread(stackPrep, StackPreparator::DefaultStackSize, *vector, false);
@@ -389,7 +390,7 @@ uint8_t DebugStub::WriteMemory(const string& commandString, string& output)
389390
uint32_t address;
390391
size_t size;
391392
int charsRead;
392-
if (sscanf(commandString.c_str(), "M%x,%zd:%n", &address, &size, &charsRead) == 2)
393+
if (sscanf(commandString.c_str(), "M%x,%zx:%n", &address, &size, &charsRead) == 2)
393394
{
394395
uint8_t* memory = context->allocator->ToPointer<uint8_t>(address);
395396
auto details = context->allocator->GetDetails(memory);
@@ -737,7 +738,7 @@ uint8_t DebugStub::QueryRegisterInformation(const string &commandString, string
737738
output = StringPrintf("name:%s;bitsize:%u;offset:%lu;encoding:%s;format:%s;set:%s;", regName, bitSize, offset, encoding, format, set);
738739
if (regNumber == 1)
739740
{
740-
output += "alt-name:sp;generic:fp;";
741+
output += "alt-name:sp;generic:sp;";
741742
}
742743
else if (regNumber == 2)
743744
{

0 commit comments

Comments
 (0)