aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2011-09-17 13:29:32 +0000
committerYao Qi <yao@codesourcery.com>2011-09-17 13:29:32 +0000
commite2d966398c7963a6448f0d3d4451438efeda66e7 (patch)
treef4cea31c1bc6332c67f63b99309b55361bae82c7 /gdb/regcache.c
parent53dad163f707be6f386ca506b86e195b747d7169 (diff)
downloadgdb-e2d966398c7963a6448f0d3d4451438efeda66e7.zip
gdb-e2d966398c7963a6448f0d3d4451438efeda66e7.tar.gz
gdb-e2d966398c7963a6448f0d3d4451438efeda66e7.tar.bz2
gdb/
* infrun.c (displaced_step_fixup): Move some code ... (displaced_step_restore): ... here. New function. (handle_inferior_event): Cleanup displaced stepping state for both child and parent when get forked or vforked event. * regcache.c (get_thread_arch_aspace_regcache): New function. get_thread_arch_regcache (): Call it.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 0af93e8..37092f8 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -450,17 +450,33 @@ struct regcache_list
static struct regcache_list *current_regcache;
struct regcache *
-get_thread_arch_regcache (ptid_t ptid, struct gdbarch *gdbarch)
+get_thread_arch_aspace_regcache (ptid_t ptid, struct gdbarch *gdbarch,
+ struct address_space *aspace)
{
struct regcache_list *list;
struct regcache *new_regcache;
- struct address_space *aspace;
for (list = current_regcache; list; list = list->next)
if (ptid_equal (list->regcache->ptid, ptid)
&& get_regcache_arch (list->regcache) == gdbarch)
return list->regcache;
+ new_regcache = regcache_xmalloc_1 (gdbarch, aspace, 0);
+ new_regcache->ptid = ptid;
+
+ list = xmalloc (sizeof (struct regcache_list));
+ list->regcache = new_regcache;
+ list->next = current_regcache;
+ current_regcache = list;
+
+ return new_regcache;
+}
+
+struct regcache *
+get_thread_arch_regcache (ptid_t ptid, struct gdbarch *gdbarch)
+{
+ struct address_space *aspace;
+
/* For the benefit of "maint print registers" & co when debugging an
executable, allow dumping the regcache even when there is no
thread selected (target_thread_address_space internal-errors if
@@ -471,15 +487,7 @@ get_thread_arch_regcache (ptid_t ptid, struct gdbarch *gdbarch)
? NULL
: target_thread_address_space (ptid));
- new_regcache = regcache_xmalloc_1 (gdbarch, aspace, 0);
- new_regcache->ptid = ptid;
-
- list = xmalloc (sizeof (struct regcache_list));
- list->regcache = new_regcache;
- list->next = current_regcache;
- current_regcache = list;
-
- return new_regcache;
+ return get_thread_arch_aspace_regcache (ptid, gdbarch, aspace);
}
static ptid_t current_thread_ptid;