]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Update w/HEAD.
authorKeith Seitz <keiths@redhat.com>
Wed, 31 May 2017 17:57:08 +0000 (10:57 -0700)
committerKeith Seitz <keiths@redhat.com>
Wed, 31 May 2017 19:48:33 +0000 (12:48 -0700)
Problems:
gdb/c-lang.c
gdb/language.c

23 files changed:
1  2 
gdb/Makefile.in
gdb/NEWS
gdb/ada-lang.c
gdb/c-lang.c
gdb/c-lang.h
gdb/d-lang.c
gdb/doc/gdb.texinfo
gdb/f-lang.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/go-lang.c
gdb/language.c
gdb/language.h
gdb/linespec.c
gdb/m2-lang.c
gdb/mdebugread.c
gdb/objc-lang.c
gdb/opencl-lang.c
gdb/p-lang.c
gdb/rust-lang.c
gdb/symtab.c
gdb/symtab.h
gdb/xcoffread.c

diff --cc gdb/Makefile.in
Simple merge
diff --cc gdb/NEWS
Simple merge
diff --cc gdb/ada-lang.c
index cf20ee3088c3f0d01e40d489b2f0d537d67994cb,25c49c589fc7a64292138f764d03f6b4291cf491..34e087e828d12c9368d3723972e80fcb292b4205
@@@ -14047,9 -14047,9 +14047,10 @@@ const struct language_defn ada_language
    ada_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    ada_get_symbol_name_cmp,    /* la_get_symbol_name_cmp */
    ada_iterate_over_symbols,
 +  default_compute_string_hash,
    &ada_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/c-lang.c
index e2df25ecc52cd760b6c0093b9efcd8cca7d82908,a6d533d082feec8a233a25f45c787cc8d18522d5..3628ebed33d1bf8acd0813f59ebadbad31c9f309
@@@ -715,69 -712,18 +715,80 @@@ evaluate_subexp_c (struct type *expect_
      }
    return evaluate_subexp_standard (expect_type, exp, pos, noside);
  }
\f
+ /* la_watch_location_expression for C.  */
+ gdb::unique_xmalloc_ptr<char>
+ c_watch_location_expression (struct type *type, CORE_ADDR addr)
+ {
+   type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type)));
+   std::string name = type_to_string (type);
+   return gdb::unique_xmalloc_ptr<char>
+     (xstrprintf ("* (%s *) %s", name.c_str (), core_addr_to_string (addr)));
+ }
  
 +/* Compute the C++ hash for STRING0.
 +
 +   For dictionaries, we group like-symbols together.
 +   That means that all templates with the same unparameterized names
 +   must yield the same hash.  Likewise, overloaded functions must also
 +   yield the same hash.
 +
 +   The following code deals largely with templates.  The dreaded
 +   strcmp_iw already enforces overloads to be grouped.  */
 +
 +static unsigned int
 +cplus_compute_string_hash (const char *string0)
 +{
 +  /* If '<' doesn't appear at all in STRING), there is no way we could
 +     be dealing with a template name.  */
 +  if (find_toplevel_char (string0, '<') == NULL)
 +    return default_compute_string_hash (string0);
 +
 +  /* Locate the last qualified component of STRING0.  */
 +  const char *p = find_toplevel_string (string0, "::");
 +  const char *last_scope = NULL;
 +
 +  while (p != NULL)
 +    {
 +      last_scope = p;
 +      p = find_toplevel_string (p + 2, "::");
 +    }
 +
 +  /* last_scope points to the last "::".  If NULL, then no scope operator
 +     was seen in STRING0, and we use the entire string.  */
 +  if (last_scope == NULL)
 +    last_scope = string0;
 +
 +  /* Find a possible template parameter list.  Valid operators will be
 +     dealt with later.  */
 +  p = find_toplevel_char (last_scope, '<');
 +
 +  /* P points to toplevel '<', but it could still be a valid operator
 +     and not be a template at all.  */
 +  if ((p - last_scope) > 8 && strncmp (p - 8, "operator", 8) == 0)
 +    {
 +      /* Skip <,=.  */
 +      while (strchr ("<=", *p) != NULL)
 +      ++p;
 +
 +      /* Check if this operator contains a template parameter list marker.  */
 +      p = find_toplevel_char (p, '<');
 +    }
 +
 +  /* If NULL, the string represents an operator (<, <=, <<, <<=) and is not
 +     a template function itself.  */
 +  if (p == NULL)
 +    return default_compute_string_hash (string0);
 +
 +  char *copy = ASTRDUP (string0);
 +
 +  copy[p - string0] = '\0';
 +
 +  /* It is a template, compute the hash based only until P.  */
 +  return default_compute_string_hash (copy);
 +}
 +
  \f
  /* Table mapping opcodes into strings for printing operators
     and precedences of the operators.  */
@@@ -929,9 -875,9 +940,10 @@@ const struct language_defn c_language_d
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &c_varobj_ops,
    c_get_compile_context,
    c_compute_program,
@@@ -1073,12 -1019,12 +1085,13 @@@ const struct language_defn cplus_langua
    default_print_array_index,
    cp_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  cplus_compute_string_hash,
    &cplus_varobj_ops,
 -  NULL,
 -  NULL,
 +  cplus_get_compile_context,
 +  cplus_compute_program,
    LANG_MAGIC
  };
  
