public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/6] Use gdb:array_view in call_function_by_hand & friends
Date: Wed, 17 Oct 2018 01:45:00 -0000	[thread overview]
Message-ID: <9f71d5fe-f30f-3470-5bbf-0ae21b93978a@simark.ca> (raw)
In-Reply-To: <20181015151115.6356-2-palves@redhat.com>

On 2018-10-15 11:11 a.m., Pedro Alves wrote:
> This replaces a few uses of pointer+length with gdb::array_view, in
> call_function_by_hand and related code.
> 
> Unfortunately, due to -Wnarrowing, there are places where we can't
> brace-initialize an gdb::array_view without an ugly-ish cast.  To
> avoid the cast, this patch introduces a gdb::make_array_view function.
> Unit tests included.
> 
> This patch in isolation may not look so interesting, due to
> gdb::make_array_view uses, but I think it's still worth it.  Some of
> the gdb::make_array_view calls disappear down the series, and others
> could be eliminated with more (non-trivial) gdb::array_view
> detangling/conversion (e.g. code around eval_call).  See this as a "we
> have to start somewhere" patch.

LGTM with two comments:

- The function doc in infcall.h should be updated
- This patch doesn't build for me, probably just one forgotten spot:

  CXX    spu-tdep.o
/home/simark/src/binutils-gdb/gdb/spu-tdep.c: In function ‘void flush_ea_cache()’:
/home/simark/src/binutils-gdb/gdb/spu-tdep.c:2043:69: error: could not convert ‘0’ from ‘int’ to ‘gdb::array_view<value*>’
       call_function_by_hand (value_from_pointer (type, addr), NULL, 0, NULL);
                                                                     ^

Simon

  reply	other threads:[~2018-10-17  1:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 15:11 [PATCH 0/6] Use gdb::array_view some more, plug leaks Pedro Alves
2018-10-15 15:11 ` [PATCH 2/6] invoke_xmethod & array_view Pedro Alves
2018-10-17 16:21   ` Simon Marchi
2018-11-21 12:47     ` Pedro Alves
2018-11-26 17:18       ` Simon Marchi
2018-11-26 17:54         ` Pedro Alves
2018-11-26 18:28           ` Simon Marchi
2018-10-15 15:11 ` [PATCH 1/6] Use gdb:array_view in call_function_by_hand & friends Pedro Alves
2018-10-17  1:45   ` Simon Marchi [this message]
2018-11-21 12:39     ` Pedro Alves
2018-10-15 15:11 ` [PATCH 3/6] Eliminate make_symbol_overload_list-related globals & cleanup Pedro Alves
2018-10-17 17:25   ` Simon Marchi
2018-11-21 12:47     ` Pedro Alves
2018-10-15 15:11 ` [PATCH 5/6] valops.c: Some more gdb::array_view Pedro Alves
2018-10-17 18:03   ` Simon Marchi
2018-11-21 12:48     ` Pedro Alves
2018-10-15 15:16 ` [PATCH 4/6] C++ify badness_vector, fix leaks Pedro Alves
2018-10-17 17:44   ` Simon Marchi
2018-11-21 12:47     ` Pedro Alves
2018-10-15 15:18 ` [PATCH 6/6] valops.c: Overload resolution code: Rename parameters/locals Pedro Alves

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=9f71d5fe-f30f-3470-5bbf-0ae21b93978a@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).