From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10413 invoked by alias); 21 Oct 2013 15:37:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10390 invoked by uid 89); 21 Oct 2013 15:37:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2013 15:37:34 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9LFbXqG011677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Oct 2013 11:37:33 -0400 Received: from redhat.brq.redhat.com (unused-4-133.brq.redhat.com [10.34.4.133]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9LFbRIl025201; Mon, 21 Oct 2013 11:37:32 -0400 From: Ondrej Oprala To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 03/18] poison "this" Date: Mon, 21 Oct 2013 15:37:00 -0000 Message-Id: <1382369846-5817-4-git-send-email-ooprala@redhat.com> In-Reply-To: <1382369846-5817-1-git-send-email-ooprala@redhat.com> References: <1382369846-5817-1-git-send-email-ooprala@redhat.com> X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00642.txt.bz2 From: Tom Tromey gdb/ChangeLog 2013-10-21 Tom Tromey * addrmap.c (self): Renamed from this. * cp-namespace.c (this_sym): Likewise. * frame.c (self): Likewise. * gdbarch.c (self): Regenerate. * gdbarch.sh (self): Likewise. --- gdb/addrmap.c | 50 +++++++++++++++++++++++++------------------------- gdb/cp-namespace.c | 9 +++++---- gdb/frame.c | 8 ++++---- gdb/gdbarch.c | 22 +++++++++++----------- gdb/gdbarch.sh | 22 +++++++++++----------- 5 files changed, 56 insertions(+), 55 deletions(-) diff --git a/gdb/addrmap.c b/gdb/addrmap.c index 22694ed..348fd43 100644 --- a/gdb/addrmap.c +++ b/gdb/addrmap.c @@ -34,14 +34,14 @@ implementation. */ struct addrmap_funcs { - void (*set_empty) (struct addrmap *this, + void (*set_empty) (struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj); - void *(*find) (struct addrmap *this, CORE_ADDR addr); - struct addrmap *(*create_fixed) (struct addrmap *this, + void *(*find) (struct addrmap *self, CORE_ADDR addr); + struct addrmap *(*create_fixed) (struct addrmap *self, struct obstack *obstack); - void (*relocate) (struct addrmap *this, CORE_ADDR offset); - int (*foreach) (struct addrmap *this, addrmap_foreach_fn fn, void *data); + void (*relocate) (struct addrmap *self, CORE_ADDR offset); + int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data); }; @@ -118,7 +118,7 @@ struct addrmap_fixed static void -addrmap_fixed_set_empty (struct addrmap *this, +addrmap_fixed_set_empty (struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj) { @@ -129,9 +129,9 @@ addrmap_fixed_set_empty (struct addrmap *this, static void * -addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr) +addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr) { - struct addrmap_fixed *map = (struct addrmap_fixed *) this; + struct addrmap_fixed *map = (struct addrmap_fixed *) self; struct addrmap_transition *bottom = &map->transitions[0]; struct addrmap_transition *top = &map->transitions[map->num_transitions - 1]; @@ -162,7 +162,7 @@ addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr) static struct addrmap * -addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack) +addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack) { internal_error (__FILE__, __LINE__, _("addrmap_create_fixed is not implemented yet " @@ -171,9 +171,9 @@ addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack) static void -addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset) +addrmap_fixed_relocate (struct addrmap *self, CORE_ADDR offset) { - struct addrmap_fixed *map = (struct addrmap_fixed *) this; + struct addrmap_fixed *map = (struct addrmap_fixed *) self; size_t i; for (i = 0; i < map->num_transitions; i++) @@ -182,10 +182,10 @@ addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset) static int -addrmap_fixed_foreach (struct addrmap *this, addrmap_foreach_fn fn, +addrmap_fixed_foreach (struct addrmap *self, addrmap_foreach_fn fn, void *data) { - struct addrmap_fixed *map = (struct addrmap_fixed *) this; + struct addrmap_fixed *map = (struct addrmap_fixed *) self; size_t i; for (i = 0; i < map->num_transitions; i++) @@ -320,26 +320,26 @@ addrmap_splay_tree_insert (struct addrmap_mutable *map, tree node at ADDR, even if it would represent a "transition" from one value to the same value. */ static void -force_transition (struct addrmap_mutable *this, CORE_ADDR addr) +force_transition (struct addrmap_mutable *self, CORE_ADDR addr) { splay_tree_node n - = addrmap_splay_tree_lookup (this, addr); + = addrmap_splay_tree_lookup (self, addr); if (! n) { - n = addrmap_splay_tree_predecessor (this, addr); - addrmap_splay_tree_insert (this, addr, + n = addrmap_splay_tree_predecessor (self, addr); + addrmap_splay_tree_insert (self, addr, n ? addrmap_node_value (n) : NULL); } } static void -addrmap_mutable_set_empty (struct addrmap *this, +addrmap_mutable_set_empty (struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj) { - struct addrmap_mutable *map = (struct addrmap_mutable *) this; + struct addrmap_mutable *map = (struct addrmap_mutable *) self; splay_tree_node n, next; void *prior_value; @@ -389,7 +389,7 @@ addrmap_mutable_set_empty (struct addrmap *this, static void * -addrmap_mutable_find (struct addrmap *this, CORE_ADDR addr) +addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr) { /* Not needed yet. */ internal_error (__FILE__, __LINE__, @@ -427,9 +427,9 @@ splay_foreach_copy (splay_tree_node n, void *closure) static struct addrmap * -addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack) +addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack) { - struct addrmap_mutable *mutable = (struct addrmap_mutable *) this; + struct addrmap_mutable *mutable = (struct addrmap_mutable *) self; struct addrmap_fixed *fixed; size_t num_transitions; @@ -462,7 +462,7 @@ addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack) static void -addrmap_mutable_relocate (struct addrmap *this, CORE_ADDR offset) +addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset) { /* Not needed yet. */ internal_error (__FILE__, __LINE__, @@ -493,10 +493,10 @@ addrmap_mutable_foreach_worker (splay_tree_node node, void *data) static int -addrmap_mutable_foreach (struct addrmap *this, addrmap_foreach_fn fn, +addrmap_mutable_foreach (struct addrmap *self, addrmap_foreach_fn fn, void *data) { - struct addrmap_mutable *mutable = (struct addrmap_mutable *) this; + struct addrmap_mutable *mutable = (struct addrmap_mutable *) self; struct mutable_foreach_data foreach_data; foreach_data.fn = fn; diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index f7db48c..bc5ea10 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -660,16 +660,17 @@ lookup_symbol_file (const char *name, if (prefix_len == 0) { struct type *type; - struct symbol *this; + struct symbol *this_sym; - this = lookup_language_this (language_def (language_cplus), block); - if (this == NULL) + this_sym = lookup_language_this (language_def (language_cplus), + block); + if (this_sym == NULL) { do_cleanups (cleanup); return NULL; } - type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this))); + type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this_sym))); klass = xstrdup (TYPE_NAME (type)); nested = xstrdup (name); } diff --git a/gdb/frame.c b/gdb/frame.c index 59e31db..fd56c84 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -667,9 +667,9 @@ frame_find_by_id (struct frame_id id) for (frame = get_current_frame (); ; frame = prev_frame) { - struct frame_id this = get_frame_id (frame); + struct frame_id self = get_frame_id (frame); - if (frame_id_eq (id, this)) + if (frame_id_eq (id, self)) /* An exact match. */ return frame; @@ -683,7 +683,7 @@ frame_find_by_id (struct frame_id id) frame in the current frame chain can have this ID. See the comment at frame_id_inner for details. */ if (get_frame_type (frame) == NORMAL_FRAME - && !frame_id_inner (get_frame_arch (frame), id, this) + && !frame_id_inner (get_frame_arch (frame), id, self) && frame_id_inner (get_frame_arch (prev_frame), id, get_frame_id (prev_frame))) return NULL; @@ -704,7 +704,7 @@ frame_unwind_pc_if_available (struct frame_info *this_frame, CORE_ADDR *pc) /* The right way. The `pure' way. The one true way. This method depends solely on the register-unwind code to - determine the value of registers in THIS frame, and hence + determine the value of registers in SELF frame, and hence the value of this frame's PC (resume address). A typical implementation is no more than: diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1f3380e..396bb67 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -4744,7 +4744,7 @@ gdbarch_find_by_info (struct gdbarch_info info) if (new_gdbarch->initialized_p) { struct gdbarch_list **list; - struct gdbarch_list *this; + struct gdbarch_list *self; if (gdbarch_debug) fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " "Previous architecture %s (%s) selected\n", @@ -4756,12 +4756,12 @@ gdbarch_find_by_info (struct gdbarch_info info) list = &(*list)->next); /* It had better be in the list of architectures. */ gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch); - /* Unlink THIS. */ - this = (*list); - (*list) = this->next; - /* Insert THIS at the front. */ - this->next = rego->arches; - rego->arches = this; + /* Unlink SELF. */ + self = (*list); + (*list) = self->next; + /* Insert SELF at the front. */ + self->next = rego->arches; + rego->arches = self; /* Return it. */ return new_gdbarch; } @@ -4776,10 +4776,10 @@ gdbarch_find_by_info (struct gdbarch_info info) /* Insert the new architecture into the front of the architecture list (keep the list sorted Most Recently Used). */ { - struct gdbarch_list *this = XMALLOC (struct gdbarch_list); - this->next = rego->arches; - this->gdbarch = new_gdbarch; - rego->arches = this; + struct gdbarch_list *self = XMALLOC (struct gdbarch_list); + self->next = rego->arches; + self->gdbarch = new_gdbarch; + rego->arches = self; } /* Check that the newly installed architecture is valid. Plug in diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 644718d..fa9731d 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -2253,7 +2253,7 @@ gdbarch_find_by_info (struct gdbarch_info info) if (new_gdbarch->initialized_p) { struct gdbarch_list **list; - struct gdbarch_list *this; + struct gdbarch_list *self; if (gdbarch_debug) fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " "Previous architecture %s (%s) selected\n", @@ -2265,12 +2265,12 @@ gdbarch_find_by_info (struct gdbarch_info info) list = &(*list)->next); /* It had better be in the list of architectures. */ gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch); - /* Unlink THIS. */ - this = (*list); - (*list) = this->next; - /* Insert THIS at the front. */ - this->next = rego->arches; - rego->arches = this; + /* Unlink SELF. */ + self = (*list); + (*list) = self->next; + /* Insert SELF at the front. */ + self->next = rego->arches; + rego->arches = self; /* Return it. */ return new_gdbarch; } @@ -2285,10 +2285,10 @@ gdbarch_find_by_info (struct gdbarch_info info) /* Insert the new architecture into the front of the architecture list (keep the list sorted Most Recently Used). */ { - struct gdbarch_list *this = XMALLOC (struct gdbarch_list); - this->next = rego->arches; - this->gdbarch = new_gdbarch; - rego->arches = this; + struct gdbarch_list *self = XMALLOC (struct gdbarch_list); + self->next = rego->arches; + self->gdbarch = new_gdbarch; + rego->arches = self; } /* Check that the newly installed architecture is valid. Plug in -- 1.8.3.1