[binutils-gdb/gdb-9-branch] Add constructor to stap_static_probe_ops

Tom Tromey tromey@sourceware.org
Tue Jan 7 16:49:00 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3c473fad8f153feee08dce0d79f0b1119a7be2a6

commit 3c473fad8f153feee08dce0d79f0b1119a7be2a6
Author: Tom Tromey <tromey@adacore.com>
Date:   Thu Dec 19 11:35:22 2019 -0700

    Add constructor to stap_static_probe_ops
    
    PR build/24937 concerns an error given by the clang provided by a
    particular version of macOS.  In particular, it reports
    
        error: default initialization of an object of const type 'const
        stap_static_probe_ops' without a user-provided default constructor
    
    Although (at least according to sources I found online) this was
    resolved as a bug in the standard, it seemed simple enough to work
    around this.
    
    Given that this is a trivial build fix, I think it should go on the
    gdb 9 branch as well.
    
    2020-01-07  Tom Tromey  <tromey@adacore.com>
    
    	PR build/24937:
    	* stap-probe.c (class stap_static_probe_ops): Add constructor.
    
    Change-Id: I18f180c17850f420e9b66afc67f9cb3d8dceb0b3

Diff:
---
 gdb/ChangeLog    | 5 +++++
 gdb/stap-probe.c | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 37b0a77..4ce7ef4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-07  Tom Tromey  <tromey@adacore.com>
+
+	PR build/24937:
+	* stap-probe.c (class stap_static_probe_ops): Add constructor.
+
 2020-01-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* stack.c (print_frame_info): Move disassemble_next_line code
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index 806725c..39da290 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -101,6 +101,12 @@ struct stap_probe_arg
 class stap_static_probe_ops : public static_probe_ops
 {
 public:
+  /* We need a user-provided constructor to placate some compilers.
+     See PR build/24937.  */
+  stap_static_probe_ops ()
+  {
+  }
+
   /* See probe.h.  */
   bool is_linespec (const char **linespecp) const override;



More information about the Gdb-cvs mailing list