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

gdbserver: fix some error responses #1414

Merged
merged 3 commits into from
Jun 26, 2022

Conversation

flit
Copy link
Member

@flit flit commented Jun 11, 2022

  • Fix the "Unexpected exception: a bytes-like object is required, not 'tuple'" error log if the gdbserver gets an unexpected exception or receives an unknown command from gdb.
  • Replace the GDBError exception class with error logs and appropriate response packets (if any).
  • GDBServer.get_symbol() logs the error and returns None to the caller.
  • Cleaned up qXfer command handling. The annex value is checked, and some incorrect error responses are fixed.

flit added 3 commits June 11, 2022 15:01
Don't return the detach value, which was removed in 17ab710.
This fixes one of the issues reported in pyocd#1409.
- .handle_query_xml() returns the correct empty packet or error instead
of raising GDBError.
- .get_symbol() logs the error and returns None to the caller.
- Restructure code to always call into .handle_query_xml() for qXfer
read commands.
- Return empty packet on unknown qXfer operation.
- Pass annex to .handle_query_xml().
- Explicit check for read features annex being 'target.xml', and that
the annex is empty for other objects.
@flit flit merged commit 9724fa9 into pyocd:main Jun 26, 2022
flit added a commit to flit/pyOCD that referenced this pull request Jun 26, 2022
* gdbserver: correct return type from ._handle_message() on exceptions

Don't return the detach value, which was removed in 17ab710.
This fixes one of the issues reported in pyocd#1409.

* gdbserver: replace GDBError exceptions with logs

- .handle_query_xml() returns the correct empty packet or error instead
of raising GDBError.
- .get_symbol() logs the error and returns None to the caller.

* gdbserver: qXfer command fixes

- Restructure code to always call into .handle_query_xml() for qXfer
read commands.
- Return empty packet on unknown qXfer operation.
- Pass annex to .handle_query_xml().
- Explicit check for read features annex being 'target.xml', and that
the annex is empty for other objects.
@flit flit deleted the bugfix/gdbserver_error_response branch June 26, 2022 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant