public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/4] gdb: remove internalvar_funcs::destroy
Date: Tue,  1 Feb 2022 09:07:14 -0500	[thread overview]
Message-ID: <20220201140717.3046952-2-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20220201140717.3046952-1-simon.marchi@polymtl.ca>

No kind of internal var uses it remove it.  This makes the transition to
using a variant easier, since we don't need to think about where this
should be called (in a destructor or not), if it can throw, etc.

Change-Id: Iebbc867d1ce6716480450d9790410d6684cbe4dd
---
 gdb/break-catch-throw.c | 1 -
 gdb/inferior.c          | 1 -
 gdb/infrun.c            | 1 -
 gdb/probe.c             | 1 -
 gdb/thread.c            | 2 --
 gdb/tracepoint.c        | 1 -
 gdb/value.c             | 5 -----
 gdb/value.h             | 6 ------
 gdb/windows-tdep.c      | 1 -
 9 files changed, 19 deletions(-)

diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index d34e5f9ee537..fcd644e6a5f4 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -510,7 +510,6 @@ static const struct internalvar_funcs exception_funcs =
 {
   compute_exception,
   NULL,
-  NULL
 };
 
 \f
diff --git a/gdb/inferior.c b/gdb/inferior.c
index bebddb44173c..0457c7096eca 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -980,7 +980,6 @@ static const struct internalvar_funcs inferior_funcs =
 {
   inferior_id_make_value,
   NULL,
-  NULL
 };
 
 \f
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 2e7ed15723fd..483034884b5a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -9366,7 +9366,6 @@ static const struct internalvar_funcs siginfo_funcs =
 {
   siginfo_make_value,
   NULL,
-  NULL
 };
 
 /* Callback for infrun's target events source.  This is marked when a
diff --git a/gdb/probe.c b/gdb/probe.c
index 278b36c3ce84..f0a40f5face1 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -866,7 +866,6 @@ static const struct internalvar_funcs probe_funcs =
 {
   compute_probe_arg,
   compile_probe_arg,
-  NULL
 };
 
 
diff --git a/gdb/thread.c b/gdb/thread.c
index 611be3f4633a..b260a30882bc 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -2124,7 +2124,6 @@ static const struct internalvar_funcs thread_funcs =
 {
   thread_id_per_inf_num_make_value,
   NULL,
-  NULL
 };
 
 /* Implementation of `gthread' variable.  */
@@ -2133,7 +2132,6 @@ static const struct internalvar_funcs gthread_funcs =
 {
   global_thread_id_make_value,
   NULL,
-  NULL
 };
 
 void _initialize_thread ();
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 506af3c527ec..c59d44ac74a4 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3985,7 +3985,6 @@ traceframe_available_memory (std::vector<mem_range> *result,
 static const struct internalvar_funcs sdata_funcs =
 {
   sdata_make_value,
-  NULL,
   NULL
 };
 
diff --git a/gdb/value.c b/gdb/value.c
index 7bd9891b3e97..0ccc41b9278f 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -2449,11 +2449,6 @@ clear_internalvar (struct internalvar *var)
       xfree (var->u.string);
       break;
 
-    case INTERNALVAR_MAKE_VALUE:
-      if (var->u.make_value.functions->destroy != NULL)
-	var->u.make_value.functions->destroy (var->u.make_value.data);
-      break;
-
     default:
       break;
     }
diff --git a/gdb/value.h b/gdb/value.h
index 0de4b5f3aefc..f7b29022d37c 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1002,12 +1002,6 @@ struct internalvar_funcs
 			 struct agent_expr *expr,
 			 struct axs_value *value,
 			 void *data);
-
-  /* If non-NULL, this is called to destroy DATA.  The DATA argument
-     passed to this function is the same argument that was passed to
-     `create_internalvar_type_lazy'.  */
-
-  void (*destroy) (void *data);
 };
 
 extern struct internalvar *create_internalvar_type_lazy (const char *name,
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 13be3e4e461d..91fecd630d7c 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -970,7 +970,6 @@ static const struct internalvar_funcs tlb_funcs =
 {
   tlb_make_value,
   NULL,
-  NULL
 };
 
 /* Layout of an element of a PE's Import Directory Table.  Based on:
-- 
2.34.1


  reply	other threads:[~2022-02-01 14:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 14:07 [PATCH 0/4] Add variant type Simon Marchi
2022-02-01 14:07 ` Simon Marchi [this message]
2022-03-04 16:15   ` [PATCH 1/4] gdb: remove internalvar_funcs::destroy Tom Tromey
2022-03-06 16:33     ` Simon Marchi
2022-02-01 14:07 ` [PATCH 2/4] gdb: constify parameter of value_copy Simon Marchi
2022-03-04 16:16   ` Tom Tromey
2022-03-06 16:33     ` Simon Marchi
2022-02-01 14:07 ` [PATCH 3/4] gdbsupport: add variant-lite header Simon Marchi
2022-02-01 14:07 ` [PATCH 4/4] gdb: make internalvar use a variant Simon Marchi
2022-03-04 16:23   ` Tom Tromey
2022-03-07 12:12     ` Pedro Alves
2022-03-16  2:06       ` Simon Marchi
2022-03-16 13:26         ` Pedro Alves
2022-03-16 13:28           ` Simon Marchi
2022-02-03  0:02 ` [PATCH 0/4] Add variant type Andrew Burgess
2022-02-03  1:32   ` Simon Marchi
2022-02-04 12:44     ` Andrew Burgess
2022-02-04 13:19       ` Simon Marchi

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=20220201140717.3046952-2-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --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).