public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl
@ 2019-12-09 10:09 Wataru Ashihara (Code Review)
  2019-12-09 13:04 ` Simon Marchi (Code Review)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wataru Ashihara (Code Review) @ 2019-12-09 10:09 UTC (permalink / raw)
  To: gdb-patches

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/751
......................................................................

gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl

This should be the type of startup_with_shell, whose type was changed
from int to bool at commit 80fd28264.

This fixes the build on macOS:

      CXX    darwin-nat.o
    In file included from ../../gdb/darwin-nat.c:22:
    In file included from ../../gdb/top.h:25:
    In file included from ../../gdb/value.h:23:
    In file included from ../../gdb/frame.h:72:
    In file included from ../../gdb/language.h:26:
    In file included from ../../gdb/symtab.h:33:
    ../../gdb/gdbsupport/gdb_optional.h:155:19: error: no matching constructor for initialization of 'scoped_restore_tmpl<int>'
        new (&m_item) T (std::forward<Args>(args)...);
                      ^  ~~~~~~~~~~~~~~~~~~~~~~~~
    ../../gdb/darwin-nat.c:1995:31: note: in instantiation of function template specialization 'gdb::optional<scoped_restore_tmpl<int> >::emplace<bool *, int>' requested here
              restore_startup_with_shell.emplace (&startup_with_shell, 0);
                                         ^
    ../../gdb/gdbsupport/scoped_restore.h:69:3: note: candidate constructor template not viable: no known conversion from 'bool *' to 'int *' for 1st argument
      scoped_restore_tmpl (T *var, T2 value)
      ^
    ../../gdb/gdbsupport/scoped_restore.h:57:3: note: candidate constructor not viable: requires single argument 'var', but 2 arguments were provided
      scoped_restore_tmpl (T *var)
      ^
    ../../gdb/gdbsupport/scoped_restore.h:76:3: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
      scoped_restore_tmpl (const scoped_restore_tmpl<T> &other)
      ^
    1 error generated.

gdb/ChangeLog
2019-12-08  Wataru Ashihara  <wataash@wataash.com>

	* darwin-nat.c (darwin_nat_target::create_inferior): Fix
	template argument for scoped_restore_tmpl from bool to int.

Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
---
M gdb/ChangeLog
M gdb/darwin-nat.c
2 files changed, 6 insertions(+), 1 deletion(-)



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ee45156..9709d0d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-08  Wataru Ashihara  <wataash@wataash.com>
+
+	* darwin-nat.c (darwin_nat_target::create_inferior): Fix
+	template argument for scoped_restore_tmpl from bool to int.
+
 2019-12-07  Keith Seitz  <keiths@redhat.com>
 
 	* build-id.c (build_id_bfd_get): Permit bfd_core, too.
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 123d2c0..ecc7fc0 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1985,7 +1985,7 @@
 				    const std::string &allargs,
 				    char **env, int from_tty)
 {
-  gdb::optional<scoped_restore_tmpl<int>> restore_startup_with_shell;
+  gdb::optional<scoped_restore_tmpl<bool>> restore_startup_with_shell;
 
   if (startup_with_shell && may_have_sip ())
     {

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
Gerrit-Change-Number: 751
Gerrit-PatchSet: 1
Gerrit-Owner: Wataru Ashihara <wataash@wataash.com>
Gerrit-MessageType: newchange

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [review] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl
  2019-12-09 10:09 [review] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl Wataru Ashihara (Code Review)
@ 2019-12-09 13:04 ` Simon Marchi (Code Review)
  2019-12-09 13:05 ` [pushed] " Sourceware to Gerrit sync (Code Review)
  2019-12-09 13:17 ` [review v2] " Wataru Ashihara (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi (Code Review) @ 2019-12-09 13:04 UTC (permalink / raw)
  To: Wataru Ashihara, gdb-patches

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/751
......................................................................


Patch Set 1: Code-Review+2

