[pushed] gdb: move declaration of valprint_check_validity to valprint.h

Simon Marchi simon.marchi@polymtl.ca
Tue Aug 25 02:52:49 GMT 2020


The implementation is in valprint.c, so the declaration belongs in
valprint.h.

gdb/ChangeLog:

	* value.h (valprint_check_validity): Move declaration from
	here...
	* valprint.h (valprint_check_validity): ... to here.

Change-Id: Ibe577d3696720099e6d79888d4ee8e3c1bf05a26
---
 gdb/ChangeLog  |  6 ++++++
 gdb/valprint.c |  2 +-
 gdb/valprint.h | 14 ++++++++++++++
 gdb/value.h    | 14 --------------
 4 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ec69531e6b55..642cb6441b34 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2020-08-24  Simon Marchi  <simon.marchi@polymtl.ca>
+
+	* value.h (valprint_check_validity): Move declaration from
+	here...
+	* valprint.h (valprint_check_validity): ... to here.
+
 2020-08-24  Simon Marchi  <simon.marchi@efficios.com>
 
 	* debug.h: New file.
diff --git a/gdb/valprint.c b/gdb/valprint.c
index db98ca2abc98..d95b1700bf71 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -301,7 +301,7 @@ val_print_scalar_or_string_type_p (struct type *type,
 	  || language->is_string_type_p (type));
 }
 
-/* See its definition in value.h.  */
+/* See valprint.h.  */
 
 int
 valprint_check_validity (struct ui_file *stream,
diff --git a/gdb/valprint.h b/gdb/valprint.h
index 57bc0339fcb7..489d14ba0e90 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -171,6 +171,20 @@ extern int read_string (CORE_ADDR addr, int len, int width,
 			gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
 			int *bytes_read);
 
+/* Helper function to check the validity of some bits of a value.
+
+   If TYPE represents some aggregate type (e.g., a structure), return 1.
+
+   Otherwise, any of the bytes starting at OFFSET and extending for
+   TYPE_LENGTH(TYPE) bytes are invalid, print a message to STREAM and
+   return 0.  The checking is done using FUNCS.
+
+   Otherwise, return 1.  */
+
+extern int valprint_check_validity (struct ui_file *stream, struct type *type,
+				    LONGEST embedded_offset,
+				    const struct value *val);
+
 extern void val_print_optimized_out (const struct value *val,
 				     struct ui_file *stream);
 
diff --git a/gdb/value.h b/gdb/value.h
index 12e4a13e3e40..f7d57d125421 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -302,20 +302,6 @@ extern struct value *allocate_computed_value (struct type *type,
 					      const struct lval_funcs *funcs,
 					      void *closure);
 
-/* Helper function to check the validity of some bits of a value.
-
-   If TYPE represents some aggregate type (e.g., a structure), return 1.
-   
-   Otherwise, any of the bytes starting at OFFSET and extending for
-   TYPE_LENGTH(TYPE) bytes are invalid, print a message to STREAM and
-   return 0.  The checking is done using FUNCS.
-   
-   Otherwise, return 1.  */
-
-extern int valprint_check_validity (struct ui_file *stream, struct type *type,
-				    LONGEST embedded_offset,
-				    const struct value *val);
-
 extern struct value *allocate_optimized_out_value (struct type *type);
 
 /* If VALUE is lval_computed, return its lval_funcs structure.  */
-- 
2.28.0



More information about the Gdb-patches mailing list