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: Fix order of task list when first BP occurs after tasks created #216

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

roy-hopkins
Copy link
Collaborator

A remote GDB connects to the SVSM GDB stub after SVSM hits the first breakpoint. At this point the remote GDB does not know which task is halted or anything about the current list of tasks in SVSM. Therefore after requesting the tasklist it assumes the first task (thread) in the list is the one that is halted. See 'qfThreadInfo' documentation at https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html for details.

The order of the list of tasks provided by the GDB stub is based on iterating the task list. Therefore the first task reported by SVSM may not be the task that is currently halted.

This patch queries the current task and makes sure it is reported first every time the task list is requested.

A remote GDB connects to the SVSM GDB stub after SVSM hits the first
breakpoint. At this point the remote GDB does not know which task is
halted or anything about the current list of tasks in SVSM. Therefore
after requesting the tasklist it assumes the first task (thread) in the
list is the one that is halted. See 'qfThreadInfo' documentation at
https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html
for details.

The order of the list of tasks provided by the GDB stub is based on
iterating the task list. Therefore the first task reported by SVSM may
not be the task that is currently halted.

This patch queries the current task and makes sure it is reported first
every time the task list is requested.

Signed-off-by: Roy Hopkins <roy.hopkins@suse.com>
@osteffenrh
Copy link
Contributor

That fixes it for me. Thanks a lot!

@joergroedel joergroedel merged commit 78c0c39 into coconut-svsm:main Jan 17, 2024
2 checks passed
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.

3 participants