gdb: Introduce new language field la_struct_too_deep_ellipsis
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 26 Mar 2019 19:34:06 +0000 (19:34 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 29 Apr 2019 21:01:07 +0000 (22:01 +0100)
This commit is preparation work for a later commit, and by itself
makes no user visible change to GDB.  I've split this work into a
separate commit in order to make code review easier.

This commit adds a new field 'la_struct_too_deep_ellipsis' to the
language struct, this string will be used in the next commit to print
a language specific string from within the generic value printing
code.

In this commit I add the new field and initialise it for each
language, however at this stage the new field is never used.

gdb/ChangeLog:

* language.h (struct language_defn) <la_struct_too_deep_ellipsis>:
New field.
* ada-lang.c (ada_language_defn): Initialise new field.
* c-lang.c (c_language_defn): Likewise.
(cplus_language_defn): Likewise.
(asm_language_defn): Likewise.
(minimal_language_defn): Likewise.
* d-lang.c (d_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* go-lang.c (go_language_defn): Likewise.
* language.c (unknown_language_defn): Likewise.
(auto_language_defn): Likewise.
* m2-lang.c (m2_language_defn): Likewise.
* objc-lang.c (objc_language_defn): Likewise.
* opencl-lang.c (opencl_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* rust-lang.c (rust_language_defn): Likewise.

13 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/c-lang.c
gdb/d-lang.c
gdb/f-lang.c
gdb/go-lang.c
gdb/language.c
gdb/language.h
gdb/m2-lang.c
gdb/objc-lang.c
gdb/opencl-lang.c
gdb/p-lang.c
gdb/rust-lang.c

index 718602e..0bbe400 100644 (file)
@@ -1,5 +1,25 @@
 2019-04-29  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+       * language.h (struct language_defn) <la_struct_too_deep_ellipsis>:
+       New field.
+       * ada-lang.c (ada_language_defn): Initialise new field.
+       * c-lang.c (c_language_defn): Likewise.
+       (cplus_language_defn): Likewise.
+       (asm_language_defn): Likewise.
+       (minimal_language_defn): Likewise.
+       * d-lang.c (d_language_defn): Likewise.
+       * f-lang.c (f_language_defn): Likewise.
+       * go-lang.c (go_language_defn): Likewise.
+       * language.c (unknown_language_defn): Likewise.
+       (auto_language_defn): Likewise.
+       * m2-lang.c (m2_language_defn): Likewise.
+       * objc-lang.c (objc_language_defn): Likewise.
+       * opencl-lang.c (opencl_language_defn): Likewise.
+       * p-lang.c (pascal_language_defn): Likewise.
+       * rust-lang.c (rust_language_defn): Likewise.
+
+2019-04-29  Andrew Burgess  <andrew.burgess@embecosm.com>
+
        * ada-lang.c (ada_is_character_type): Change return type to bool.
        (ada_is_string_type): Likewise.
        * ada-lang.h (ada_is_character_type): Update declaration
index 3667817..4fcbce7 100644 (file)
@@ -14389,7 +14389,8 @@ extern const struct language_defn ada_language_defn = {
   default_search_name_hash,
   &ada_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "(...)"                      /* la_struct_too_deep_ellipsis */
 };
 
 /* Command-list for the "set/show ada" prefix command.  */
index 33506f1..3be5ef5 100644 (file)
@@ -873,7 +873,8 @@ extern const struct language_defn c_language_defn =
   default_search_name_hash,
   &c_varobj_ops,
   c_get_compile_context,
-  c_compute_program
+  c_compute_program,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 enum cplus_primitive_types {
@@ -1017,7 +1018,8 @@ extern const struct language_defn cplus_language_defn =
   cp_search_name_hash,
   &cplus_varobj_ops,
   cplus_get_compile_context,
-  cplus_compute_program
+  cplus_compute_program,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 static const char *asm_extensions[] =
@@ -1070,7 +1072,8 @@ extern const struct language_defn asm_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 /* The following language_defn does not represent a real language.
@@ -1123,5 +1126,6 @@ extern const struct language_defn minimal_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
index 08b6380..751c521 100644 (file)
@@ -250,7 +250,8 @@ extern const struct language_defn d_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 /* Build all D language types for the specified architecture.  */
index f3a806e..77eb50a 100644 (file)
@@ -377,7 +377,8 @@ extern const struct language_defn f_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "(...)"                      /* la_struct_too_deep_ellipsis */
 };
 
 static void *
index f74cee4..b8617cb 100644 (file)
@@ -611,7 +611,8 @@ extern const struct language_defn go_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 static void *
index 954e4c2..da8dd1b 100644 (file)
@@ -876,7 +876,8 @@ const struct language_defn unknown_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 /* These two structs define fake entries for the "local" and "auto"
@@ -926,7 +927,8 @@ const struct language_defn auto_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 \f
index 3e0bc9d..261f5a3 100644 (file)
@@ -449,6 +449,12 @@ struct language_defn
                                       struct gdbarch *gdbarch,
                                       const struct block *expr_block,
                                       CORE_ADDR expr_pc);
+
+    /* This string is used by the 'set print max-depth' setting.  When GDB
+       replaces a struct or union (during value printing) that is "too
+       deep" this string is displayed instead.  */
+    const char *la_struct_too_deep_ellipsis;
+
   };
 
 /* Pointer to the language_defn for our current language.  This pointer
index b4eb262..9f2a97d 100644 (file)
@@ -398,7 +398,8 @@ extern const struct language_defn m2_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 static void *
index 1853a69..af92e55 100644 (file)
@@ -408,7 +408,8 @@ extern const struct language_defn objc_language_defn = {
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 /*
index c1ea66e..c95bf05 100644 (file)
@@ -1086,7 +1086,8 @@ extern const struct language_defn opencl_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
 static void *
index 9340861..0b85f70 100644 (file)
@@ -459,5 +459,6 @@ extern const struct language_defn pascal_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };
index 9a123c3..8faafd4 100644 (file)
@@ -2141,5 +2141,6 @@ extern const struct language_defn rust_language_defn =
   default_search_name_hash,
   &default_varobj_ops,
   NULL,
-  NULL
+  NULL,
+  "{...}"                      /* la_struct_too_deep_ellipsis */
 };