if (nscopes <= 0)
return false;
+ bool res = false;
for (int i = 0; i < nscopes; ++i)
switch (dwarf_tag (&scopes[i]))
{
{
const char *name = get_diename (&scopes[i]);
if (name == NULL)
- return false;
+ goto done;
printf ("%s%c", symname (name), pretty ? ' ' : '\n');
- return true;
+ res = true;
+ goto done;
}
case DW_TAG_inlined_subroutine:
{
const char *name = get_diename (&scopes[i]);
if (name == NULL)
- return false;
+ goto done;
/* When using --pretty-print we only show inlines on their
own line. Just print the first subroutine name. */
if (pretty)
{
printf ("%s ", symname (name));
- return true;
+ res = true;
+ goto done;
}
else
printf ("%s inlined", symname (name));
}
}
- return false;
+done:
+ free (scopes);
+ return res;
}
static void