Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Caroline Tice <cmtice@google.com>
To: Simon Marchi <simark@simark.ca>
Cc: Eric Christopher <echristo@google.com>,
	Tom Tromey <tom@tromey.com>,
	 Caroline Tice via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH V5] Fix issues with reading rnglists, especially from dwo files, for DWARF v5
Date: Wed, 15 Jul 2020 09:57:33 -0700	[thread overview]
Message-ID: <CABtf2+TZd_VGvoDfpNXcStteng_XO6Lk2z0YugkxPh1tYcmCPA@mail.gmail.com> (raw)
In-Reply-To: <ae719c5a-111f-13e6-c169-4fdecf47dd32@simark.ca>

On Tue, Jul 14, 2020 at 8:15 PM Simon Marchi <simark@simark.ca> wrote:
>
> On 2020-07-14 10:04 p.m., Simon Marchi wrote:
> > I don't think I have any more comments.  Tom, are you ok with this?
>
> I just had a thought about the test, and testing in general of DWARF5 and
> split DWARF.  Right now, it's not really testing DWARF5 range lists, as the
> name implies.  It's more a general program that may happen to fail given the
> right compiler and compiler version.
>
> [In fact, could you mention (here and in the commit message) how to run your
> test case so that it fails, when the rest of your patch is not applied?  The
> full "make check" command line, plus the compiler version used to compiler
> the test case.
>
> Ideally, we would have:
>
> - one test such for the very specific case you are fixing (DW_AT_ranges inside
>   a dwo with DWARF5).  We would use the DWARF assembler in lib/dwarf.exp to
>   generate exactly what we want to test.  It would probably need to be improved
>   a bit to learn about rnglists though.
> - a new board file that tests with "-gsplit-dwarf -gdwarf5".  A bit like
>   fission.exp, but for DWARF5.  I think a plain "-gdwarf5" board file would
>   be useful too.
>
> Simon
>
>

The test program is the best I could manage under difficult
constraints.  It does (currently) generate a lexical block with a
DW_AT_ranges attribute of the form DW_FORM_rnglistx, if it is compiled
with clang.  If it is compiled with GCC, then, sadly,  the
DW_AT_ranges is not of the form DW_FORM_rnglistx, so the test always
passes.  In order to test with clang, I do:

$ export CLANG_CC="/usr/local/google3/cmtice/llvm-project/build2/bin/clang"
$ export CLANG_CXX="/usr/local/google3/cmtice/llvm-project/build2/bin/clang++"

$ make check RUNTESTFLAGS="CC_FOR_TARGET=${CLANG_CC}
CXX_FOR_TARGET=${CLANG_CXX} dw5-rnglist-test.exp"

With ToT GDB (without my patch), the result is:

Running /usr/local/google/home/cmtice/fsf-gdb.clean.obj/gdb/testsuite/../../../fsf-gdb.clean/gdb/testsuite/gdb.dwarf2/dw5-rnglist-test.exp
...
FAIL: gdb.dwarf2/dw5-rnglist-test.exp: print curr
FAIL: gdb.dwarf2/dw5-rnglist-test.exp: print *curr

=== gdb Summary ===

# of expected passes 1
# of unexpected failures 2

I did try, originally, to make this an assembly code test, as I do
understand that compilers change, and the code they generate today is
not necessarily the code they generate tomorrow.  Unfortunately the
GNU assembler cannot process the DWARF v5 that is generated by clang
(e.g. it can't handle file numbers that start at 0 instead of 1 (which
is in the DWARF v5 spec, and which clang generates); and I have not
been able to figure out a way to get GDB test to use the clang
integrated assembler.

So I'm not sure what else I can do at this point,.

-- Caroline Tice
cmtice@google.com
>


  reply	other threads:[~2020-07-15 16:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 17:16 [PATCH] " Caroline Tice
2020-06-01 20:33 ` Tom Tromey
2020-06-02 17:04   ` Caroline Tice
2020-06-03 14:49     ` Tom Tromey
2020-06-04 21:39       ` Caroline Tice
2020-06-09 23:32         ` Caroline Tice
2020-06-16 15:37           ` Caroline Tice
2020-06-18 20:27           ` Tom Tromey
2020-06-23 19:04             ` Caroline Tice
2020-07-01  0:09               ` Caroline Tice
2020-07-01  0:34               ` Simon Marchi
2020-07-01  0:36                 ` Simon Marchi
2020-07-01 19:57                   ` Caroline Tice
2020-07-02  5:41                     ` Simon Marchi
2020-07-03 22:47                       ` [PATCH V3] " Caroline Tice
2020-07-04  5:11                         ` Simon Marchi
2020-07-09 15:48                           ` [PATCH V4] " Caroline Tice
2020-07-11 17:54                             ` Simon Marchi
2020-07-14 15:47                               ` [PATCH V5] " Caroline Tice
2020-07-15  2:04                                 ` Simon Marchi
2020-07-15  3:15                                   ` Simon Marchi
2020-07-15 16:57                                     ` Caroline Tice [this message]
2020-07-15 17:04                                       ` H.J. Lu
2020-07-15 22:35                                         ` Caroline Tice
2020-07-16  2:34                                           ` Simon Marchi
2020-07-16  4:46                                             ` Caroline Tice
2020-07-16 15:41                                               ` Simon Marchi
2020-07-16 15:46                                                 ` Caroline Tice
2020-07-16 16:09                                                   ` Simon Marchi

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=CABtf2+TZd_VGvoDfpNXcStteng_XO6Lk2z0YugkxPh1tYcmCPA@mail.gmail.com \
    --to=cmtice@google.com \
    --cc=echristo@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.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