Skip to content

Commit 12129e0

Browse files
authored
gdbstub: fix checksum on Windows (#12067)
gdbstub: fix m68000 register names
1 parent 068704c commit 12129e0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/osd/modules/debugger/debuggdbstub.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ static const gdb_register_map gdb_register_map_m68020pmmu =
253253
{ "A4", "a4", false, TYPE_INT },
254254
{ "A5", "a5", false, TYPE_INT },
255255
{ "A6", "fp", true, TYPE_INT },
256-
{ "A7", "sp", true, TYPE_INT },
256+
{ "SP", "sp", true, TYPE_INT },
257257
{ "SR", "ps", false, TYPE_INT }, // NOTE GDB named it ps, but it's actually sr
258-
{ "PC", "pc", true, TYPE_CODE_POINTER },
258+
{ "CURPC","pc", true, TYPE_CODE_POINTER },
259259
}
260260
};
261261

@@ -280,9 +280,9 @@ static const gdb_register_map gdb_register_map_m68000 =
280280
{ "A4", "a4", false, TYPE_INT },
281281
{ "A5", "a5", false, TYPE_INT },
282282
{ "A6", "fp", true, TYPE_INT },
283-
{ "A7", "sp", true, TYPE_INT },
283+
{ "SP", "sp", true, TYPE_INT },
284284
{ "SR", "ps", false, TYPE_INT }, // NOTE GDB named it ps, but it's actually sr
285-
{ "PC", "pc", true, TYPE_CODE_POINTER },
285+
{ "CURPC","pc", true, TYPE_CODE_POINTER },
286286
//NOTE m68-elf-gdb complains about fpcontrol register not present but 68000 doesn't have floating point so...
287287
}
288288
};
@@ -682,6 +682,9 @@ static std::string escape_packet(const std::string src)
682682
result.reserve(src.length());
683683
for ( char ch: src )
684684
{
685+
if ( ch == '\n' ) // don't let socket convert line endings and messing up the checksum
686+
continue;
687+
685688
if ( ch == '#' || ch == '$' || ch == '}' )
686689
{
687690
result += '}';

0 commit comments

Comments
 (0)