libctf, testsuite: fix various warnings in tests
These warnings are all off by default, but if they do fire you get spurious ERRORs when running make check-libctf. libctf/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * testsuite/libctf-lookup/enum-symbol.c: Remove unused label. * testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused variables. * testsuite/libctf-regression/pptrtab.c: Likewise. * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise. * testsuite/libctf-writable/pptrtab.c: Likewise. * testsuite/libctf-writable/reserialize-strtab-corruption.c: Likewise. * testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix format string. * testsuite/libctf-regression/nonstatic-var-section-ld.c: Likewise. * testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust. * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix initializer.
This commit is contained in:
parent
b62d5edd0a
commit
e695879142
11 changed files with 28 additions and 18 deletions
|
@ -1,3 +1,21 @@
|
||||||
|
2021-09-27 Nick Alcock <nick.alcock@oracle.com>
|
||||||
|
|
||||||
|
* testsuite/libctf-lookup/enum-symbol.c: Remove unused label.
|
||||||
|
* testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused
|
||||||
|
variables.
|
||||||
|
* testsuite/libctf-regression/pptrtab.c: Likewise.
|
||||||
|
* testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
|
||||||
|
* testsuite/libctf-writable/pptrtab.c: Likewise.
|
||||||
|
* testsuite/libctf-writable/reserialize-strtab-corruption.c:
|
||||||
|
Likewise.
|
||||||
|
* testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix
|
||||||
|
format string.
|
||||||
|
* testsuite/libctf-regression/nonstatic-var-section-ld.c:
|
||||||
|
Likewise.
|
||||||
|
* testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust.
|
||||||
|
* testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix
|
||||||
|
initializer.
|
||||||
|
|
||||||
2021-09-27 Nick Alcock <nick.alcock@oracle.com>
|
2021-09-27 Nick Alcock <nick.alcock@oracle.com>
|
||||||
|
|
||||||
* ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt
|
* ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt
|
||||||
|
|
|
@ -12,9 +12,6 @@ main (int argc, char *argv[])
|
||||||
int err;
|
int err;
|
||||||
ctf_id_t a, b, ignore1, ignore2, tmp;
|
ctf_id_t a, b, ignore1, ignore2, tmp;
|
||||||
char *foo;
|
char *foo;
|
||||||
ctf_next_t *i = NULL;
|
|
||||||
const char *name;
|
|
||||||
int val;
|
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,9 +57,6 @@ main (int argc, char *argv[])
|
||||||
fprintf (stderr, "%s: Symbol re-lookup error (caching bug): %s\n", argv[0],
|
fprintf (stderr, "%s: Symbol re-lookup error (caching bug): %s\n", argv[0],
|
||||||
ctf_errmsg (err));
|
ctf_errmsg (err));
|
||||||
return 1;
|
return 1;
|
||||||
err:
|
|
||||||
fprintf (stderr, "Lookup failed: %s\n", ctf_errmsg (ctf_errno (fp)));
|
|
||||||
return 1;
|
|
||||||
nerr:
|
nerr:
|
||||||
fprintf (stderr, "iteration failed: %s\n", ctf_errmsg (ctf_errno (fp)));
|
fprintf (stderr, "iteration failed: %s\n", ctf_errmsg (ctf_errno (fp)));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -31,12 +31,12 @@ main (int argc, char *argv[])
|
||||||
ld -r link. */
|
ld -r link. */
|
||||||
|
|
||||||
if ((foo_type = ctf_lookup_variable (fp, "foo")) == CTF_ERR)
|
if ((foo_type = ctf_lookup_variable (fp, "foo")) == CTF_ERR)
|
||||||
printf ("Cannot look up foo\n", ctf_errmsg (ctf_errno (fp)));
|
printf ("Cannot look up foo: %s\n", ctf_errmsg (ctf_errno (fp)));
|
||||||
else
|
else
|
||||||
printf ("foo is of type %lx\n", foo_type);
|
printf ("foo is of type %lx\n", foo_type);
|
||||||
|
|
||||||
if ((bar_type = ctf_lookup_variable (fp, "bar")) == CTF_ERR)
|
if ((bar_type = ctf_lookup_variable (fp, "bar")) == CTF_ERR)
|
||||||
printf ("Cannot look up bar\n", ctf_errmsg (ctf_errno (fp)));
|
printf ("Cannot look up bar: %s\n", ctf_errmsg (ctf_errno (fp)));
|
||||||
else
|
else
|
||||||
printf ("bar is of type %lx\n", bar_type);
|
printf ("bar is of type %lx\n", bar_type);
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,12 @@ main (int argc, char *argv[])
|
||||||
should have been erased. */
|
should have been erased. */
|
||||||
|
|
||||||
if ((foo_type = ctf_lookup_variable (fp, "foo")) == CTF_ERR)
|
if ((foo_type = ctf_lookup_variable (fp, "foo")) == CTF_ERR)
|
||||||
printf ("Cannot look up foo\n", ctf_errmsg (ctf_errno (fp)));
|
printf ("Cannot look up foo: %s\n", ctf_errmsg (ctf_errno (fp)));
|
||||||
else
|
else
|
||||||
printf ("foo is of type %lx\n", foo_type);
|
printf ("foo is of type %lx\n", foo_type);
|
||||||
|
|
||||||
if ((bar_type = ctf_lookup_variable (fp, "bar")) == CTF_ERR)
|
if ((bar_type = ctf_lookup_variable (fp, "bar")) == CTF_ERR)
|
||||||
printf ("Cannot look up bar\n", ctf_errmsg (ctf_errno (fp)));
|
printf ("Cannot look up bar: %s\n", ctf_errmsg (ctf_errno (fp)));
|
||||||
else
|
else
|
||||||
printf ("bar is of type %lx\n", bar_type);
|
printf ("bar is of type %lx\n", bar_type);
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
# link: on
|
# link: on
|
||||||
# link_flags: -Wl,--ctf-variables
|
# link_flags: -Wl,--ctf-variables
|
||||||
foo is of type [0-9a-f]*
|
foo is of type [0-9a-f]*
|
||||||
Cannot look up bar
|
Cannot look up bar: No type information available for symbol.
|
||||||
foo missing from the data object section
|
foo missing from the data object section
|
||||||
|
|
|
@ -10,7 +10,6 @@ main (int argc, char *argv[])
|
||||||
ctf_next_t *i = NULL;
|
ctf_next_t *i = NULL;
|
||||||
ctf_id_t type;
|
ctf_id_t type;
|
||||||
const char *arcname;
|
const char *arcname;
|
||||||
char *type_name;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
|
|
|
@ -8,10 +8,8 @@ main (int argc, char *argv[])
|
||||||
ctf_dict_t *fp;
|
ctf_dict_t *fp;
|
||||||
ctf_archive_t *ctf;
|
ctf_archive_t *ctf;
|
||||||
ctf_dict_t *dyn;
|
ctf_dict_t *dyn;
|
||||||
ctf_next_t *i = NULL;
|
|
||||||
ctf_id_t type;
|
ctf_id_t type;
|
||||||
ctf_id_t newtype;
|
ctf_id_t newtype;
|
||||||
const char *memb;
|
|
||||||
ctf_membinfo_t mi;
|
ctf_membinfo_t mi;
|
||||||
const char *membs[] = { "bar", "baz", "foo", NULL };
|
const char *membs[] = { "bar", "baz", "foo", NULL };
|
||||||
const char **walk;
|
const char **walk;
|
||||||
|
|
|
@ -7,7 +7,7 @@ main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
ctf_dict_t *pfp;
|
ctf_dict_t *pfp;
|
||||||
ctf_dict_t *cfp;
|
ctf_dict_t *cfp;
|
||||||
ctf_id_t base, base2, ptr, ptr2, type, last_type;
|
ctf_id_t base, base2, ptr, type, last_type;
|
||||||
ctf_encoding_t encoding = { CTF_INT_SIGNED, 0, sizeof (int) };
|
ctf_encoding_t encoding = { CTF_INT_SIGNED, 0, sizeof (int) };
|
||||||
ctf_encoding_t encoding2 = { CTF_INT_SIGNED, 0, sizeof (long) };
|
ctf_encoding_t encoding2 = { CTF_INT_SIGNED, 0, sizeof (long) };
|
||||||
char *type_name;
|
char *type_name;
|
||||||
|
|
|
@ -13,7 +13,6 @@ main (int argc, char *argv[])
|
||||||
ctf_snapshot_id_t snap;
|
ctf_snapshot_id_t snap;
|
||||||
unsigned char *foo;
|
unsigned char *foo;
|
||||||
size_t foo_size;
|
size_t foo_size;
|
||||||
const char *bar;
|
|
||||||
int err;
|
int err;
|
||||||
char name[64];
|
char name[64];
|
||||||
|
|
||||||
|
|
|
@ -174,10 +174,12 @@ try_maybe_reporting (int report)
|
||||||
} *expected;
|
} *expected;
|
||||||
struct ctf_symtype_expected expected_obj[] = { { "data_a", base2 },
|
struct ctf_symtype_expected expected_obj[] = { { "data_a", base2 },
|
||||||
{ "data_b", base3 },
|
{ "data_b", base3 },
|
||||||
{ "data_c", base }, NULL };
|
{ "data_c", base },
|
||||||
|
{ NULL, 0 } };
|
||||||
struct ctf_symtype_expected expected_func[] = { { "func_a", func2 },
|
struct ctf_symtype_expected expected_func[] = { { "func_a", func2 },
|
||||||
{ "func_b", func3 },
|
{ "func_b", func3 },
|
||||||
{ "func_c", func }, NULL };
|
{ "func_c", func },
|
||||||
|
{ NULL, 0 } };
|
||||||
expected = expected_obj;
|
expected = expected_obj;
|
||||||
|
|
||||||
while ((symtype = ctf_symbol_next (fp, &i, &symname, 0)) != CTF_ERR)
|
while ((symtype = ctf_symbol_next (fp, &i, &symname, 0)) != CTF_ERR)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue