From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH 3/5] Introduce get_value_arch
Date: Thu, 16 Jul 2015 18:51:00 -0000 [thread overview]
Message-ID: <1437072684-26565-3-git-send-email-simon.marchi@ericsson.com> (raw)
In-Reply-To: <1437072684-26565-1-git-send-email-simon.marchi@ericsson.com>
Similar to get_type_arch, used to get the gdbarch associated to a
struct value.
gdb/ChangeLog:
* value.c (get_value_arch): New function.
* value.h (get_value_arch): New declaration.
---
gdb/value.c | 6 ++++++
gdb/value.h | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/gdb/value.c b/gdb/value.c
index 6314036..af354de 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -340,6 +340,12 @@ struct value
VEC(range_s) *optimized_out;
};
+struct gdbarch *
+get_value_arch (const struct value *value)
+{
+ return get_type_arch (value_type (value));
+}
+
int
value_bits_available (const struct value *value, int offset, int length)
{
diff --git a/gdb/value.h b/gdb/value.h
index 7ff6aa8..968882d 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -99,6 +99,10 @@ struct value *value_next (struct value *);
extern struct type *value_type (const struct value *);
+/* Return the gdbarch associated to the value. */
+
+extern struct gdbarch *get_value_arch (const struct value *value);
+
/* This is being used to change the type of an existing value, that
code should instead be creating a new value with the changed type
(but possibly shared content). */
--
2.1.4
next prev parent reply other threads:[~2015-07-16 18:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 18:51 [PATCH 1/5] Update comment for struct type's length field, introduce type_length_units Simon Marchi
2015-07-16 18:51 ` [PATCH 2/5] Update comments in struct value for non-8-bits architectures Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 21:46 ` Simon Marchi
2015-07-28 10:20 ` Pedro Alves
2015-07-16 18:51 ` [PATCH 5/5] Add new test internalvar.exp Simon Marchi
2015-07-24 11:41 ` Pedro Alves
2015-07-16 18:51 ` Simon Marchi [this message]
2015-07-24 11:27 ` [PATCH 3/5] Introduce get_value_arch Pedro Alves
2015-07-27 21:47 ` Simon Marchi
2015-07-28 10:25 ` Pedro Alves
2015-07-28 14:56 ` Simon Marchi
2015-07-28 15:06 ` Simon Marchi
2015-07-16 18:51 ` [PATCH 4/5] Consider addressable memory unit size in various value functions Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 22:05 ` Simon Marchi
2015-07-28 10:29 ` Pedro Alves
2015-07-28 15:07 ` Simon Marchi
2015-07-24 11:26 ` [PATCH 1/5] Update comment for struct type's length field, introduce type_length_units Pedro Alves
2015-07-27 21:37 ` Simon Marchi
2015-07-28 10:19 ` Pedro Alves
2015-07-28 15:04 ` Simon Marchi
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=1437072684-26565-3-git-send-email-simon.marchi@ericsson.com \
--to=simon.marchi@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