On some platforms, e.g., arm-eabi-none, we need to make certain that
malloc is linked into the program because the test suite uses function
calls requiring malloc:
(gdb) p foo101("abc")
evaluation of this expression requires the program to have a function "malloc".
gdb/testsuite/ChangeLog
* gdb.cp/oranking.cc (dummy): New function to grab malloc.
(main): Call it.
+2017-05-03 Keith Seitz <keiths@redhat.com>
+
+ * gdb.cp/oranking.cc (dummy): New function to grab malloc.
+ (main): Call it.
+
2017-05-01 Tim Wiederhake <tim.wiederhake@intel.com>
* gdb.python/py-record-btrace.exp: Rename prev_sibling and next_sibling
+#include <cstdlib>
+
+/* Make sure `malloc' is linked into the program. If we don't, tests
+ in the accompanying expect file may fail:
+
+ evaluation of this expression requires the program to have a function
+ "malloc". */
+
+void
+dummy ()
+{
+ void *p = malloc (16);
+
+ free (p);
+}
/* 1. A standard covnersion sequence is better than a user-defined sequence
which is better than an elipses conversion sequence. */
}
int main() {
+ dummy ();
+
B b;
foo0(b);
foo1(b);