Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vasyl Vavrychuk <vvavrychuk@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix internal error on canonicalization of clang types [Re: why in cplus_demangle_operators operation sizeof is expected to be followed with space]
Date: Mon, 17 Sep 2012 08:29:00 -0000	[thread overview]
Message-ID: <CAGj4m+6jZD=jg1MGD0NRmGXGgrOSW0FK9H7pSxYd4RLxLgfcsQ@mail.gmail.com> (raw)
In-Reply-To: <20120917062647.GA2514@host2.jankratochvil.net>

Problem happening for the file

#include <cstdlib>
#include <boost/uuid/uuid_generators.hpp>
int main(int argc, char* argv[]) {
  boost::uuids::random_generator gen;
  return EXIT_SUCCESS;
}

clang++ -g -O0 sizeof-space-test.cpp
readelf -wi a.out|grep exact_unsigned_base_helper
    <4072>   DW_AT_name        : (indirect string, offset: 0x3f3e):
exact_unsigned_base_helper<sizeof(unsigned int) * 8>

but if compiled with g++ there is no such typename in dwarf

g++ -g -O0 sizeof-space-test.cpp
readelf -wi a.out|grep exact_unsigned_base_helper

Sorry, but I didn't succeed in further reducing mentioned test file.

On Mon, Sep 17, 2012 at 9:26 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Mon, 17 Sep 2012 07:49:16 +0200, Vasyl Vavrychuk wrote:
>> This looks to be not a symbol but type name.
>
> OK, reproduced [attached], patched DWARF of "int" in C++: void f(int i) {}
>
>
>> But I have found it directly in the binary. Line containing this text looks like
>
> readelf -wi
>  <1><59>: Abbrev Number: 4 (DW_TAG_base_type)
>     <5c>   DW_AT_name        : exact_unsigned_base_helper<sizeof(unsigned int) * 8>
>
>
>> Do you think the problem is in clang? Could you point out some
>> specification, so I can reference it while contacting clang people.
>
> Itanium C++ ABI does not say anything about spacing:
>         http://www.swag.uwaterloo.ca/acd/docs/ItaniumC++ABI.htm
>         (the original URL is 404 now)
>
> I guess so far it is only agreed upon between GCC and GDB, it is true GDB
> should accept any valid spacing of the language, this is also what
> cp_canonicalize_string is there for.
>
> Your patch would belons to the GCC mailing lists where libiberty/ is
> maintained.
>
> But I find more correct patch the one below.
>
> For a testcase could you provide a minimal C++ code to produce such type?
>
> No regressions on {x86_64,x86_64-m32,i686}-fedora18-linux-gnu.
>
>
> Thanks,
> Jan
>
>
> gdb/
> 2012-09-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
>
>         Fix internal error on canonicalization of clang types.
>         * cp-name-parser.y (exp): Use "sizeof ".
>
> diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
> index 6767fa5..c57ce64 100644
> --- a/gdb/cp-name-parser.y
> +++ b/gdb/cp-name-parser.y
> @@ -1183,7 +1183,7 @@ exp       :       FLOAT
>         ;
>
>  exp    :       SIZEOF '(' type ')'     %prec UNARY
> -               { $$ = d_unary ("sizeof", $3); }
> +               { $$ = d_unary ("sizeof ", $3); }
>         ;
>
>  /* C++.  */


  reply	other threads:[~2012-09-17  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAGj4m+4au-jiC2ueSyC+wEY76YRQ5zNuxfY+-mfZ39N4fnpN_g@mail.gmail.com>
     [not found] ` <20120916080035.GA28890@host2.jankratochvil.net>
     [not found]   ` <CAGj4m+46oBXSYQ-wx9g-P7yevZeMDnNNEjvADE8sRSdoWaRiVA@mail.gmail.com>
2012-09-17  6:27     ` Jan Kratochvil
2012-09-17  8:29       ` Vasyl Vavrychuk [this message]
2012-09-17 15:30         ` [patch] Fix internal error on canonicalization of clang types (+lib/gdb.exp internal error catch) Jan Kratochvil
2012-09-17 15:40           ` Doug Evans
2012-09-17 16:13             ` Jan Kratochvil
2012-09-17 19:52               ` Tom Tromey
2012-09-21 19:36                 ` Jan Kratochvil
2012-09-21 19:40                   ` Tom Tromey
2012-09-21 19:52                     ` Jan Kratochvil
2012-09-21 19:57                       ` Tom Tromey
2012-09-21 20:01                         ` [commit] " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGj4m+6jZD=jg1MGD0NRmGXGgrOSW0FK9H7pSxYd4RLxLgfcsQ@mail.gmail.com' \
    --to=vvavrychuk@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox