Commit Graph

3279 Commits

Author SHA1 Message Date
Till Straumann
bbfb69ed8d - implemented suggestion by Michael Davidsaver: when reading ELF files
check modifification time against program start time and warn if the
   file was modified more recently since it could be out of date.
2014-09-18 12:19:47 -07:00
Till Straumann
012ee68199 - made osdBackTrace/osdFindAddr c++ sources to be more flexible for
implementations. Fixed compiler warnings (c++ more picky than cc).
2014-09-18 12:18:48 -07:00
Till Straumann
f1bb532307 - simplified some code
- epicsStackTrace.c provides generic epicsStackTraceGetFeatures() testing
   the 'epicsBackTrace()' functionality. Call out to epicsFindAddrGetFeatures()
   to inquire about symbol lookup support.
2014-09-10 12:04:36 -07:00
Till Straumann
0252dd1905 - simplified code
- provide epicsFindAddrGetFeatures() instead of epicsStackTraceGetFeatures()
2014-09-10 12:03:50 -07:00
Till Straumann
a2339b9219 - WIN32 can now use default osdFindAddr (until symbol lookup is implemented) 2014-09-10 12:03:04 -07:00
Till Straumann
cc04994d12 - updated copyright info
- let epicsFindAddr clear out returned symbol info
 - provide epicsFindAddrGetFeatures instead of epicsStackTraceGetFeatures
2014-09-10 12:01:50 -07:00
Till Straumann
fad25a3b11 - cleanup
- reduced epicsStackTraceGetFeatures to epicsFindAddrGetFeatures
2014-09-10 12:00:51 -07:00
Till Straumann
438863ebd9 - updated copyright info 2014-09-10 12:00:08 -07:00
strauman
6890166376 - renamed:
src/libCom/osi/os/posix/osdBackTrace.c => src/libCom/osi/os/posix/osdExecinfoBackTrace.c
  src/libCom/osi/os/posix/osdFindAddr.c => src/libCom/osi/os/posix/osdElfFindAddr.c

  not all 'posix' platforms can use the above versions (since the used APIs are not really POSIX)
  but a subset can. The platforms which can use either version #include it from 'their'
  osdBackTrace.c/osdFindAddr.c.
2014-09-08 23:28:30 -07:00
Till Straumann
51f5a2fc99 - fixed illegal void* pointer arithmetic by casting to char* 2014-09-08 23:09:18 -07:00
Till Straumann
252af56144 - renamed symbol that clashed on solaris 2014-09-08 23:08:33 -07:00
Till Straumann
278a8dac05 - solaris implementation of epicsBackTrace() via walkcontext() 2014-09-08 23:07:51 -07:00
Till Straumann
8477dec61f - added windows versions of osdBackTrace.c, osdFindAddr.c; the latter
does not implement addr->symbol conversion yet.
2014-09-08 22:31:11 -07:00
Till Straumann
8931954d28 - fixed illegal void* pointer arithmetic (by casting to char*) 2014-09-08 22:30:34 -07:00
Till Straumann
954ba66027 - fixed illegal void* pointer arithmetic by casting to char*
- removed more unused stuff
2014-09-08 22:29:46 -07:00
Till Straumann
4e1677a38f - (hopefully) correct usage of sharedLib.h... 2014-09-08 22:28:41 -07:00
strauman
e349b3ab94 - first stab at breaking stack trace facility into separate files 2014-09-08 19:41:06 -07:00
Till Straumann
fa41fcbe40 - use unistd's _POSIX_MAPPED_FILES to determine if a system has mmap. 2014-09-08 08:10:16 -07:00
Till Straumann
9dd130afb6 - forget about backtrace_symbols() -- always use 'dladdr'. (The former
is non-standard either and AFAIK always based on the latter.) Always
   using dladdr allows us to precisely control the printout formatting
   and keep it consistent.
2014-09-05 15:29:32 -07:00
Till Straumann
423709b795 - call first epicsStackTraceRecurseGbl() through function pointer -- clang
(darwin) had optimized it away.
2014-09-05 11:17:17 -07:00
Till Straumann
fd9fed2262 - canonicalized printout formatting
- added EPICS_STACKTRACE_DYN_SYMBOL
 - added USE_DLADDR branch (which is a 'super' of USE_ELF, i.e., the latter
   depends on the former)
2014-09-04 10:59:39 -07:00
Till Straumann
68429f03f2 - added EPICS_STACKTRACE_DYN_SYMBOL 2014-09-04 10:58:27 -07:00
Till Straumann
fab9ef6147 - added test case for library symbols
- replaced TABs by spaces
2014-09-03 13:23:23 -07:00
Till Straumann
4352a1df59 - replaced TABs by four blanks 2014-09-03 09:39:15 -07:00
Till Straumann
f399b354e6 - replaced TABs by four blanks 2014-09-03 08:13:15 -07:00
Till Straumann
16bef44e5d - print header message 2014-08-29 15:03:56 -07:00
Till Straumann
f2626442b6 - removed message; if there is no support remain silent 2014-08-29 15:03:04 -07:00
Till Straumann
32c6888e1b - removed message about a stack trace going to be printed 2014-08-29 15:02:20 -07:00
Till Straumann
0d323db997 - removed obsolete rule (used during development) 2014-08-29 15:00:54 -07:00
Till Straumann
079357c242 - let default (no-op) version of stack trace print informative message
that stack traces are not supported.
2014-08-28 15:10:12 -07:00
Till Straumann
768c2c02e7 - paranoia test; errlogFlush; fixed debug messages
1) Added a paranoia test to make sure an ill-formatted
      ELF string table is not overrun if there is no NULL
      char found.

   2) Added errlogFlush() before and after stack dump (suggestion
      by Michael Davidsaver, thanks).

   3) Fixed (out of sync) debug messages.
