Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdbstub fixes for Windows and m68000 #12067

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/osd/modules/debugger/debuggdbstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ static const gdb_register_map gdb_register_map_m68020pmmu =
{ "A4", "a4", false, TYPE_INT },
{ "A5", "a5", false, TYPE_INT },
{ "A6", "fp", true, TYPE_INT },
{ "A7", "sp", true, TYPE_INT },
{ "SP", "sp", true, TYPE_INT },
{ "SR", "ps", false, TYPE_INT }, // NOTE GDB named it ps, but it's actually sr
{ "PC", "pc", true, TYPE_CODE_POINTER },
{ "CURPC","pc", true, TYPE_CODE_POINTER },
}
};

Expand All @@ -280,9 +280,9 @@ static const gdb_register_map gdb_register_map_m68000 =
{ "A4", "a4", false, TYPE_INT },
{ "A5", "a5", false, TYPE_INT },
{ "A6", "fp", true, TYPE_INT },
{ "A7", "sp", true, TYPE_INT },
{ "SP", "sp", true, TYPE_INT },
{ "SR", "ps", false, TYPE_INT }, // NOTE GDB named it ps, but it's actually sr
{ "PC", "pc", true, TYPE_CODE_POINTER },
{ "CURPC","pc", true, TYPE_CODE_POINTER },
//NOTE m68-elf-gdb complains about fpcontrol register not present but 68000 doesn't have floating point so...
}
};
Expand Down Expand Up @@ -682,6 +682,9 @@ static std::string escape_packet(const std::string src)
result.reserve(src.length());
for ( char ch: src )
{
if ( ch == '\n' ) // don't let socket convert line endings and messing up the checksum
continue;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn’t the proper solution to this be to change the calls to m_socket.puts(...) to use m_socket.write(...) instead to avoid text conversion altogether? This looks like working around the issue rather than actually fixing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, probably. wasn't familiar with the socket interface :)

if ( ch == '#' || ch == '$' || ch == '}' )
{
result += '}';
Expand Down