From patchwork Mon Aug 18 15:30:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 2416 Received: (qmail 19417 invoked by alias); 18 Aug 2014 15:30:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19255 invoked by uid 89); 18 Aug 2014 15:30:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 18 Aug 2014 15:30:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6C3AC11616B for ; Mon, 18 Aug 2014 11:30:49 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EdKY-u-UxKO4 for ; Mon, 18 Aug 2014 11:30:49 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3E5D111615E for ; Mon, 18 Aug 2014 11:30:49 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 24C6A410E4; Mon, 18 Aug 2014 17:30:48 +0200 (CEST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [pushed/Ada 1/3] Fix indentation level in ada-lang.c::ada_evaluate_subexp. Date: Mon, 18 Aug 2014 17:30:42 +0200 Message-Id: <1408375844-28020-2-git-send-email-brobecker@adacore.com> In-Reply-To: <1408375844-28020-1-git-send-email-brobecker@adacore.com> References: <1408375844-28020-1-git-send-email-brobecker@adacore.com> I just happen to notice that a lexical block was missing one indentation level. gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp) : Fix identation of lexical block. --- gdb/ChangeLog | 5 ++++ gdb/ada-lang.c | 88 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c5e3a1..8cb2f18 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-08-18 Joel Brobecker + + * ada-lang.c (ada_evaluate_subexp) : Fix identation + of lexical block. + 2014-08-15 Siva Chandra Reddy PR c++/17132 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 32f1b39..334df1f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10138,50 +10138,50 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if (ada_is_tagged_type (type, 0) || (TYPE_CODE (type) == TYPE_CODE_REF && ada_is_tagged_type (TYPE_TARGET_TYPE (type), 0))) - { - /* Tagged types are a little special in the fact that the real - type is dynamic and can only be determined by inspecting the - object's tag. This means that we need to get the object's - value first (EVAL_NORMAL) and then extract the actual object - type from its tag. - - Note that we cannot skip the final step where we extract - the object type from its tag, because the EVAL_NORMAL phase - results in dynamic components being resolved into fixed ones. - This can cause problems when trying to print the type - description of tagged types whose parent has a dynamic size: - We use the type name of the "_parent" component in order - to print the name of the ancestor type in the type description. - If that component had a dynamic size, the resolution into - a fixed type would result in the loss of that type name, - thus preventing us from printing the name of the ancestor - type in the type description. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); - - if (TYPE_CODE (type) != TYPE_CODE_REF) - { - struct type *actual_type; - - actual_type = type_from_tag (ada_value_tag (arg1)); - if (actual_type == NULL) - /* If, for some reason, we were unable to determine - the actual type from the tag, then use the static - approximation that we just computed as a fallback. - This can happen if the debugging information is - incomplete, for instance. */ - actual_type = type; - return value_zero (actual_type, not_lval); - } - else - { - /* In the case of a ref, ada_coerce_ref takes care - of determining the actual type. But the evaluation - should return a ref as it should be valid to ask - for its address; so rebuild a ref after coerce. */ - arg1 = ada_coerce_ref (arg1); - return value_ref (arg1); - } - } + { + /* Tagged types are a little special in the fact that the real + type is dynamic and can only be determined by inspecting the + object's tag. This means that we need to get the object's + value first (EVAL_NORMAL) and then extract the actual object + type from its tag. + + Note that we cannot skip the final step where we extract + the object type from its tag, because the EVAL_NORMAL phase + results in dynamic components being resolved into fixed ones. + This can cause problems when trying to print the type + description of tagged types whose parent has a dynamic size: + We use the type name of the "_parent" component in order + to print the name of the ancestor type in the type description. + If that component had a dynamic size, the resolution into + a fixed type would result in the loss of that type name, + thus preventing us from printing the name of the ancestor + type in the type description. */ + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); + + if (TYPE_CODE (type) != TYPE_CODE_REF) + { + struct type *actual_type; + + actual_type = type_from_tag (ada_value_tag (arg1)); + if (actual_type == NULL) + /* If, for some reason, we were unable to determine + the actual type from the tag, then use the static + approximation that we just computed as a fallback. + This can happen if the debugging information is + incomplete, for instance. */ + actual_type = type; + return value_zero (actual_type, not_lval); + } + else + { + /* In the case of a ref, ada_coerce_ref takes care + of determining the actual type. But the evaluation + should return a ref as it should be valid to ask + for its address; so rebuild a ref after coerce. */ + arg1 = ada_coerce_ref (arg1); + return value_ref (arg1); + } + } *pos += 4; return value_zero (to_static_fixed_type (type), not_lval);