From: Philippe E. <ph...@us...> - 2007-10-29 15:44:37
|
Update of /cvsroot/oprofile/oprofile/libutil++ In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27783/libutil++ Modified Files: op_bfd.cpp op_bfd.h op_spu_bfd.cpp Log Message: Cleanup the way per spec archive_path is handled, as extra_images is built using an archive_path it make no sense to pass archive_path as parameter all over the place. As a side effect it fix a corner case: oparchive archive:tmp1 -o tmp2 was not working for module, archiving from an already existing archive should work now Index: op_bfd.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -u -p -d -r1.74 -r1.75 --- op_bfd.cpp 27 Oct 2007 16:16:36 -0000 1.74 +++ op_bfd.cpp 29 Oct 2007 15:44:29 -0000 1.75 @@ -88,12 +88,11 @@ bool op_bfd_symbol::operator<(op_bfd_sym } -op_bfd::op_bfd(string const & archive, string const & fname, - string_filter const & symbol_filter, +op_bfd::op_bfd(string const & fname, string_filter const & symbol_filter, extra_images const & extra_images, bool & ok) : filename(fname), - archive_path(archive), + archive_path(extra_images.get_archive_path()), file_size(-1) { int fd; @@ -105,9 +104,8 @@ op_bfd::op_bfd(string const & archive, s asection const * sect; image_error image_ok; - string const image_path = find_image_path(archive_path, filename, - extra_images, image_ok, - true); + string const image_path = + extra_images.find_image_path(filename, image_ok, true); cverb << vbfd << "op_bfd ctor for " << image_path << endl; Index: op_bfd.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -p -d -r1.43 -r1.44 --- op_bfd.h 27 Oct 2007 16:16:36 -0000 1.43 +++ op_bfd.h 29 Oct 2007 15:44:29 -0000 1.44 @@ -99,8 +99,7 @@ public: * open the bfd (because it's not there or whatever). On out, * it's set to false if the bfd couldn't be loaded. */ - op_bfd(std::string const & archive_path, - std::string const & filename, + op_bfd(std::string const & filename, string_filter const & symbol_filter, extra_images const & extra_images, bool & ok); @@ -109,8 +108,7 @@ public: * This constructor is used when processing an SPU profile * where the SPU ELF is embedded within the PPE binary. */ - op_bfd(std::string const & archive_path, - uint64_t spu_offset, + op_bfd(uint64_t spu_offset, std::string const & filename, string_filter const & symbol_filter, extra_images const & extra_images, Index: op_spu_bfd.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/libutil++/op_spu_bfd.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -p -d -r1.2 -r1.3 --- op_spu_bfd.cpp 27 Oct 2007 16:16:36 -0000 1.2 +++ op_spu_bfd.cpp 29 Oct 2007 15:44:29 -0000 1.3 @@ -30,12 +30,11 @@ extern verbose vbfd; * constructor in libutil++/op_bfd.cpp, with the additional processing * needed to handle an embedded spu offset. */ -op_bfd::op_bfd(string const & archive, uint64_t spu_offset, - string const & fname, +op_bfd::op_bfd(uint64_t spu_offset, string const & fname, string_filter const & symbol_filter, extra_images const & extra_images, bool & ok) : - archive_path(archive), + archive_path(extra_images.get_archive_path()), file_size(-1), embedding_filename(fname) { @@ -51,9 +50,8 @@ op_bfd::op_bfd(string const & archive, u asection const * sect; image_error image_ok; - string const image_path = find_image_path(archive_path, fname, - extra_images, image_ok, - true); + string const image_path = + extra_images.find_image_path(fname, image_ok, true); cverb << vbfd << "op_bfd ctor for " << image_path << endl; if (!ok) |