diff options
author | Tom Tromey <tromey@adacore.com> | 2023-08-31 07:33:34 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-15 07:39:47 -0600 |
commit | fe26aa95336c0ddec01b407b990caf2c758fd93f (patch) | |
tree | 5b64d93e18fd62fe5a8505073f44d3cb70a4fa11 | |
parent | 0a43fbaa23a5eaf4254a51fa43ef61a6e28c9bd6 (diff) | |
download | gdb-fe26aa95336c0ddec01b407b990caf2c758fd93f.zip gdb-fe26aa95336c0ddec01b407b990caf2c758fd93f.tar.gz gdb-fe26aa95336c0ddec01b407b990caf2c758fd93f.tar.bz2 |
Rename split_style::DOT
This renames split_style::DOT, to avoid name clashes when building gdb
with an old version of Bison (2.3, the version available on macOS).
In particular the error looks like:
./split-name.h:34:3: error: expected identifier
DOT,
^
m2-exp.c:163:13: note: expanded from macro 'DOT'
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30286
-rw-r--r-- | gdb/dwarf2/cooked-index.c | 2 | ||||
-rw-r--r-- | gdb/split-name.c | 2 | ||||
-rw-r--r-- | gdb/split-name.h | 5 | ||||
-rw-r--r-- | gdb/symtab.h | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index d653126..58ea541 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -267,7 +267,7 @@ cooked_index_shard::handle_gnat_encoded_entry (cooked_index_entry *entry, if (canonical.empty ()) return {}; std::vector<gdb::string_view> names = split_name (canonical.c_str (), - split_style::DOT); + split_style::DOT_STYLE); gdb::string_view tail = names.back (); names.pop_back (); diff --git a/gdb/split-name.c b/gdb/split-name.c index a50a6fa..0253b3c 100644 --- a/gdb/split-name.c +++ b/gdb/split-name.c @@ -58,7 +58,7 @@ split_name (const char *name, split_style style) } break; - case split_style::DOT: + case split_style::DOT_STYLE: /* D and Go-style names. */ for (const char *iter = strchr (name, '.'); iter != nullptr; diff --git a/gdb/split-name.h b/gdb/split-name.h index 47896cc..7648cf9 100644 --- a/gdb/split-name.h +++ b/gdb/split-name.h @@ -30,8 +30,9 @@ enum class split_style NONE, /* C++ style, with "::" and template parameter intelligence. */ CXX, - /* Split at ".". Used by Ada, Go, D. */ - DOT, + /* Split at ".". Used by Ada, Go, D. This has a funny name to work + around a bug in Bison 2.3, which is used on macOS. */ + DOT_STYLE, /* Split at "__". Used by Ada encoded names. */ UNDERSCORE, }; diff --git a/gdb/symtab.h b/gdb/symtab.h index ca3b1a4..8f58780 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -305,7 +305,7 @@ class lookup_name_info final break; case language_d: case language_go: - style = split_style::DOT; + style = split_style::DOT_STYLE; break; } return ::split_name (language_lookup_name (lang), style); |