diff --git a/configure.in b/configure.in index 3d5b2e4..7bb7b95 100644 --- a/configure.in +++ b/configure.in @@ -32,14 +32,16 @@ AC_CHECK_HEADER(sys/old_procfs.h, [AM_CPPFLAGS=-D__solaris__]) AC_SEARCH_LIBS(cplus_demangle, iberty, [AC_MSG_RESULT([OK])], [AC_MSG_ERROR([Library iberty is required!])]) AC_SEARCH_LIBS(bfd_arch_list, bfd, [AC_MSG_RESULT([OK])], - [no_bfd=true]) -if [ -n "$no_bfd" ]; then - AC_SEARCH_LIBS(bfd_arch_list, bfd, [AC_MSG_RESULT([OK])], - [AC_MSG_ERROR([BFD library libbfd is required])], [-lintl]) -fi + AC_SEARCH_LIBS(bfd_arch_list, bfd, [AC_MSG_RESULT([OK])], + [AC_MSG_ERROR([BFD library libbfd is required])], [-lintl])) # Arguments AM_MAINTAINER_MODE +AC_ARG_ENABLE(pedantic, + [ --enable-pedantic enable all warnings and checks, abort on warnings], + [test "$enableval" = "yes" && \ + AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror"]) +dnl lib: -Wshadow -Wcast-qual AC_ARG_ENABLE(dot, [ --disable-dot disable dot graphic tools for documentation], [have_dot="$enableval"]) @@ -51,6 +53,8 @@ AC_SUBST(MAJOR) AC_SUBST(MINOR) AC_SUBST(SUPPORT) AC_SUBST(PACKAGENAME) +AC_SUBST(AM_CXXFLAGS) +AC_SUBST(AM_CPPFLAGS) # create output AC_CONFIG_FILES([makefile mrw-c++.spec mrw-c++-devel.spec @@ -66,3 +70,6 @@ if test "$have_dot" = "no"; then AC_MSG_WARN([Missing program dot! - when you rebild documentation with make doc, there are no generated images - there are precompiled derieved files in the distribution]); fi + + +AC_MSG_WARN([************** THE FLAGS = ${AM_CXXFLAGS}]); \ No newline at end of file diff --git a/mrw/auto.cpp b/mrw/auto.cpp index 7de5c43..54092d3 100644 --- a/mrw/auto.cpp +++ b/mrw/auto.cpp @@ -15,10 +15,10 @@ namespace mrw { //---------------------------------------------------------------------------- AutoMapper::AutoMapper(int fd, size_t sz, void* addr, - int prot, int flags, off_t off) throw() { + int prot, int flags, off_t off) throw(): _cont(0) { if (!(_sz=sz)) { struct stat st; - if (fd==-1 || fstat(fd, &st)==-1) {release(); return;} + if (fd==-1 || fstat(fd, &st)==-1) return; _sz = st.st_size; } if ((_cont=mmap(addr, _sz, prot, flags, fd, off))==MAP_FAILED) release(); diff --git a/mrw/doxyfile.in b/mrw/doxyfile.in index 6ad8421..c462fd9 100644 --- a/mrw/doxyfile.in +++ b/mrw/doxyfile.in @@ -904,7 +904,7 @@ TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = +GENERATE_TAGFILE = libmrw.doxytag # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes diff --git a/mrw/libmrw.doxytag b/mrw/libmrw.doxytag new file mode 100644 index 0000000..a4ba8b4 --- /dev/null +++ b/mrw/libmrw.doxytag @@ -0,0 +1,1108 @@ + + + + index + + index + + + license + License + license + + + readme + Readme + readme + + + install + Installation + install + + + news + News + news + + + changes + Change Log + changes + + + arguments + C++ Evaluation of Command Line Arguments + group__arguments.html + mrw::Args + mrw::Opt + mrw::Param + + + AutoTools + Classes for Automated Resource Handling + group__AutoTools.html + mrw::AutoBfd + mrw::AutoFile + mrw::AutoFree + mrw::AutoMapper + mrw::pipe + mrw::SmartPointer + + + AutoTrace + Automated Unexpected Handler with Stack Trace + group__AutoTrace.html + + void + unexpected_log4cxx + a1 + () + + + void + unexpected_stderr + a2 + () + + + + CmdExec + Execute UNIX Commands + group__CmdExec.html + mrw::Cmd + mrw::Exec + mrw::ExecutionFailedExc + + + StackTrace + Collect and Format a Stack Trace + group__StackTrace.html + AutoTrace + mrw::bad_alloc + mrw::bad_cast + mrw::bad_exception + mrw::bad_typeid + mrw::domain_error + mrw::exception + mrw::invalid_argument + mrw::length_error + mrw::logic_error + mrw::out_of_range + mrw::overflow_error + mrw::range_error + mrw::runtime_error + mrw::StackTrace + mrw::underflow_error + + std::ostream & + operator<< + a0 + (std::ostream &os, const StackTrace &st) + + + + mrw::Args + classmrw_1_1Args.html + + std::list< std::string > + OtherArgs + w0 + + + + Args & + operator<< + a0 + (const mrw::Opt &opt) + + + Args & + operator<< + a1 + (int argc) + + + Args & + operator<< + a2 + (const char *const *const argv) + + + Args & + operator<< + a3 + (const std::string &description) + + + Args & + operator<< + a4 + (char help) + + + const Opt & + find + a5 + (char c) const + + + const Opt & + find + a6 + (const std::string &s) const + + + const OtherArgs & + otherArgs + a7 + () + + + const std::string & + filename + a8 + () + + + void + help + a9 + () + + + Args & + instance + e0 + () + + + + mrw::AutoBfd + classmrw_1_1AutoBfd.html + + + AutoBfd + a0 + (bfd *p=0) + + + AutoBfd & + operator= + a2 + (bfd *p) + + + AutoBfd & + operator= + a3 + (AutoBfd &o) + + + + operator bfd * + a4 + () + + + bfd * + operator-> + a5 + () + + + bfd * + release + a6 + () + + + + mrw::AutoFile + classmrw_1_1AutoFile.html + + + AutoFile + a0 + (int fd=-1) + + + + AutoFile + a1 + (AutoFile &o) + + + + ~AutoFile + a2 + () + + + AutoFile & + operator= + a3 + (int fd) + + + AutoFile & + operator= + a4 + (AutoFile &other) + + + + operator const int + a5 + () const + + + int + release + a6 + () + + + AutoFile & + reset + a7 + (int=-1) + + + + mrw::AutoFree + classmrw_1_1AutoFree.html + T + + + AutoFree + a0 + (T *p=0) + + + + AutoFree + a1 + (AutoFree &o) + + + AutoFree & + operator= + a3 + (T *p) + + + AutoFree & + operator= + a4 + (AutoFree &o) + + + + operator T * + a5 + () + + + + operator T ** + a6 + () + + + + operator bool + a7 + () + + + T * + release + a8 + () + + + + mrw::AutoMapper + classmrw_1_1AutoMapper.html + + + AutoMapper + a0 + (void *cont=0, size_t sz=0) + + + + AutoMapper + a1 + (int, size_t=0, void *=0, int=PROT_READ, int=MAP_SHARED, off_t=0) + + + + operator const void * + a3 + () const + + + AutoMapper & + set + a4 + (void *cont, size_t sz) + + + void * + release + a5 + () + + + const void * + last + a6 + () const + + + + mrw::bad_alloc + classmrw_1_1bad__alloc.html + mrw::exception + + virtual const char * + what + a0 + () const + + + + mrw::bad_cast + classmrw_1_1bad__cast.html + mrw::exception + + virtual const char * + what + a0 + () const + + + + mrw::bad_exception + classmrw_1_1bad__exception.html + mrw::exception + + virtual const char * + what + a0 + () const + + + + mrw::bad_typeid + classmrw_1_1bad__typeid.html + mrw::exception + + virtual const char * + what + a0 + () const + + + + mrw::Cmd + classmrw_1_1Cmd.html + + + Cmd + a0 + (const std::string &) + + + Cmd & + operator, + a1 + (const std::string &) + + + Cmd & + operator<< + a2 + (const std::string &) + + + + operator std::string + a3 + () const + + + + operator Exec + a4 + () const + + + Exec + execute + a5 + (bool=true) const + + + + mrw::domain_error + classmrw_1_1domain__error.html + mrw::exception + + + domain_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::exception + classmrw_1_1exception.html + + virtual const char * + what + a2 + () const + + + const std::string & + stacktrace + a3 + () const + + + + mrw::Exec + classmrw_1_1Exec.html + + + Exec + a0 + (const mrw::Cmd &) + + + + Exec + a1 + (const mrw::Exec &) + + + Exec & + operator= + a3 + (const mrw::Exec &) + + + Exec & + execute + a4 + (bool=true) + + + Exec & + operator>> + a5 + (std::string &) + + + + operator std::string & + a6 + () + + + + operator bool + a7 + () + + + std::string & + result + a8 + () + + + std::string & + error + a9 + () + + + bool + success + a10 + () + + + + mrw::ExecutionFailedExc + classmrw_1_1ExecutionFailedExc.html + mrw::exception + + + ExecutionFailedExc + a0 + (const std::string &, const std::string &) + + + virtual const char * + what + a2 + () const + + + + mrw::invalid_argument + classmrw_1_1invalid__argument.html + mrw::exception + + + invalid_argument + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::length_error + classmrw_1_1length__error.html + mrw::exception + + + length_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::logic_error + classmrw_1_1logic__error.html + mrw::exception + + + logic_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::Opt + classmrw_1_1Opt.html + + + Opt::Opt + a0 + (const char shortname, const std::string &longname, const Param &param, const std::string &help) + + + + Opt::Opt + a1 + (const char shortname, const std::string &longname, const std::string &help) + + + const std::string & + help + a2 + () const + + + + operator bool + a3 + () const + + + const mrw::SmartPointer< Param::Value > & + operator[] + a4 + (unsigned int i) const + + + + mrw::out_of_range + classmrw_1_1out__of__range.html + mrw::exception + + + out_of_range + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::overflow_error + classmrw_1_1overflow__error.html + mrw::exception + + + overflow_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::Param + classmrw_1_1Param.html + + int + size + a0 + () const + + + Param & + operator<< + a1 + (const char *const s) + + + Param & + operator<< + a2 + (const std::string &s) + + + Param & + operator<< + a3 + (int i) + + + Param & + operator<< + a4 + (bool b) + + + const mrw::SmartPointer< Value > & + operator[] + a5 + (unsigned int i) const + + + + mrw::Param::Value + classmrw_1_1Param_1_1Value.html + + virtual const std::string & + toString + a1 + () const + + + virtual int + toInt + a2 + () const + + + virtual bool + toBool + a3 + () const + + + virtual std::string + printable + a4 + () const=0 + + + virtual const std::string & + typestr + a5 + () const=0 + + + virtual void + operator= + b0 + (const std::string &)=0 + + + + mrw::Param::Value + classmrw_1_1Param_1_1Value.html + + virtual const std::string & + toString + a1 + () const + + + virtual int + toInt + a2 + () const + + + virtual bool + toBool + a3 + () const + + + virtual std::string + printable + a4 + () const=0 + + + virtual const std::string & + typestr + a5 + () const=0 + + + virtual void + operator= + b0 + (const std::string &)=0 + + + + mrw::pipe + classmrw_1_1pipe.html + + + pipe + a0 + () + + + + ~pipe + a1 + () + + + void + close + a2 + () + + + void + close_in + a3 + () + + + void + close_out + a4 + () + + + + operator bool + a5 + () + + + int + error + a6 + () + + + void + connect_cout + a7 + () + + + void + connect_cerr + a8 + () + + + int + istream + a9 + () + + + int + ostream + a10 + () + + + + mrw::range_error + classmrw_1_1range__error.html + mrw::exception + + + range_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::runtime_error + classmrw_1_1runtime__error.html + mrw::exception + + + runtime_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + + mrw::SmartPointer + classmrw_1_1SmartPointer.html + TYPE + + + SmartPointer + a1 + (const SmartPointer< TYPE > &o) + + + + SmartPointer + a2 + (TYPE *ptr) + + + + SmartPointer + a3 + (const SmartPointer< OTHER > &o) + + + SmartPointer & + operator= + a5 + (const SmartPointer< TYPE > &o) + + + SmartPointer & + operator= + a6 + (TYPE *ptr) + + + SmartPointer & + operator= + a7 + (const SmartPointer< OTHER > &o) + + + TYPE & + operator * + a8 + () + + + const TYPE & + operator * + a9 + () const + + + TYPE *const + operator-> + a10 + () + + + const TYPE *const + operator-> + a11 + () const + + + + operator bool + a12 + () + + + + mrw::StackTrace + classmrw_1_1StackTrace.html + + std::vector< void * > + AddressTrace + w0 + + + + + StackTrace + a0 + () + + + + operator std::string + a1 + () const + + + + operator const AddressTrace & + a2 + () const + + + const StackTrace & + print + a3 + (std::ostream &os) const + + + CodePos + translate + e0 + (void *addr) + + + bool + createSymtable + e1 + (std::string="") + + + + mrw::StackTrace::CodePos + structmrw_1_1StackTrace_1_1CodePos.html + + + CodePos + a0 + (void *a, std::string fn, std::string fi, unsigned int l) + + + void * + address + o0 + + + + std::string + function + o1 + + + + std::string + file + o2 + + + + unsigned int + line + o3 + + + + + mrw::StackTrace::CodePos + structmrw_1_1StackTrace_1_1CodePos.html + + + CodePos + a0 + (void *a, std::string fn, std::string fi, unsigned int l) + + + void * + address + o0 + + + + std::string + function + o1 + + + + std::string + file + o2 + + + + unsigned int + line + o3 + + + + + mrw::underflow_error + classmrw_1_1underflow__error.html + mrw::exception + + + underflow_error + a0 + (const std::string &arg) + + + virtual const char * + what + a1 + () const + + + diff --git a/mrw/makefile.am b/mrw/makefile.am index 6e60a46..9dcdcbe 100644 --- a/mrw/makefile.am +++ b/mrw/makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I.. +AM_CPPFLAGS := ${AM_CPPFLAGS} -I.. CLEANFILES = doxygen.error examplesdir = ${pkgdatadir}/examples diff --git a/mrw/stacktrace.cpp b/mrw/stacktrace.cpp index 0fff72d..9e13659 100644 --- a/mrw/stacktrace.cpp +++ b/mrw/stacktrace.cpp @@ -173,6 +173,7 @@ namespace mrw { //---------------------------------------------------------------------------- void StackTrace::buildSectionMap(bfd* abfd, asection* section, void*) throw(std::bad_exception) { + if (!abfd || !section) return; if (!(bfd_get_section_flags(abfd, section)&SEC_ALLOC)) return; bfd_vma vma(bfd_get_section_vma(abfd, section)); bfd_size_type sz(bfd_get_section_size_before_reloc(section)); diff --git a/mrw/stacktrace_test.cpp b/mrw/stacktrace_test.cpp index 5cbf793..8d841ca 100644 --- a/mrw/stacktrace_test.cpp +++ b/mrw/stacktrace_test.cpp @@ -14,8 +14,8 @@ namespace mrw { std::stringstream ss; ss<