From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: [PATCH 2/4] Use the target architecture when encoding tracepoint actions
Date: Thu, 07 Jan 2016 17:45:00 -0000 [thread overview]
Message-ID: <1452188697-23870-3-git-send-email-antoine.tremblay@ericsson.com> (raw)
In-Reply-To: <1452188697-23870-1-git-send-email-antoine.tremblay@ericsson.com>
This patch uses the target architecture rather then the objfile
architecture when encoding tracepoint actions.
The target architecture may contain additional registers. E.g. ARM VFP
registers. This information is needed to allow their collection. Since we
can never know whether the registers numbers in the target match the
binary's we have to use tdesc here.
One note about combined debuggers / multi-inferior from Pedro Alves:
In the combined debugger case taking Cell as the practical example that
gdb supports currently:
In that case, the main target_gdbarch() will be powerpc, but you may have set a
tracepoint on _spu_ code, which has a different gdbarch. so for that case,
target_gdbarch would be wrong. I think that in that case, we'd need to
find __the_ target/tdesc gdbarch that is (bfd) compatible with the
objfile's gdbarch.
I think cell/spu gdbserver doesn't support tracepoints, so we can ignore
this for now.
The multi-inferior/process case is somewhat related, but its simpler.
each inferior has its own gdbarch.
That is, target_gdbarch depends on the current inferior selected.
In fact, that just returns inferior->gdbarch nowaways.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* tracepoint.c (encode_actions_1): Use target_gdbarch () rather
than loc->gdbarch.
---
gdb/tracepoint.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 55b2e8e..f7f5736 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1428,14 +1428,14 @@ encode_actions_1 (struct command_line *action,
if (0 == strncasecmp ("$reg", action_exp, 4))
{
- for (i = 0; i < gdbarch_num_regs (tloc->gdbarch); i++)
+ for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++)
add_register (collect, i);
action_exp = strchr (action_exp, ','); /* more? */
}
else if (0 == strncasecmp ("$arg", action_exp, 4))
{
add_local_symbols (collect,
- tloc->gdbarch,
+ target_gdbarch (),
tloc->address,
frame_reg,
frame_offset,
@@ -1446,7 +1446,7 @@ encode_actions_1 (struct command_line *action,
else if (0 == strncasecmp ("$loc", action_exp, 4))
{
add_local_symbols (collect,
- tloc->gdbarch,
+ target_gdbarch (),
tloc->address,
frame_reg,
frame_offset,
@@ -1459,7 +1459,7 @@ encode_actions_1 (struct command_line *action,
struct cleanup *old_chain1 = NULL;
aexpr = gen_trace_for_return_address (tloc->address,
- tloc->gdbarch,
+ target_gdbarch (),
trace_string);
old_chain1 = make_cleanup_free_agent_expr (aexpr);
@@ -1513,7 +1513,7 @@ encode_actions_1 (struct command_line *action,
{
const char *name = &exp->elts[2].string;
- i = user_reg_map_name_to_regnum (tloc->gdbarch,
+ i = user_reg_map_name_to_regnum (target_gdbarch (),
name, strlen (name));
if (i == -1)
internal_error (__FILE__, __LINE__,
@@ -1543,7 +1543,7 @@ encode_actions_1 (struct command_line *action,
collect_symbol (collect,
exp->elts[2].symbol,
- tloc->gdbarch,
+ target_gdbarch (),
frame_reg,
frame_offset,
tloc->address,
--
2.6.4
next prev parent reply other threads:[~2016-01-07 17:45 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-07 17:45 [PATCH 0/4] Support tracepoints for ARM linux in GDBServer Antoine Tremblay
2016-01-07 17:45 ` [PATCH 4/4] " Antoine Tremblay
2016-01-07 17:45 ` [PATCH 3/4] Enable tracing of pseudo-registers on ARM Antoine Tremblay
2016-02-12 15:14 ` Yao Qi
2016-02-12 15:54 ` Marcin Kościelnicki
2016-02-15 10:27 ` Yao Qi
2016-02-15 10:57 ` Pedro Alves
2016-02-15 14:46 ` [PATCH v2] " Antoine Tremblay
2016-02-19 16:33 ` Antoine Tremblay
2016-02-19 19:29 ` [PATCH v3] " Antoine Tremblay
2016-02-19 20:06 ` [PATCH v4] " Antoine Tremblay
2016-02-19 20:22 ` [PATCH v3] " Pedro Alves
2016-02-19 20:32 ` Antoine Tremblay
2016-02-22 11:51 ` Yao Qi
2016-02-22 16:51 ` Antoine Tremblay
2016-02-24 18:11 ` Pedro Alves
2016-02-24 18:21 ` Marcin Kościelnicki
2016-02-24 18:33 ` Pedro Alves
2016-02-24 18:55 ` Antoine Tremblay
2016-02-24 19:02 ` Pedro Alves
2016-02-24 19:02 ` Antoine Tremblay
2016-02-23 19:34 ` Antoine Tremblay
2016-02-24 18:20 ` Pedro Alves
2016-02-24 18:47 ` Antoine Tremblay
2016-02-23 19:41 ` [PATCH v5] " Antoine Tremblay
2016-02-24 19:12 ` Pedro Alves
2016-02-24 19:25 ` Antoine Tremblay
2016-02-25 10:35 ` Yao Qi
2016-02-25 15:33 ` [PATCH v6] " Antoine Tremblay
2016-02-25 17:59 ` Pedro Alves
2016-02-25 18:19 ` Antoine Tremblay
2016-02-26 8:34 ` Yao Qi
2016-02-26 13:00 ` Antoine Tremblay
2016-02-26 13:03 ` [PATCH v7] " Antoine Tremblay
2016-02-26 14:14 ` Yao Qi
2016-02-26 14:57 ` Antoine Tremblay
2016-02-26 14:59 ` [PATCH v8] " Antoine Tremblay
2016-02-26 15:57 ` Yao Qi
2016-02-26 17:45 ` Antoine Tremblay
2016-01-07 17:45 ` Antoine Tremblay [this message]
2016-02-06 20:58 ` [PATCH 2/4] Use the target architecture when encoding tracepoint actions Marcin Kościelnicki
2016-02-11 13:02 ` Pedro Alves
2016-02-11 13:21 ` Antoine Tremblay
2016-01-07 17:45 ` [PATCH 1/4] Teach arm unwinders to terminate gracefully Antoine Tremblay
2016-02-12 14:46 ` Yao Qi
2016-02-24 17:57 ` Antoine Tremblay
2016-02-25 11:44 ` Pedro Alves
2016-02-25 13:15 ` Antoine Tremblay
2016-02-26 9:12 ` Yao Qi
2016-02-26 12:26 ` Antoine Tremblay
2016-02-26 14:25 ` Yao Qi
2016-02-26 20:10 ` Antoine Tremblay
2016-04-06 15:54 ` Yao Qi
2016-04-06 16:30 ` Pedro Alves
2016-04-07 16:33 ` Yao Qi
2016-05-04 16:24 ` Yao Qi
2016-01-11 12:17 ` [PATCH 0/4] Support tracepoints for ARM linux in GDBServer Yao Qi
2016-01-11 12:56 ` Antoine Tremblay
2016-01-11 13:41 ` Yao Qi
2016-04-26 19:11 ` Antoine Tremblay
2016-04-27 8:00 ` Yao Qi
2016-04-27 12:07 ` Antoine Tremblay
2016-04-27 13:57 ` Yao Qi
2016-04-27 14:41 ` Antoine Tremblay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452188697-23870-3-git-send-email-antoine.tremblay@ericsson.com \
--to=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox