Avoid non-C++-enabled babeltrace versions
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 27 Apr 2016 13:52:16 +0000 (15:52 +0200)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 27 Apr 2016 13:52:16 +0000 (15:52 +0200)
In some babeltrace versions before 1.2.0, the header file iterator.h
declares the enum values `BT_SEEK_*' within the struct declaration of
bt_iter_pos.  The enum values are supposed to be globally-scoped, which
works for C, but not for C++.  Later babeltrace versions declare the
enum outside the struct:

  https://lists.lttng.org/pipermail/lttng-dev/2013-September/021411.html

Now that GDB is compiled with C++, the GDB build fails on a system with
an affected babeltrace version: the compiler complains about a missing
declaration of BT_SEEK_BEGIN in ctf.c.

This patch enhances the configure check to recognize such babeltrace
versions as unusable for GDB.

gdb/ChangeLog:

* configure.ac: Enhance configure check for babeltrace to reject
non-C++-enabled versions.
* configure: Regenerate.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 1335563fae654d626eb7a6ffd7d4c30f3da63d1f..df10de45abda43d36e9377b0ce4df988befe74ee 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-27  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * configure.ac: Enhance configure check for babeltrace to reject
+       non-C++-enabled versions.
+       * configure: Regenerate.
+
 2016-04-26  Sanimir Agovic  <sanimir.agovic@intel.com>
            Keven Boell  <keven.boell@intel.com>
            Bernhard Heckel  <bernhard.heckel@intel.com>
index 3cf95e769986d78da5b81f77c2c6bd7abb76e2b6..228cb99a77e69475420f19c80f4a99e91eb3e1d6 100755 (executable)
@@ -16390,6 +16390,7 @@ struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL));
                        struct bt_ctf_event *event = NULL;
                        const struct bt_definition *scope;
 
+                       pos.type = BT_SEEK_BEGIN;
                        bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
                        scope = bt_ctf_get_top_level_scope (event,
                                                           BT_STREAM_EVENT_HEADER);
index 70452d3ff056e11b533988595db9b3c62baf94f7..3aa132aea418401f5e4304e679d608fcc107e38a 100644 (file)
@@ -2286,6 +2286,7 @@ else
                        struct bt_ctf_event *event = NULL;
                        const struct bt_definition *scope;
 
+                       pos.type = BT_SEEK_BEGIN;
                        bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
                        scope = bt_ctf_get_top_level_scope (event,
                                                           BT_STREAM_EVENT_HEADER);