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

Report thread-id in response to ? packet #105

Merged

Conversation

thefaxman
Copy link
Contributor

Description

When more than one thread is active the following warning is visible upon connecting:

warning: multi-threaded target stopped without sending a thread-id, using first non-exited thread

This is because gdbstub sends a stop packet of S05, which conveys no thread-id. This fix changes the response to T05thread:<tid>;, which eliminates the warning.

API Stability

  • This PR does not require a breaking API change

Checklist

  • Implementation
    • cargo build compiles without errors or warnings
    • cargo clippy runs without errors or warnings
    • cargo fmt was run
    • All tests pass
  • Documentation
    • rustdoc + approprate inline code comments
    • Updated CHANGELOG.md

Validation

Validated on armv4t and armv4t_multicore

GDB output
(gdb) target remote localhost:9001
Remote debugging using localhost:9001
0x55550000 in ?? ()
(gdb) 
armv4t output
!!!!! EXAMPLE OUTPUT !!!!!

     TRACE gdbstub::protocol::recv_packet     > <-- $?#3f
     TRACE gdbstub::protocol::response_writer > --> $T05thread:p01.01;#06

Signed-off-by: Ryan Fairfax ryan@thefaxman.net

When more than one thread is active the following warning is visible upon connecting:

```
warning: multi-threaded target stopped without sending a thread-id, using first non-exited thread
```

This is because gdbstub sends a stop packet of `S05`, which conveys no thread-id.  This fix changes the response to `T05thread:<tid>;`, which eliminates the warning.

Signed-off-by: Ryan Fairfax <ryan@thefaxman.net>
@daniel5151 daniel5151 self-requested a review June 7, 2022 02:14
Copy link
Owner

@daniel5151 daniel5151 left a comment

Choose a reason for hiding this comment

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

Nice, LGTM, thanks!

@daniel5151 daniel5151 merged commit 2cd3bc6 into daniel5151:master Jun 7, 2022
@thefaxman thefaxman deleted the thefaxman/question_thread_id branch June 7, 2022 13:34
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.

None yet

2 participants