2014-08-28 11:43:46 -07:00
Till Straumann
47408ed14c - indentation 2014-08-28 11:43:18 -07:00
Till Straumann
5a06c118c8 - added unit test for epicsStackTrace 2014-08-28 10:50:03 -07:00
Till Straumann
ccb5be72dd - consistent naming: 'StackTrace' everywhere... 2014-08-28 10:49:22 -07:00
Till Straumann
8b2b03482f - consistent naming: 'StackTrace' everywhere. 2014-08-28 10:47:59 -07:00
Till Straumann
4459ca0ad8 - merged stacktrace onto current 3.15 tip (Thanks Andrew for his help) 2014-08-27 14:34:05 -07:00
Ralph Lange
f40c25723d libCom/osi: Fix for MinGW32 builds on Windows 2014-08-26 17:14:35 -07:00
Andrew Johnson
0d33e8a872 epicsStdio.c allow stderr from inside epicsThreadInit()
Circular initialization problem that Murali discovered when you
try to fprintf(stderr) from the posix/osdThread.c once() routine.
This change lets the stderr stream through in that case.
2014-08-26 16:40:02 -07:00
Andrew Johnson
83d22ce164 libCom: Darwin has setenv(), use it. 2014-08-26 14:51:18 -07:00
Andrew Johnson
2aea693faf Merged Jeff's 3.15_libcom_from_cvs_trunk branch. 2014-08-25 16:27:18 -05:00
Andrew Johnson
9079c8aa53 Reverted changes to epicsTime.h and epicsThread.h 2014-08-18 22:55:07 -05:00
Andrew Johnson
5e0bf53fec epicsTypes.h: Don't use C99 types
The __STDC_VERSION__ >= 199901L test never succeeds
in C++, and there were issues with the epicsInt8
definition anyway (int8_t is signed, but char might
not be).

I also removed the epicsBoolean enum which we never use.
2014-08-15 12:24:31 -05:00
Andrew Johnson
547a9b3ebc Tweak some dependency rules for correctness 2014-08-05 14:03:37 -05:00
Andrew Johnson
aedea0da37 default/osdSpin.c add missing #include "cantProceed.h"
Also adjusted some error messages for common style.
2014-08-02 23:15:43 -05:00
Andrew Johnson
b7f8f17227 blockingSockTest: Undo member renames using m_ prefix
Using the m_ prefix to denote class data members is dangerous in
code that has to compile on VxWorks 5.5 (which 3.15 does) because
the net/mbuf.h header contains the following macro definitions:

#define m_next          mBlkHdr.mNext
#define m_len           mBlkHdr.mLen
#define m_data          mBlkHdr.mData
#define m_type          mBlkHdr.mType
#define m_flags         mBlkHdr.mFlags
#define m_nextpkt       mBlkHdr.mNextPkt
#define m_act           m_nextpkt
#define m_pkthdr        mBlkPktHdr
#define m_ext           pClBlk
#define m_extBuf        m_ext->clNode.pClBuf
#define m_extFreeRtn    m_ext->pClFreeRtn
#define m_extSize       m_ext->clSize
#define m_extRefCnt     m_ext->clRefCnt
#define m_extArg1       m_ext->clFreeArg1
#define m_extArg2       m_ext->clFreeArg2
#define m_extArg3       m_ext->clFreeArg3
#define  m_copy(m, o, l)        m_copym((m), (o), (l), M_DONTWAIT)
#define  m_copym(m, o, l, w)    netMblkChainDup(_pNetDpool, (m), (o), (l), (w))
#define  m_freem(m)             netMblkClChainFree(m)
#define  m_free(m)              netMblkClFree(m)    
#define m_mbufs         mNum
#define m_drops         mDrops
#define m_wait          mWait
#define m_drain         mDrain
#define m_mtypes        mTypes

While the names in the original change all appear to be safe, I
don't want us to start using this convention because we will then
have to police commits more closely or risk build failures in the
future when someone who doesn't know about or remember the issue
can't or doesn't try building their code against VxWorks 5.5.

I don't particularly like the this-> convention to mark member
names either, but until the VxWorks 5.5 support requirement goes
away the m_ convention is worse. Another common convention of
using a leading underscore is not safe either, those names are
reserved for the C/C++ implementation.
2014-08-02 14:02:43 -05:00
Andrew Johnson
8d5cdc3747 Fix typo in macro name
Not that it really matters since only VxWorks and RTEMS actually
compile this file and they don't have shared libraries...
2014-08-02 13:13:49 -05:00
Andrew Johnson
f1a59aa64a Use epicsUInt types, stdint.h is not found on all platforms 2014-08-02 13:09:07 -05:00
Andrew Johnson
6767f5089f threadPool: Replaced errno.h status values with S_pool_* ones
ETIMEDOUT is not provided on MinGW.
2014-08-01 17:55:53 -05:00
Andrew Johnson
ab78480d54 Merged spinlockfix branch.
Some last-minute fixes for VxWorks build warnings.
2014-07-31 12:45:40 -05:00
Andrew Johnson
68bcc77885 Merged alarm-strings branch. 2014-07-31 10:17:24 -05:00