+2020-10-12 Gary Benson <gbenson@redhat.com>
+
+ * gdb.base/msym-bp.c (foo): Add __attribute__ ((used)).
+ * gdb.base/msym-bp-2.c (foo): Likewise.
+ * gdb.base/msym-lang.c (foo): Likewise.
+ * gdb.base/msym-lang-main.c (foo): Likewise.
+ * gdb.base/symtab-search-order-1.c (static_global): Likewise.
+ * gdb.guile/scm-pretty-print.c (eval_func): Likewise.
+ * gdb.mi/mi-sym-info-1.c (global_f1): Likewise.
+ * gdb.mi/mi-sym-info-2.c (global_f1, var1, var2): Likewise.
+ * gdb.multi/watchpoint-multi-exit.c (globalvar): Likewise.
+ * gdb.python/py-as-string.c (enum_valid, enum_invalid): Likewise.
+ * gdb.python/py-objfile.c (static_var): Likewise.
+ * gdb.python/py-symbol.c (rr): Likewise.
+ * gdb.python/py-symbol-2.c (anon, rr): Likewise.
+ * gdb.mi/mi-sym-info.exp (lineno1, lineno2): Updated.
+
2020-10-11 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.fortran/mixed-lang-stack.exp (run_tests): Update expected
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-void
+void __attribute__ ((used))
foo (void)
{
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-static void
+static void __attribute__ ((used))
foo (void)
{
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-static int
+static int __attribute__ ((used))
foo (void)
{
return 2;
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-static int
+static int __attribute__ ((used))
foo (void)
{
return 1;
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-static int static_global = 23;
+static int __attribute__ ((used)) static_global = 23;
struct string_repr string_1 = { { "one" } };
struct string_repr string_2 = { { "two" } };
-static int
+static int __attribute__ ((used))
eval_func (int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8)
{
return p1;
extern float global_f2;
static int global_i1;
-static float global_f1;
+static float __attribute__ ((used)) global_f1;
typedef int my_int_t;
along with this program. If not, see <http://www.gnu.org/licenses/>. */
static int global_i1;
-static float global_f1;
+static float __attribute__ ((used)) global_f1;
int global_i2;
int global_f2;
typedef char another_char_t;
typedef short another_short_t;
-static another_char_t var1;
-static another_short_t var2;
+static another_char_t __attribute__ ((used)) var1;
+static another_short_t __attribute__ ((used)) var2;
"118\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]*$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"21\",name=\"global_f2\",type=\"int\",description=\"int global_f2;\"\}\\\]\}\\\]\}" \
"List all variables matching pattern global_f2"
-set lineno1 [gdb_get_line_number "static float global_f1;" ${srcfile}]
-set lineno2 [gdb_get_line_number "static float global_f1;" ${srcfile2}]
+set lineno1 [gdb_get_line_number "static float __attribute__ ((used)) global_f1;" ${srcfile}]
+set lineno2 [gdb_get_line_number "static float __attribute__ ((used)) global_f1;" ${srcfile2}]
mi_gdb_test "119-symbol-info-variables --type float --name ^global_" \
"119\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]*$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"25\",name=\"global_f1\",type=\"float\",description=\"static float global_f1;\"\}\\\]\},\{filename=\"\[^\"\]*$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"19\",name=\"global_f1\",type=\"float\",description=\"static float global_f1;\"\}\\\]\}\\\]\}" \
"List all variables matching type float"
#include <sys/wait.h>
/* GDB sets watchpoint here. */
-static volatile int globalvar;
+static volatile int __attribute__ ((used)) globalvar;
/* Whether it's expected that the child exits with a signal, vs
exiting normally. GDB sets this. */
ENUM_VALUE_D,
};
-static enum EnumType enum_valid = ENUM_VALUE_B;
-static enum EnumType enum_invalid = (enum EnumType) 20;
+static enum EnumType __attribute__ ((used)) enum_valid = ENUM_VALUE_B;
+static enum EnumType __attribute__ ((used)) enum_invalid = (enum EnumType) 20;
int
main ()
along with this program. If not, see <http://www.gnu.org/licenses/>. */
int global_var = 42;
-static int static_var = 50;
+static int __attribute__ ((used)) static_var = 50;
int
main ()
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-static int rr = 99; /* line of other rr */
+static int __attribute__ ((used)) rr = 99; /* line of other rr */
void
function_in_other_file (void)
};
namespace {
- int anon = 10;
+ int __attribute__ ((used)) anon = 10;
};
#endif
#endif
int qq = 72; /* line of qq */
-static int rr = 42; /* line of rr */
+static int __attribute__ ((used)) rr = 42; /* line of rr */
int func (int arg)
{