Commit b8ddd61b by Ian Lance Taylor Committed by Ian Lance Taylor

dwarf.c (find_address_ranges): New static function, broken out of build_address_map.

	* dwarf.c (find_address_ranges): New static function, broken out
	of build_address_map.
	(build_address_map): Call it.
	* btest.c (check): Check for missing filename or function, rather
	than crashing.
	(f3): Check that enough frames were returned.

From-SVN: r205490
parent f5c8b24c
2013-11-27 Ian Lance Taylor <iant@google.com>
* dwarf.c (find_address_ranges): New static function, broken out
of build_address_map.
(build_address_map): Call it.
* btest.c (check): Check for missing filename or function, rather
than crashing.
(f3): Check that enough frames were returned.
2013-11-19 Jakub Jelinek <jakub@redhat.com> 2013-11-19 Jakub Jelinek <jakub@redhat.com>
* backtrace.h (backtrace_syminfo_callback): Add symsize argument. * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
......
...@@ -129,6 +129,13 @@ check (const char *name, int index, const struct info *all, int want_lineno, ...@@ -129,6 +129,13 @@ check (const char *name, int index, const struct info *all, int want_lineno,
{ {
if (*failed) if (*failed)
return; return;
if (all[index].filename == NULL || all[index].function == NULL)
{
fprintf (stderr, "%s: [%d]: missing file name or function name\n",
name, index);
*failed = 1;
return;
}
if (strcmp (base (all[index].filename), "btest.c") != 0) if (strcmp (base (all[index].filename), "btest.c") != 0)
{ {
fprintf (stderr, "%s: [%d]: got %s expected test.c\n", name, index, fprintf (stderr, "%s: [%d]: got %s expected test.c\n", name, index,
...@@ -310,6 +317,14 @@ f3 (int f1line, int f2line) ...@@ -310,6 +317,14 @@ f3 (int f1line, int f2line)
data.failed = 1; data.failed = 1;
} }
if (data.index < 3)
{
fprintf (stderr,
"test1: not enough frames; got %zu, expected at least 3\n",
data.index);
data.failed = 1;
}
check ("test1", 0, all, f3line, "f3", &data.failed); check ("test1", 0, all, f3line, "f3", &data.failed);
check ("test1", 1, all, f2line, "f2", &data.failed); check ("test1", 1, all, f2line, "f2", &data.failed);
check ("test1", 2, all, f1line, "test1", &data.failed); check ("test1", 2, all, f1line, "test1", &data.failed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment