Skip to content

Add direct way to access GDB client's current selected TID #147

@jakab922

Description

@jakab922

In the gdb docs for handling threads there is the thread <thread_id> command listed for which the documentation is the following:

Make thread ID thread-id the current thread. The command argument thread-id is the GDB thread ID, as shown in the first field of the ‘info threads’ display, with or without an inferior qualifier (e.g., ‘2.1’ or ‘1’).
...

When I issue thread 1 on the client side a $T<client_side_thread_id>#<checksum> message is sent to the server.

On the server side this message is handled in here by calling is_thread_alive which is not quite right. This call should select a thread as active on a multithreaded environment rather than check if the thread is alive.

The reason this is an issue for me is because I have a multi core environment where each core supports hardware breakpoints and is represented by a thread on the server side. For someone to set a hardware breakpoint they need to issue the following commands for example:

thread <thread_id>
hbreak *<address>

I can add some thread activation logic to the is_thread_alive method, but it's a hack. What would be the right way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions