Commit [1081b2]  Maximize  Restore  History

Fix recent regression in opreport --debuginfo output

The '--debuginfo' option of opreport is broken. Output shows
"(no location information)" when it should show source file
and line number. I found that the May 15 commit ("Fix Coverity
issues identified against oprofile 0.9.8 release") was the
culprit. Coverity complained about a file descriptor in
the op_bfd constructor not being closed. My "fix" for that
complaint was wrong. The file descriptor in question is
the one we open for the binary image being processed by op_bfd
and which we pass to fdopen_bfd. Apparently, libbfd caches that
fd internally and makes use of it for certain functions -- in
particular, bfd_find_nearest_line(). This bug also caused
another symptom: when opreport is run with '--xml --details',
the output does not contain the binary code for the symbols.

The fix for this problem was trivial. I put the declaration for
the "fd" into the op_bfd class private section and then closed
the fd in the op_bfd destructor.

Signed-off-by: Maynard Johnson <>

Maynard Johnson Maynard Johnson 2013-06-27

changed libutil++/op_bfd.cpp
changed libutil++/op_bfd.h
libutil++/op_bfd.cpp Diff Switch to side-by-side view
libutil++/op_bfd.h Diff Switch to side-by-side view