From c04a1aa88fa42d61fafa570de6ab6ab1b7a12d27 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sat, 20 Apr 2002 17:22:48 +0000 Subject: 2002-04-20 Daniel Jacobowitz * gdbserver/inferiors.c (struct inferior_info): Add regcache_data. (add_inferior): Call create_register_cache. (clear_inferiors): Call free_register_cache. (inferior_regcache_data, set_inferior_regcache_data): New functions. * gdbserver/regcache.c (struct inferior_regcache_data): New. (registers): Remove. (get_regcache): New function. (create_register_cache, free_register_cache): New functions. (set_register_cache): Don't initialize the register cache here. (registers_to_string, registers_from_string, register_data): Call get_regcache. * gdbserver/regcache.h: Add prototypes. * gdbserver/server.h: Likewise. --- gdb/gdbserver/inferiors.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gdb/gdbserver/inferiors.c') diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c index f8cbd04..774798d 100644 --- a/gdb/gdbserver/inferiors.c +++ b/gdb/gdbserver/inferiors.c @@ -29,6 +29,7 @@ struct inferior_info { int pid; void *target_data; + void *regcache_data; struct inferior_info *next; }; @@ -52,6 +53,8 @@ add_inferior (int pid) if (current_inferior == NULL) current_inferior = inferiors; + create_register_cache (new_inferior); + if (signal_pid == 0) signal_pid = pid; } @@ -67,6 +70,8 @@ clear_inferiors (void) if (inf->target_data) free (inf->target_data); + if (inf->regcache_data) + free_register_cache (inf); free (inf); inf = next_inf; @@ -86,3 +91,15 @@ set_inferior_target_data (struct inferior_info *inferior, void *data) { inferior->target_data = data; } + +void * +inferior_regcache_data (struct inferior_info *inferior) +{ + return inferior->regcache_data; +} + +void +set_inferior_regcache_data (struct inferior_info *inferior, void *data) +{ + inferior->regcache_data = data; +} -- cgit v1.1