From ddaaf0fb8605fced72e84410fc7ac834e529eb53 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 13 Mar 2017 18:51:38 -0400 Subject: Introduce regcache_get_ptid This patch introduces the regcache_get_ptid function, which can be used to retrieve the ptid a regcache is connected to. It is used in subsequent patches. gdb/ChangeLog: * regcache.h (regcache_get_ptid): New function. * regcache.c (regcache_get_ptid): New function. --- gdb/regcache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gdb/regcache.c') diff --git a/gdb/regcache.c b/gdb/regcache.c index 0728a03..58d4f56 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -215,6 +215,16 @@ struct regcache ptid_t ptid; }; +/* See regcache.h. */ + +ptid_t +regcache_get_ptid (const struct regcache *regcache) +{ + gdb_assert (!ptid_equal (regcache->ptid, minus_one_ptid)); + + return regcache->ptid; +} + static struct regcache * regcache_xmalloc_1 (struct gdbarch *gdbarch, struct address_space *aspace, int readonly_p) -- cgit v1.1