@@@ -1126,9 -1072,9 +1139,10 @@@ const struct language_defn asm_language
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
@@@ -1179,9 -1125,9 +1193,10 @@@ const struct language_defn minimal_lang
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/c-lang.h
Simple merge
diff --cc gdb/d-lang.c
index 30731b75017545add1edd564c8465d20df73e263,434b2e6ba5f3b4399ccc327c1b4e7926fc544f59..44163432f6f1f464eb5e7ec26ea3c48452dd92f9
@@@ -244,9 -244,9 +244,10 @@@ static const struct language_defn d_lan
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
Simple merge
diff --cc gdb/f-lang.c
index c2807a12bc9c6ebded1602b838022f9e54f28230,a9663d415bcac1e0f247f4274bfff462ecc34e86..b623f19593d6aaafc0866e8d9180de7ec21ef6a8
@@@ -287,9 -287,9 +287,10 @@@ const struct language_defn f_language_d
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/gdbtypes.c
Simple merge
diff --cc gdb/gdbtypes.h
Simple merge
diff --cc gdb/go-lang.c
index 03aba11bdee3f4ad47c1174d219cb689be0c4450,3b80cec4452baa1bb1d235ad05e9378d6456289b..f38e8454a504b0fc0f0d7e8a02b1f2ded61d17d9
@@@ -605,9 -605,9 +605,10 @@@ static const struct language_defn go_la
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/language.c
index ed441f1de202efc595254caa8992f6191e489ddf,e9d9803aeee7401efc4a9ae1655785fe6f83bafa..844ed7ed6c5994d8d3a10ca85168101449886e31
@@@ -43,7 -43,7 +43,8 @@@
  #include "symfile.h"
  #include "cp-support.h"
  #include "frame.h"
+ #include "c-lang.h"
 +#include "dictionary.h"               /* for dict_hash  */
  
  extern void _initialize_language (void);
  
@@@ -868,9 -860,9 +869,10 @@@ const struct language_defn unknown_lang
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
@@@ -918,9 -910,9 +920,10 @@@ const struct language_defn auto_languag
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
@@@ -966,9 -958,9 +969,10 @@@ const struct language_defn local_langua
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/language.h
Simple merge
diff --cc gdb/linespec.c
Simple merge
diff --cc gdb/m2-lang.c
index 684393f24e4c3c77fc480a39b480a7669a440cec,35840bf56f91b7bf0a5cc6f8de29a2743d8aaf87..d9c8b1f38d026f97bcc2f13142a1bbd271d94f0d
@@@ -393,9 -393,9 +393,10 @@@ const struct language_defn m2_language_
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
Simple merge
diff --cc gdb/objc-lang.c
index e81cba809cb5945fb06f86691c2490530882774b,934d9c6d168fa5f797767b62f56143851326012c..b20e0888d20597ab4c54e109eb12ad6a658c1e20
@@@ -402,9 -402,9 +402,10 @@@ const struct language_defn objc_languag
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
index bd2c8380115d73ba96a3740c1d4f75e72daa69dd,df57b61529981acee4b2bd231427d01e42735bbf..54c19af944249031573dc2abc05e4d3ceb4bffeb
@@@ -1082,9 -1082,9 +1082,10 @@@ const struct language_defn opencl_langu
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/p-lang.c
index 89ba27d7cb94b08deb3b2720f810bc4315c9d901,c4fe2f6c2a02e99ed1ac61c488833e23571490db..5ff9c22d518184bdd1409f4b62f905d03832b8ea
@@@ -455,9 -456,9 +456,10 @@@ const struct language_defn pascal_langu
    default_print_array_index,
    default_pass_by_reference,
    default_get_string,
+   c_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/rust-lang.c
index 1141f2b56231784e79b0d34ca3296b680a1d1e8e,d4cda1fc257f270789f0124408a6375d16bfbbff..4b1e3ec51ddf7e05f0a5152048270bd94a17f074
@@@ -2176,9 -2189,9 +2189,10 @@@ static const struct language_defn rust_
    default_print_array_index,
    default_pass_by_reference,
    c_get_string,
+   rust_watch_location_expression,
    NULL,                               /* la_get_symbol_name_cmp */
    iterate_over_symbols,
 +  default_compute_string_hash,
    &default_varobj_ops,
    NULL,
    NULL,
diff --cc gdb/symtab.c
Simple merge
diff --cc gdb/symtab.h
index d464e593854e60c2f52b1d2ae5ef1b4dd90d78c5,341deca56fc95074f7db68c8a6ddf990d474b006..78a0cfc8ead48e4eeccdc8ce72217d0992c6dee4
@@@ -1648,7 -1626,7 +1648,7 @@@ std::vector<CORE_ADDR> find_pcs_for_sym
     true to indicate that LA_ITERATE_OVER_SYMBOLS should continue
     iterating, or false to indicate that the iteration should end.  */
  
- typedef bool (symbol_found_callback_ftype) (struct block_symbol *sym);
 -typedef bool (symbol_found_callback_ftype) (symbol *sym);
++typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym);
  
  void iterate_over_symbols (const struct block *block, const char *name,
                           const domain_enum domain,
diff --cc gdb/xcoffread.c
Simple merge