Thanks for the patch, it LGTM. I'll push it, since I presume you don't have push access.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
Gerrit-Change-Number: 751
Gerrit-PatchSet: 1
Gerrit-Owner: Wataru Ashihara <wataash@wataash.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Mon, 09 Dec 2019 13:04:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl
  2019-12-09 10:09 [review] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl Wataru Ashihara (Code Review)
  2019-12-09 13:04 ` Simon Marchi (Code Review)
@ 2019-12-09 13:05 ` Sourceware to Gerrit sync (Code Review)
  2019-12-09 13:17 ` [review v2] " Wataru Ashihara (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-12-09 13:05 UTC (permalink / raw)
  To: Wataru Ashihara, Simon Marchi, gdb-patches

Sourceware to Gerrit sync has submitted this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/751
......................................................................

gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl

This should be the type of startup_with_shell, whose type was changed
from int to bool at commit 80fd28264.

This fixes the build on macOS:

      CXX    darwin-nat.o
    In file included from ../../gdb/darwin-nat.c:22:
    In file included from ../../gdb/top.h:25:
    In file included from ../../gdb/value.h:23:
    In file included from ../../gdb/frame.h:72:
    In file included from ../../gdb/language.h:26:
    In file included from ../../gdb/symtab.h:33:
    ../../gdb/gdbsupport/gdb_optional.h:155:19: error: no matching constructor for initialization of 'scoped_restore_tmpl<int>'
        new (&m_item) T (std::forward<Args>(args)...);
                      ^  ~~~~~~~~~~~~~~~~~~~~~~~~
    ../../gdb/darwin-nat.c:1995:31: note: in instantiation of function template specialization 'gdb::optional<scoped_restore_tmpl<int> >::emplace<bool *, int>' requested here
              restore_startup_with_shell.emplace (&startup_with_shell, 0);
                                         ^
    ../../gdb/gdbsupport/scoped_restore.h:69:3: note: candidate constructor template not viable: no known conversion from 'bool *' to 'int *' for 1st argument
      scoped_restore_tmpl (T *var, T2 value)
      ^
    ../../gdb/gdbsupport/scoped_restore.h:57:3: note: candidate constructor not viable: requires single argument 'var', but 2 arguments were provided
      scoped_restore_tmpl (T *var)
      ^
    ../../gdb/gdbsupport/scoped_restore.h:76:3: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
      scoped_restore_tmpl (const scoped_restore_tmpl<T> &other)
      ^
    1 error generated.

gdb/ChangeLog
2019-12-08  Wataru Ashihara  <wataash@wataash.com>

	* darwin-nat.c (darwin_nat_target::create_inferior): Fix
	template argument for scoped_restore_tmpl from bool to int.

Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
---
M gdb/ChangeLog
M gdb/darwin-nat.c
2 files changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Simon Marchi: Looks good to me, approved


diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ee45156..9709d0d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-08  Wataru Ashihara  <wataash@wataash.com>
+
+	* darwin-nat.c (darwin_nat_target::create_inferior): Fix
+	template argument for scoped_restore_tmpl from bool to int.
+
 2019-12-07  Keith Seitz  <keiths@redhat.com>
 
 	* build-id.c (build_id_bfd_get): Permit bfd_core, too.
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 123d2c0..ecc7fc0 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1985,7 +1985,7 @@
 				    const std::string &allargs,
 				    char **env, int from_tty)
 {
-  gdb::optional<scoped_restore_tmpl<int>> restore_startup_with_shell;
+  gdb::optional<scoped_restore_tmpl<bool>> restore_startup_with_shell;
 
   if (startup_with_shell && may_have_sip ())
     {

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
Gerrit-Change-Number: 751
Gerrit-PatchSet: 2
Gerrit-Owner: Wataru Ashihara <wataash@wataash.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: merged

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [review v2] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl
  2019-12-09 10:09 [review] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl Wataru Ashihara (Code Review)
  2019-12-09 13:04 ` Simon Marchi (Code Review)
  2019-12-09 13:05 ` [pushed] " Sourceware to Gerrit sync (Code Review)
@ 2019-12-09 13:17 ` Wataru Ashihara (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Wataru Ashihara (Code Review) @ 2019-12-09 13:17 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

Wataru Ashihara has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/751
......................................................................


Patch Set 2:

Thanks!


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
Gerrit-Change-Number: 751
Gerrit-PatchSet: 2
Gerrit-Owner: Wataru Ashihara <wataash@wataash.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Reviewer: Wataru Ashihara <wataash@wataash.com>
Gerrit-Comment-Date: Mon, 09 Dec 2019 13:17:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-09 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 10:09 [review] gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl Wataru Ashihara (Code Review)
2019-12-09 13:04 ` Simon Marchi (Code Review)
2019-12-09 13:05 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-09 13:17 ` [review v2] " Wataru Ashihara (Code Review)

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).