Fix symbol demangling for GCC 5, as reported at: https://github.com/google/glog/issues/14 Patch from: https://github.com/google/glog/pull/50 From b1639e3014996fbc7635870e013559c54e7e3b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mart=C3=ADnez=20Moreno?= Date: Thu, 13 Aug 2015 09:31:26 -0700 Subject: [PATCH] Fix ABI demangling for the GCC 5.x case. When glog is compiled with gcc-5.2 in cxx11 ABI mode, it barfs about unmangled symbols. This patches it getting inspiration from binutils and demangle.cc itself, although it may be totally wrong or maybe have to use ParseAbiTag in more places. I haven't read the spec for the symbols, though. This patch makes the demangle unit test pass correctly. --- src/demangle.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/demangle.cc b/src/demangle.cc index e858181..0f0c831 100644 --- a/src/demangle.cc +++ b/src/demangle.cc @@ -439,6 +439,7 @@ static bool ParseExprPrimary(State *state); static bool ParseLocalName(State *state); static bool ParseDiscriminator(State *state); static bool ParseSubstitution(State *state); +static bool ParseAbiTag(State *state); // Implementation note: the following code is a straightforward // translation of the Itanium C++ ABI defined in BNF with a couple of @@ -567,6 +568,8 @@ static bool ParseNestedName(State *state) { static bool ParsePrefix(State *state) { bool has_something = false; while (true) { + if (ParseAbiTag(state)) + continue; MaybeAppendSeparator(state); if (ParseTemplateParam(state) || ParseSubstitution(state) || @@ -585,6 +588,22 @@ static bool ParsePrefix(State *state) { return true; } +// ::= B +static bool ParseAbiTag(State *state) { + State copy = *state; + + Append(state, "[", 1); + if (ParseOneCharToken(state, 'B') && + ParseSourceName(state)) + { + Append(state, "]", 1); + return true; + } + + *state = copy; + return false; +} + // ::= // ::= // ::= 52ea1b832c37aae4ac26da'>gnu/packages/man.scm
AgeCommit message (Expand)Author
2022-03-22gnu: man-db: Simplify 'patch-test-shebangs' phase....Maxim Cournoyer
2022-03-21gnu: man-db: Update to 2.10.2, enable support for zstd and libseccomp....Maxim Cournoyer
2022-01-10gnu: help2man: Update to 1.48.5....Maxim Cournoyer
2022-01-08gnu: man-db: Fix cross-compilation....Tobias Geerinckx-Rice
2022-01-08gnu: man-db: Use G-expressions....Tobias Geerinckx-Rice
2021-12-13gnu: Simplify package inputs....Ludovic Courtès
2021-11-21gnu: help2man: Resurrect cross-building....Jan (janneke) Nieuwenhuizen
2021-10-12Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe
2021-10-04gnu: xmltoman: Fix build....Guillaume Le Vaillant
2021-09-24gnu: mandoc: Update to 1.14.6....Tobias Geerinckx-Rice
2021-09-17Merge branch 'master' into core-updates-frozen...Marius Bakke
2021-09-07gnu: mandoc: Add $MANPATH to native-search-paths....Milkey Mouse
2021-09-07Merge branch 'master' into core-updates-frozenLudovic Courtès
2021-08-27gnu: man-pages: Update to 5.13....Tobias Geerinckx-Rice
2021-07-18Merge branch 'master' into core-updatesLudovic Courtès
2021-06-29gnu: man-pages: Update to 5.12....Tobias Geerinckx-Rice
2021-05-22gnu: help2man: Update to 1.48.3....Marius Bakke
2021-04-16Merge remote-tracking branch 'origin/master' into core-updates...Efraim Flashner