gdb, gdbserver: update thread identifier in enable_btrace target method

The enable_btrace target method takes a ptid_t to identify the thread on
which tracing shall be enabled.

Change this to thread_info * to avoid translating back and forth between
the two.  This will be used in a subsequent patch.
This commit is contained in:
Markus Metzger 2021-11-25 15:15:52 +01:00
parent b674665b51
commit 696c0d5ef2
13 changed files with 38 additions and 30 deletions

View file

@ -658,8 +658,8 @@ public:
bool use_agent (bool use) override;
bool can_use_agent () override;
struct btrace_target_info *enable_btrace (ptid_t ptid,
const struct btrace_config *conf) override;
struct btrace_target_info *
enable_btrace (thread_info *tp, const struct btrace_config *conf) override;
void disable_btrace (struct btrace_target_info *tinfo) override;
@ -14178,7 +14178,8 @@ remote_target::remote_btrace_maybe_reopen ()
/* Enable branch tracing. */
struct btrace_target_info *
remote_target::enable_btrace (ptid_t ptid, const struct btrace_config *conf)
remote_target::enable_btrace (thread_info *tp,
const struct btrace_config *conf)
{
struct btrace_target_info *tinfo = NULL;
struct packet_config *packet = NULL;
@ -14202,6 +14203,7 @@ remote_target::enable_btrace (ptid_t ptid, const struct btrace_config *conf)
btrace_sync_conf (conf);
ptid_t ptid = tp->ptid;
set_general_thread (ptid);
buf += xsnprintf (buf, endbuf - buf, "%s", packet->name);