public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PUSHED 04/11] gdb/fortran: Add new function to evaluate Fortran expressions
Date: Wed, 06 Mar 2019 18:15:00 -0000	[thread overview]
Message-ID: <db58f934939a406c16b6578c96a9390e64de2668.1551895528.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1551895528.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1551895528.git.andrew.burgess@embecosm.com>

This is an initial restructure, it adds a new function in which
Fortran specific expressions can be evaluated.  No Fortran specific
expressions are added with this commit though, so for now, the new
function just forwards all expressions to the default expression
handler, as such, there should be no user visible changes after this
commit.  However, the new function will be useful in later commits.

gdb/ChangeLog:

	* f-lang.c (evaluate_subexp_f): New function.
	(exp_descriptor_f): New global.
	(f_language_defn): Use exp_descriptor_f instead of
	exp_descriptor_standard.
---
 gdb/ChangeLog |  7 +++++++
 gdb/f-lang.c  | 22 +++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 6eb9b230eb7..5beb46c5f31 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -239,6 +239,15 @@ f_collect_symbol_completion_matches (completion_tracker &tracker,
 						      text, word, ":", code);
 }
 
+/* Special expression evaluation cases for Fortran.  */
+struct value *
+evaluate_subexp_f (struct type *expect_type, struct expression *exp,
+		   int *pos, enum noside noside)
+{
+  /* Currently no special handling is required. */
+  return evaluate_subexp_standard (expect_type, exp, pos, noside);
+}
+
 static const char *f_extensions[] =
 {
   ".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP",
@@ -246,6 +255,17 @@ static const char *f_extensions[] =
   NULL
 };
 
+/* Expression processing for Fortran.  */
+static const struct exp_descriptor exp_descriptor_f =
+{
+  print_subexp_standard,
+  operator_length_standard,
+  operator_check_standard,
+  op_name_standard,
+  dump_subexp_body_standard,
+  evaluate_subexp_f
+};
+
 extern const struct language_defn f_language_defn =
 {
   "fortran",
@@ -256,7 +276,7 @@ extern const struct language_defn f_language_defn =
   array_column_major,
   macro_expansion_no,
   f_extensions,
-  &exp_descriptor_standard,
+  &exp_descriptor_f,
   f_parse,			/* parser */
   null_post_parser,
   f_printchar,			/* Print character constant */
-- 
2.14.5

  parent reply	other threads:[~2019-03-06 18:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 16:11 [PATCH 00/11] Fortran Parser Cleanup, KIND Support, and Intrinsic Functions Andrew Burgess
2019-02-12 16:11 ` [PATCH 09/11] gdb/fortran: Use TYPE_CODE_CHAR for character types Andrew Burgess
2019-02-12 16:11 ` [PATCH 11/11] gdb/fortran: Handle older TYPE*SIZE typenames Andrew Burgess
2019-02-12 16:11 ` [PATCH 07/11] gdb/fortran: Expand the set of types that support (kind=N) Andrew Burgess
2019-02-12 16:11 ` [PATCH 04/11] gdb/fortran: Add new function to evaluate Fortran expressions Andrew Burgess
2019-02-12 16:11 ` [PATCH 05/11] gdb/fortran: Enable debugging of the Fortran parser Andrew Burgess
2019-02-12 16:11 ` [PATCH 02/11] gdb/fortran: Cleanup code for parsing logical constants Andrew Burgess
2019-02-12 16:11 ` [PATCH 06/11] gdb/fortran: Add Fortran 'kind' intrinsic and keyword Andrew Burgess
2019-02-12 16:11 ` [PATCH 01/11] gdb/fortran: Remove some duplicate tests Andrew Burgess
2019-02-12 16:11 ` [PATCH 03/11] gdb/fortran: Simplify handling of Fortran dot operations and keywords Andrew Burgess
2019-02-12 16:11 ` [PATCH 10/11] gdb/fortran: Add support for the ABS intrinsic function Andrew Burgess
2019-02-12 16:11 ` [PATCH 08/11] gdb/fortran: Add builtin 8-byte integer type with (kind=8) support Andrew Burgess
2019-03-06 18:15 ` [PUSHED 02/11] gdb/fortran: Cleanup code for parsing logical constants Andrew Burgess
2019-03-06 18:15 ` [PUSHED 00/11] Fortran Parser Cleanup, KIND Support, and Intrinsic Functions Andrew Burgess
2019-03-06 18:15 ` [PUSHED 01/11] gdb/fortran: Remove some duplicate tests Andrew Burgess
2019-03-06 18:15 ` Andrew Burgess [this message]
2019-03-06 18:16 ` [PUSHED 08/11] gdb/fortran: Add builtin 8-byte integer type with (kind=8) support Andrew Burgess
2019-03-06 18:16 ` [PUSHED 10/11] gdb/fortran: Add support for the ABS intrinsic function Andrew Burgess
2019-03-06 19:11   ` Tom Tromey
2019-03-07 15:23     ` [PATCH] gdb: Move value_from_host_double into value.c and make more use of it Andrew Burgess
2019-03-07 15:49       ` Tom Tromey
2019-03-06 18:16 ` [PUSHED 11/11] gdb/fortran: Handle older TYPE*SIZE typenames Andrew Burgess
2019-03-06 18:16 ` [PUSHED 06/11] gdb/fortran: Add Fortran 'kind' intrinsic and keyword Andrew Burgess
2019-03-06 18:16 ` [PUSHED 09/11] gdb/fortran: Use TYPE_CODE_CHAR for character types Andrew Burgess
2019-03-06 18:16 ` [PUSHED 03/11] gdb/fortran: Simplify handling of Fortran dot operations and keywords Andrew Burgess
2019-03-06 18:16 ` [PUSHED 07/11] gdb/fortran: Expand the set of types that support (kind=N) Andrew Burgess
2019-03-06 18:16 ` [PUSHED 05/11] gdb/fortran: Enable debugging of the Fortran parser Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db58f934939a406c16b6578c96a9390e64de2668.1551895528.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).