This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regression run-allfcts.sh FAIL on i386 [Re: [PATCH] libdw: Make dwarf_getfuncs find all (defining) DW_TAG_subprogram DIEs.]


On Fri, 2013-11-01 at 15:29 +0100, Jan Kratochvil wrote:
> FYI getting on i386 (not x86_64) RHEL-5 and RHEL-6.
> (Not sure about Fedoras as dwz may complicate it there.)
> 
> FAIL: run-allfcts.sh

This was actually a bug in the testcase introduced earlier when I
adapted that code to test a callback that could return DWARF_CB_ABORT.
It happened to be triggered on some 32bit arches by the new code. Fixed
as attached.

Thanks,

Mark
>From d8c75df969fff193d143789cba03038db8da5a2c Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Tue, 5 Nov 2013 11:27:19 +0100
Subject: [PATCH] tests: allfcts.c (main): Correct dwarf_getfuncs return value check.

The return value of dwarf_getfuncs is a ptrdiff_t that is zero on success,
or non-zero (an offset to continue the search) when the callback returned
DWARF_CB_ABORT or on error. When an error occurs dwarf_errno is set.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 tests/ChangeLog |    4 ++++
 tests/allfcts.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 11974e1..c549fa0 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-05  Mark Wielaard  <mjw@redhat.com>
+
+	* allfcts.c (main): Correct dwarf_getfuncs return value check.
+
 2013-10-10  Mark Wielaard  <mjw@redhat.com>
 	    Josh Stone  <jistone@redhat.com>
 
diff --git a/tests/allfcts.c b/tests/allfcts.c
index 7803722..10e0f07 100644
--- a/tests/allfcts.c
+++ b/tests/allfcts.c
@@ -63,7 +63,7 @@ main (int argc, char *argv[])
 		{
 		  doff = dwarf_getfuncs (die, cb, NULL, doff);
 		}
-	      while (doff > 0);
+	      while (doff != 0 && dwarf_errno () == 0);
 
 	      off = noff;
 	    }
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]