diff options
author | Pedro Alves <palves@redhat.com> | 2015-08-06 17:29:01 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-08-06 17:29:01 +0100 |
commit | a44892be35506471a53e5bc8c2def4ffccf451f9 (patch) | |
tree | ffa95b488c44731e8bdf756eedca458dc91e65bc /gdb | |
parent | ca0a5f0bd33d0aa17a5cf518e41e47ddfde486ad (diff) | |
download | gdb-a44892be35506471a53e5bc8c2def4ffccf451f9.zip gdb-a44892be35506471a53e5bc8c2def4ffccf451f9.tar.gz gdb-a44892be35506471a53e5bc8c2def4ffccf451f9.tar.bz2 |
gdbserver: no point in hiding the regcache type nowadays
The regcache used to be hidden inside inferiors.c, but since the
tracepoints support that it's a first class object. This also fixes a
few implicit pointer conversion errors in C++ mode, caused by a few
places missing the explicit cast.
gdb/gdbserver/ChangeLog:
2015-08-06 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct regcache): Forward declare.
(struct thread_info) <regcache_data>: Now a struct regcache
pointer.
* inferiors.c (inferior_regcache_data)
(set_inferior_regcache_data): Now work with struct regcache
pointers.
* inferiors.h (struct regcache): Forward declare.
(inferior_regcache_data, set_inferior_regcache_data): Now work
with struct regcache pointers.
* regcache.c (get_thread_regcache, regcache_invalidate_thread)
(free_register_cache_thread): Remove struct regcache pointer
casts.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 15 | ||||
-rw-r--r-- | gdb/gdbserver/gdbthread.h | 3 | ||||
-rw-r--r-- | gdb/gdbserver/inferiors.c | 4 | ||||
-rw-r--r-- | gdb/gdbserver/inferiors.h | 5 | ||||
-rw-r--r-- | gdb/gdbserver/regcache.c | 7 |
5 files changed, 25 insertions, 9 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 1c1bb5e..5f08417 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,20 @@ 2015-08-06 Pedro Alves <palves@redhat.com> + * gdbthread.h (struct regcache): Forward declare. + (struct thread_info) <regcache_data>: Now a struct regcache + pointer. + * inferiors.c (inferior_regcache_data) + (set_inferior_regcache_data): Now work with struct regcache + pointers. + * inferiors.h (struct regcache): Forward declare. + (inferior_regcache_data, set_inferior_regcache_data): Now work + with struct regcache pointers. + * regcache.c (get_thread_regcache, regcache_invalidate_thread) + (free_register_cache_thread): Remove struct regcache pointer + casts. + +2015-08-06 Pedro Alves <palves@redhat.com> + * server.c (captured_main): On error, print the exception message to stderr, and if run_once is set, throw a quit. diff --git a/gdb/gdbserver/gdbthread.h b/gdb/gdbserver/gdbthread.h index b3e3e9d..d6959f4 100644 --- a/gdb/gdbserver/gdbthread.h +++ b/gdb/gdbserver/gdbthread.h @@ -22,6 +22,7 @@ #include "inferiors.h" struct btrace_target_info; +struct regcache; struct thread_info { @@ -30,7 +31,7 @@ struct thread_info struct inferior_list_entry entry; void *target_data; - void *regcache_data; + struct regcache *regcache_data; /* The last resume GDB requested on this thread. */ enum resume_kind last_resume_kind; diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c index 7c5a1e0..d7ad347 100644 --- a/gdb/gdbserver/inferiors.c +++ b/gdb/gdbserver/inferiors.c @@ -230,14 +230,14 @@ set_inferior_target_data (struct thread_info *inferior, void *data) inferior->target_data = data; } -void * +struct regcache * inferior_regcache_data (struct thread_info *inferior) { return inferior->regcache_data; } void -set_inferior_regcache_data (struct thread_info *inferior, void *data) +set_inferior_regcache_data (struct thread_info *inferior, struct regcache *data) { inferior->regcache_data = data; } diff --git a/gdb/gdbserver/inferiors.h b/gdb/gdbserver/inferiors.h index 0569586..88ebbe3 100644 --- a/gdb/gdbserver/inferiors.h +++ b/gdb/gdbserver/inferiors.h @@ -33,6 +33,7 @@ struct inferior_list_entry }; struct thread_info; +struct regcache; struct target_desc; struct sym_cache; struct breakpoint; @@ -147,7 +148,7 @@ struct inferior_list_entry *find_inferior_id (struct inferior_list *list, void *inferior_target_data (struct thread_info *); void set_inferior_target_data (struct thread_info *, void *); -void *inferior_regcache_data (struct thread_info *); -void set_inferior_regcache_data (struct thread_info *, void *); +struct regcache *inferior_regcache_data (struct thread_info *); +void set_inferior_regcache_data (struct thread_info *, struct regcache *); #endif /* INFERIORS_H */ diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c index 8d7957b..ef955ff 100644 --- a/gdb/gdbserver/regcache.c +++ b/gdb/gdbserver/regcache.c @@ -28,7 +28,7 @@ get_thread_regcache (struct thread_info *thread, int fetch) { struct regcache *regcache; - regcache = (struct regcache *) inferior_regcache_data (thread); + regcache = inferior_regcache_data (thread); /* Threads' regcaches are created lazily, because biarch targets add the main thread/lwp before seeing it stop for the first time, and @@ -76,7 +76,7 @@ regcache_invalidate_thread (struct thread_info *thread) { struct regcache *regcache; - regcache = (struct regcache *) inferior_regcache_data (thread); + regcache = inferior_regcache_data (thread); if (regcache == NULL) return; @@ -277,8 +277,7 @@ find_register_by_number (const struct target_desc *tdesc, int n) static void free_register_cache_thread (struct thread_info *thread) { - struct regcache *regcache - = (struct regcache *) inferior_regcache_data (thread); + struct regcache *regcache = inferior_regcache_data (thread); if (regcache != NULL) { |