Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SealSharedLib.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
21 #include "CxxUtils/SealCommon.h" // wlav
22 #include "CxxUtils/SealSharedLib.h" // wlav
23 #include "CxxUtils/SealDebug.h" // wlav
24 // wlav copied from SealBase/sysapi/SharedLibrary.h
25 # ifdef _WIN32
26 # include <windows.h>
27 # include <winnt.h>
28 # include <imagehlp.h>
29 # else
30 # if HAVE_DLOPEN
31 # include <dlfcn.h>
32 # elif HAVE_SHL_LOAD
33 # include <dl.h>
34 # elif HAVE_LOAD
35 # include "utils/dlfcn.h"
36 # endif
37 # if HAVE_LOADER_H
38 # include <loader.h>
39 # endif
40 # if HAVE_LINK_H
41 # include <link.h>
42 # include <limits.h>
43 # include <sys/stat.h>
44 # include <unistd.h>
45 # endif
46 # if HAVE_ELF_H
47 # include <elf.h>
48 # endif
49 # if HAVE_SGIDEFS_H // irix n32, 64
50 # include <sgidefs.h>
51 # include <objlist.h>
52 # include <obj_list.h>
53 # include <obj.h>
54 # endif
55 # if HAVE_MACH_O_DYLD_H // darwin
56 # include <mach-o/dyld.h>
57 # include <mach-o/getsect.h>
58 # endif
59 # endif // _WIN32
60 # include <cstring>
61 # include <cstdio>
62 # include <cstdlib>
63 # include <errno.h>
64 
65 #include <assert.h> // wlav
66 
67 #ifndef HAVE_R_DEBUG
68  extern ElfW(Dyn) _DYNAMIC []; // #pragma weak? // wlav
69 #endif
70 
71 //namespace seal { wlav
72 namespace Athena { // wlav
73 
74 #ifndef SHLIB_UNSUPPORTED
75 # define SHLIB_UNSUPPORTED \
76  throw SharedLibraryError ("", "unsupported operation")
77 #endif
78 
79 
80 // wlav modified from SealBase/src/SharedLibraryError.cpp
81 SharedLibraryError::SharedLibraryError (const std::string& context,
82  const std::string& cause)
83  : m_message ("Shared library operation")
84 {
85  if (! context.empty ())
86  {
87  m_message += " ";
88  m_message += context;
89  }
90 
91  m_message += " failed";
92 
93  if (! cause.empty ())
94  {
95  m_message += " because: ";
96  m_message += cause;
97  }
98 }
99 
100 const char*
102 {
103  return m_message.c_str();
104 }
105 
106 
107 // wlav continued from SealBase/src/SharedLibrary.cpp
108 #ifdef _WIN32
109 static BOOL CALLBACK
110 enumModules (LPSTR name, ULONG base_address, PVOID context)
111 {
112  IMAGEHLP_MODULE moduleinfo;
114  = static_cast<SharedLibrary::InfoHandler *> (context);
115 
116  memset (&moduleinfo, 0, sizeof (moduleinfo));
117  moduleinfo.SizeOfStruct = sizeof (moduleinfo);
118 
120 
121  if (SymGetModuleInfo (GetCurrentProcess (), base_address, &moduleinfo))
122  {
123  info.m_filename = moduleinfo.LoadedImageName;
124  info.m_text_start = moduleinfo.BaseOfImage;
125  info.m_text_end = moduleinfo.BaseOfImage + moduleinfo.ImageSize;
126  info.m_data_start = 0;
127  info.m_data_end = 0;
128  info.m_bss_start = 0;
129  info.m_bss_end = 0;
130  }
131  else
132  {
133  info.m_filename = name;
134  info.m_text_start = base_address;
135  info.m_text_end = 0;
136  info.m_data_start = 0;
137  info.m_data_end = 0;
138  info.m_bss_start = 0;
139  info.m_bss_end = 0;
140  }
141  (*handler) (info);
142  return TRUE;
143 }
144 #endif
145 
146 
147 std::string
149 {
150  const char *pathvar = PATH;
151  const char *path = pathvar ? getenv (pathvar) : 0;
152  return path ? path : "";
153 }
154 
155 void
157 {
158  /* Do not free `var'; most implementations of `putenv' use the
159  string without copying it. On systems where `putenv' copies,
160  you'll see leaks from this routine. It would be possible to
161  check for this, but only by killing cross-compilation.
162 
163  NB: `HAVE_COPYING_PUTENV' will never be set as we are not
164  checking for it :-) */
165 
166  const char *pathvar = PATH;
167  if (pathvar) {
168  setenv(pathvar, path.c_str(),1);
169  }
170 }
171 
177 std::string
178 SharedLibrary::libname (const std::string &name)
179 {
180 #ifdef _WIN32
181  return name + ".dll";
182 #elif defined __hpux
183  return "lib" + name + ".sl";
184 #else
185  return "lib" + name + ".so";
186 #endif
187 }
188 
195 std::string
196 SharedLibrary::symname (const std::string &name)
197 { return name; }
198 
200 
207 {
208 #if HAVE_DLOPEN || HAVE_LOAD
209  // NB: Linux (at least RH 7.x) dynamic loader is severely broken
210  // when it comes to reporting error messages. The error messages
211  // are frequently garbled or null. If you see a crash in a call
212  // to dlerror(), sorry, there's nothing we can do about that.
213  // Our attempts have only produced even more undesirable crashes.
214  // Waiting for a better version of the linux dynamic loader.
215  void *handle = ::dlopen (0, RTLD_LAZY);
216  if (! handle)
217  {
218  const char *msg = ::dlerror ();
219  msg = msg ? msg : "dynamic linker error message lost!";
220  throw SharedLibraryError ("dlopen()", msg);
221  }
222 
223  return new SharedLibrary (handle);
224 #elif HAVE_SHL_LOAD
225  return new SharedLibrary (PROG_HANDLE);
226 #elif defined _WIN32
227  return new SharedLibrary (::GetModuleHandle (0));
228 #else
230 #endif
231 }
232 
241 SharedLibrary::load (const std::string &name)
242 {
243  assert(! name.empty ());
244 
245  void *handle = 0;
246 
247 #if HAVE_DLOPEN || HAVE_LOAD
248 # ifndef RTLD_GLOBAL
249 # define RTLD_GLOBAL 0
250 # endif
251  // See comments in "self()" about crashes in dlerror().
252  if (! (handle = ::dlopen (name.c_str (), RTLD_LAZY | RTLD_GLOBAL)))
253  {
254  const char *msg = ::dlerror ();
255  msg = msg ? msg : "dynamic linker error message lost!";
256  throw SharedLibraryError ("dlopen()", msg);
257  }
258 
259 #elif HAVE_SHL_LOAD
260  if (! (handle = ::shl_load (name.c_str (), BIND_DEFERRED, 0L)))
261  throw SharedLibraryError ("shl_load()", errno);
262 
263 #elif defined _WIN32
264  if (! (handle = ::LoadLibrary (name.c_str ())))
265  throw SharedLibraryError ("LoadLibrary()", GetLastError ());
266 #else
268 #endif
269 
270  return new SharedLibrary (handle);
271 }
272 
275 void
277 {
278  // Dynamic linker characteristics:
279  // AIX, Windows, SVR4 (DG/UX, DRS/NX, DYNIX/ptx, Linux, SINIX,
280  // Solaris, UnixWare, {Free,Open,Net}BSD if __ELF__), BSD,
281  // HP-UX, IRIX, Tru64
282 
283  // Object file formats:
284  // XCOFF (AIX), ELF32/64 (DG/UX, DRS/NX, DYNIX/ptx, IRIX, SINIX,
285  // Solaris, UnixWare, {Free,Open,Net}BSD: if __ELF__), a.out
286  // ({Free,Open,Net}BSD if ! __ELF__, SunOS), BFD (Cygwin, HP-UX,
287  // Linux, LynxOS, Tru64, Windows if GCC), PE (Windows), COFF (?)
288 
289 #if HAVE_SHL_LOAD // hp-ux
290  shl_descriptor desc;
291 
292  for (int index = -1; shl_get_r (index, &desc) == 0; ++index)
293  {
295  info.m_filename = desc.filename;
296  info.m_text_start = desc.tstart;
297  info.m_text_end = desc.tend;
298  info.m_data_start = desc.dstart;
299  info.m_data_end = desc.dend;
300  info.m_bss_start = 0;
301  info.m_bss_end = 0;
302 
303  handler (info);
304  }
305 
306 #elif HAVE_LINK_H // bsd/svr4/elf
307 # if !HAVE_LINK_MAP_L_MAP_START
308 # define l_map_start l_addr
309 # define l_map_end l_addr
310 # endif
311 # if !HAVE_PROGRAM_INVOCATION_NAME
312  static const char *program_invocation_name = "(unknown program name)";
313 # endif
314 # if HAVE_R_DEBUG // linux/glibc
315  link_map *p = _r_debug.r_map;
316 # else
317  // Dynamic linker root:
318  // BSD (SunOS):
319  // #include <sys/types.h>
320  // #include <link.h>
321  // extern struct link_dynamic _DYNAMIC;
322  // link_dynamic *d = &_DYNAMIC;
323  // if ((d->ld_version > 1) && (d->ld_version <= 3) && (d->ld_un.ld_1 != 0))
324  // --> link_map *l = d->ld_un.ld_1->ld_loaded
325  // l->lm_name, l->lm_addr, l->lm_next
326  //
327  // BSD ({Free,Open,Net}BSD):
328  // #include <sys/types.h>
329  // #include <link.h>
330  // extern struct _dynamic _DYNAMIC
331  // _dynamic *d = &_DYNAMIC;
332  // if ((d->version == LD_VERSION_BSD) && d->d_un.d_sdt != 0))
333  // --> so_map *l = d->d_un.d_sdt->sdt_loaded
334  // l->som_path, l->som_addr, l->som_next
335  //
336  // SVR4 (DG/UX, DRS/NX, DYNIX/ptx, SINIX, UnixWare)
337  // ElfW(Dyn) _DYNAMIC[] // Linux
338  // void _DYNAMIC (void) // weak, really is data, but not
339  // // all compilers allow weak data
340  //
341  // Solaris:
342  // dlinfo (self, RTLD_DI_LINKMAP, &p);
343 
344  // extern ElfW(Dyn) _DYNAMIC []; // #pragma weak? // wlav
345  link_map *p = 0;
346  for (ElfW(Dyn) *dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
347  if (dyn->d_tag == DT_DEBUG && dyn->d_un.d_ptr)
348  // linux: p = ((r_debug *) dyn->d_un_d.ptr)->r_map;
349  p = (link_map *) *((unsigned long *) dyn->d_un.d_ptr + 1);
350 # endif
351 
352  if (! p)
353  throw SharedLibraryError ("loaded", "no shared library load map");
354 
355  // Get executable name; linux has a symlink in /proc/self/exe.
356  // Linux path names are arbitrarily long, so we just have create
357  // some random-sized buffer. We allocate this on stack to avoid
358  // dynamic memory allocation. If this is a problem, report a bug.
359  struct stat sbuf;
360  char exe [4096];
361 
362  memset (exe, 0, sizeof (exe));
363  if (::stat ("/proc/self/exe", &sbuf) == 0)
364  ::readlink ("/proc/self/exe", exe, sizeof (exe)-1);
365  else
366  STDC::strncpy (exe, program_invocation_name, sizeof (exe)-1);
367 
368  // Get shared libraries
369  for ( ; p; p = p->l_next)
370  {
372 
373  /* FIXME: Does this work with prelinked shared libraries?
374  From a mail to GCC mailing list ("fde-glibc.c bug"):
375 
376  There is a bug in gcc/config/ia64/fde-glibc.c:
377  ret = find_fde_for_dso ((Elf64_Addr)pc, (Elf64_Ehdr *)map->l_addr,
378  ^^^^^^^^^^^
379  segment_base, gp);
380 
381  this will work only as long as the shared library in
382  question has first PT_LOAD segment's p_vaddr == 0.
383  E.g. with ELF prelinking this is almost never true
384  though, so what you really want is map->l_map_start
385  (map->l_addr will be almost always 0) or even better
386  map->l_phdr/map->l_phnum pair. */
387 
388  // FIXME: use the map address (= ElfW(Ehdr)) to scan over
389  // the different ElfW(Phdr)s to find the various sections.
390  info.m_filename = (p->l_name && p->l_name[0] ? p->l_name : exe);
391  info.m_text_start = p->l_addr ? p->l_addr : p->l_map_start;
392  info.m_text_end = p->l_addr ? p->l_addr : p->l_map_end;
393  info.m_data_start = 0;
394  info.m_data_end = 0;
395  info.m_bss_start = 0;
396  info.m_bss_end = 0;
397 
398  handler (info);
399  }
400 
401 #elif HAVE_SGIDEFS_H // irix
402  /* From rld(1) man page:
403 
404  rld keeps a doubly linked list of structures and crt1.o
405  contains a pointer to the head of the list of obj structures
406  called __rld_obj_head. In an o32 executable, this points to a
407  linked list of objList structures (/usr/include/obj_list.h),
408  each of which has a `data' element which is a pointer to a
409  `struct obj' (/usr/include/obj.h) (even though the field is not
410  declared as a pointer). In an n32 executable, __rld_obj_head
411  points to a linked list of Elf32_Obj_Info structures
412  (/usr/include/objlist.h). In a 64-bit executable,
413  __rld_obj_head points to a linked list of Elf64_Obj_Info
414  structures (/usr/include/objlist.h). The `oi_magic' element of
415  each Elf32_Obj_Info or Elf64_Obj_Info is all-bits-on
416  (0xffffffff) to make it easier to determine which list type is
417  in use a 32-bit executable. */
418 
419  // To get more details by reading the ELF files:
420  // http://reality.sgi.com/davea/software.html
421  extern ElfW(Obj_Info) *__rld_obj_head;
422  ElfW(Obj_Info) *p = __rld_obj_head;
423 
424  for ( ; p; p = (ElfW(Obj_Info) *) p->oi_next)
425  {
427 
428 # if defined _MIPS_SIM_ABI32 && _MIPS_SIM == _MIPS_SIM_ABI32
429  info.m_filename = (const char *) p->o_path;
430  info.m_text_start = p->o_praw; // base address: o_base_address
431  info.m_text_end = p->o_praw;
432 # elif (defined _MIPS_SIM_NABI32 && _MIPS_SIM == _MIPS_SIM_NABI32) \
433  || (defined _MIPS_SIM_ABI64 && _MIPS_SIM == _MIPS_SIM_ABI64)
434  info.m_filename = (const char *) p->oi_pathname;
435  info.m_text_start = p->oi_ehdr; // base address: oi_orig_ehdr
436  info.m_text_end = p->oi_ehdr;
437 # else
438 # error "Unsupported ABI: not o32, n32 or 64"
439 # endif
440  info.m_data_start = 0;
441  info.m_data_end = 0;
442  info.m_bss_start = 0;
443  info.m_bss_end = 0;
444 
445  handler (info);
446  }
447 
448 #elif HAVE_LOADER_H && HAVE_LDR_NEXT_MODULE_DECL // tru64
449  ldr_process_t proc = ldr_my_process ();
450  ldr_module_t mod = LDR_NULL_MODULE;
451  int ret = ldr_next_module (proc, &mod);
452 
453  for (; ret == 0 && mod != LDR_NULL_MODULE; ret = ldr_next_module (proc, &mod))
454  {
455  ldr_module_info_t info;
456  size_t size = 0;
457  LibraryInfo libinfo;
458 
459  if (ldr_inq_module(proc, mod, &info, sizeof(info), &size) < 0)
460  throw SharedLibraryError ("ldr_inq_module()", errno);
461 
462  libinfo.m_filename = info.lmi_name;
463  libinfo.m_text_start = 0;
464  libinfo.m_text_end = 0;
465  libinfo.m_data_start = 0;
466  libinfo.m_data_end = 0;
467  libinfo.m_bss_start = 0;
468  libinfo.m_bss_end = 0;
469 
470  for (int i = 0; i < info.lmi_nregion; ++i)
471  {
472  ldr_region_info_t rinfo;
473  unsigned long low;
474  unsigned long high;
475 
476  if (ldr_inq_region(proc, mod, i, &rinfo, sizeof(rinfo), &size) < 0)
477  throw SharedLibraryError ("ldr_inq_region()", errno);
478 
479  low = (unsigned long) rinfo.lri_mapaddr;
480  high = ((unsigned long) rinfo.lri_mapaddr) + rinfo.lri_size;
481 
482  if (!strcmp(rinfo.lri_name, ".text")) {
483  libinfo.m_text_start = low;
484  libinfo.m_text_end = high;
485  } else if (!strcmp(rinfo.lri_name, ".data")) {
486  libinfo.m_data_start = low;
487  libinfo.m_data_end = high;
488  } else if (!strcmp(rinfo.lri_name, ".bss")) {
489  libinfo.m_bss_start = low;
490  libinfo.m_bss_end = high;
491  }
492  }
493 
494  handler (libinfo);
495  }
496 
497  if (ret < 0)
498  throw SharedLibraryError ("ldr_next_module()", errno);
499 
500 #elif HAVE_LOAD && HAVE_LOAD_DECL // aix
501  int size = 16;
502  void *buffer = new ld_info [size];
503  int error = ::loadquery (L_GETINFO, buffer, size);
504  int offset = 0;
505 
506  while (error == -1 && errno == ENOMEM)
507  {
508  delete [] (ld_info *) buffer;
509  buffer = new ld_info [size *= 2];
510  error = ::loadquery (L_GETINFO, buffer, size);
511  }
512 
513  if (error == -1)
514  throw SharedLibraryError ("loadquery()", errno);
515 
516  while (true)
517  {
519  ld_info *ld = (ld_info *) ((char *) buffer + offset);
520  const char *path = ld->ldinfo_filename;
521  const char *member = path + strlen (path) + 1;
522  std::string filename; // FIXME: Use alloca instead?
523 
524  filename = path;
525  if (*member)
526  {
527  filename += '(';
528  filename += member;
529  filename += ')';
530  }
531 
532  info.m_filename = filename.c_str ();
533  info.m_text_start = (unsigned long) ld->ldinfo_textorg;
534  info.m_text_end = info.m_text_start + ld->ldinfo_textsize;
535  info.m_data_start = (unsigned long) ld->ldinfo_dataorg;
536  info.m_data_end = info.m_data_start + ld->ldinfo_datasize;
537  info.m_bss_start = 0;
538  info.m_bss_end = 0;
539 
540  handler (info);
541 
542  if (ld->ldinfo_next)
543  offset += ld->ldinfo_next;
544  else
545  break;
546  }
547 
548  delete [] (ld_info *) buffer;
549 
550 #elif HAVE_MACH_O_DYLD_H // darwin
551  unsigned long images = _dyld_image_count ();
552  for (unsigned long i = 0; i < images; ++i)
553  {
554  const mach_header *hdr = _dyld_get_image_header (i);
555  unsigned long slide = _dyld_get_image_vmaddr_slide (i);
556  unsigned int size;
557  char *sect;
559 
560  info.m_filename = _dyld_get_image_name (i);
561 
562  sect = getsectdatafromheader (hdr, SEG_TEXT, SECT_TEXT, &size);
563  info.m_text_start = sect ? (unsigned long) sect + slide : 0;
564  info.m_text_end = sect ? (unsigned long) sect + slide + size : 0;
565  sect = getsectdatafromheader (hdr, SEG_DATA, SECT_DATA, &size);
566  info.m_data_start = sect ? (unsigned long) sect + slide : 0;
567  info.m_data_end = sect ? (unsigned long) sect + slide + size : 0;
568  sect = getsectdatafromheader (hdr, SEG_DATA, SECT_BSS, &size);
569  info.m_bss_start = sect ? (unsigned long) sect + slide : 0;
570  info.m_bss_end = sect ? (unsigned long) sect + slide + size : 0;
571 
572  handler (info);
573  }
574 
575 #elif defined _WIN32 // windows
576  if (! SymInitialize (GetCurrentProcess (), NULL, TRUE)
577  || ! SymEnumerateModules (GetCurrentProcess (), &enumModules, (void *) &handler)
578  || ! SymCleanup (GetCurrentProcess ()))
579  throw SharedLibraryError ("SymEnumerateModules()", GetLastError());
580 #else
582 #endif
583 }
584 
588  : m_handle (handle)
589 { assert (m_handle); }
590 
594 { assert (! m_handle); }
595 
601 void
603 {
604  assert (m_handle);
605 
606 #if HAVE_DLOPEN || HAVE_LOAD
607  ::dlclose (m_handle);
608 #elif HAVE_SHL_LOAD
609  ::shl_unload ((shl_t) m_handle);
610 #elif defined _WIN32
611  ::FreeLibrary ((HINSTANCE) m_handle);
612 #else
613  // cannot get here---`load' and `self' should take care of it.
614  assert (false);
615 #endif
616 
617  m_handle = 0;
618  delete this;
619 }
620 
624 void
626 {
627  assert (m_handle);
628  m_handle = 0;
629  delete this;
630 }
631 
640 SharedLibrary::data (const std::string &name, bool mangle /* = true */) const
641 {
642  assert (! name.empty ());
643  assert (m_handle);
644  std::string mangled = mangle ? symname (name) : name;
645  Data symbol = 0;
646 
647 #if HAVE_DLOPEN || HAVE_LOAD
648  // See comments in "self()" about crashes in dlerror().
649  const char *error = 0;
650  symbol = ::dlsym (m_handle, mangled.c_str ());
651  if (! symbol && (error = ::dlerror ()) != 0)
652  throw SharedLibraryError ("dlsym()", error);
653 
654 #elif HAVE_SHL_LOAD
655  shl_t handle = (shl_t) m_handle;
656  if (::shl_findsym (&handle, mangled.c_str (), TYPE_DATA, &symbol) != 0)
657  throw SharedLibraryError ("shl_findsym()", errno);
658  assert (handle == (shl_t) m_handle);
659 
660 #elif defined _WIN32
661  if (! (symbol = (Data)::GetProcAddress((HINSTANCE)m_handle, mangled.c_str())))
662  throw SharedLibraryError ("GetProcAddress()", GetLastError ());
663 #else
664  // cannot get here---`load' and `self' should take care of it.
665  assert (false);
666 #endif
667  return symbol;
668 }
669 
678 SharedLibrary::function (const std::string &name, bool mangle /* = true */) const
679 {
680  assert (! name.empty ());
681  assert (m_handle);
682  std::string mangled = mangle ? symname (name) : name;
683  Function symbol = 0;
684 
685 #if HAVE_DLOPEN || HAVE_LOAD
686  // See comments in "self()" about crashes in dlerror().
687  const char *error = 0;
688  union { Function func; Data data; } sym;
689  sym.data = ::dlsym (m_handle, mangled.c_str ());
690  if (! sym.data && (error = ::dlerror ()) != 0)
691  throw SharedLibraryError ("dlsym()", error);
692  symbol = sym.func;
693 
694 #elif HAVE_SHL_LOAD
695  shl_t handle = (shl_t) m_handle;
696  if (::shl_findsym (&handle, mangled.c_str (), TYPE_PROCEDURE, &symbol) != 0)
697  throw SharedLibraryError ("shl_findsym()", errno);
698  assert (handle == (shl_t) m_handle);
699 
700 #elif defined _WIN32
701  if (! (symbol = (Function) ::GetProcAddress ((HINSTANCE) m_handle,
702  mangled.c_str ())))
703  throw SharedLibraryError ("GetProcAddress()", GetLastError ());
704 #else
705  // cannot get here---`load' and `self' should take care of it.
706  assert (false);
707 #endif
708  return symbol;
709 }
710 
711 //} // namespace seal wlav
712 } // namespace Athena wlav
713 
grepfile.info
info
Definition: grepfile.py:38
Athena::SharedLibrary::LibraryInfo::m_data_start
unsigned long m_data_start
Definition: SealSharedLib.h:168
Athena::SharedLibrary::Data
void * Data
Definition: SealSharedLib.h:160
Athena::SharedLibrary::LibraryInfo::m_text_start
unsigned long m_text_start
Definition: SealSharedLib.h:166
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
Athena::SharedLibrary::data
Data data(const std::string &name, bool mangle=true) const
Locate and return a reference to a data symbol called name.
Definition: SealSharedLib.cxx:640
jet::ExtendedBool::TRUE
@ TRUE
Definition: UncertaintyEnum.h:234
index
Definition: index.py:1
SealDebug.h
This are the SEAL debug aids, adapted to build in Atlas, after the drop of that project.
Athena::SharedLibrary::SharedLibrary
SharedLibrary(void *handle)
Protected constructor for initialising a library object.
Definition: SealSharedLib.cxx:587
SealCommon.h
Collecting a few shared bits and pieces from SEAL headers.
SHLIB_UNSUPPORTED
#define SHLIB_UNSUPPORTED
Definition: SealSharedLib.cxx:75
Athena::SharedLibrary::LibraryInfo::m_data_end
unsigned long m_data_end
Definition: SealSharedLib.h:169
Athena::SharedLibraryError
Error in a shared library operation.
Definition: SealSharedLib.h:144
Athena::SharedLibrary::LibraryInfo::m_bss_end
unsigned long m_bss_end
Definition: SealSharedLib.h:171
handler
void handler(int sig)
signal handler
Definition: rmain.cxx:99
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Athena::SharedLibraryError::m_message
std::string m_message
Definition: SealSharedLib.h:152
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
SealSharedLib.h
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
Athena::SharedLibrary::path
static std::string path(void)
Definition: SealSharedLib.cxx:148
lumiFormat.i
int i
Definition: lumiFormat.py:85
Athena::SharedLibrary::LibraryInfo::m_bss_start
unsigned long m_bss_start
Definition: SealSharedLib.h:170
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
Athena::SharedLibrary::load
static SharedLibrary * load(const std::string &name)
Load a shared library and return an object representing it.
Definition: SealSharedLib.cxx:241
Athena::SharedLibrary::Function
void(* Function)(void)
Definition: SealSharedLib.h:161
Athena::SharedLibrary::LibraryInfo::m_filename
const char * m_filename
Definition: SealSharedLib.h:172
Athena::SharedLibrary::LibraryInfo::m_text_end
unsigned long m_text_end
Definition: SealSharedLib.h:167
beamspotman.stat
stat
Definition: beamspotman.py:266
Athena::SharedLibrary::~SharedLibrary
~SharedLibrary(void)
Protected destructor for cleaning up a library object.
Definition: SealSharedLib.cxx:593
Athena::SharedLibrary::release
void release(void)
Release a shared library.
Definition: SealSharedLib.cxx:602
mc.proc
proc
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Athena::SharedLibrary::symname
static std::string symname(const std::string &name)
Transform 'extern "C"' symbol name into a name suitable for lookup in a shared library,...
Definition: SealSharedLib.cxx:196
Athena::SharedLibraryError::what
virtual const char * what() const
Definition: SealSharedLib.cxx:101
Athena::SharedLibrary::LibraryInfo
Information about a currently loaded shared library.
Definition: SealSharedLib.h:165
Athena::SharedLibrary::abandon
void abandon(void)
Abandon a library.
Definition: SealSharedLib.cxx:625
Athena::SharedLibrary
Shared library services.
Definition: SealSharedLib.h:158
ElfW
ElfW(Dyn) _DYNAMIC[]
Athena::Callback1
Definition: SealSharedLib.h:51
Athena::SharedLibrary::libname
static std::string libname(const std::string &name)
Return a shared library name that follows the system conventions for naming shared library.
Definition: SealSharedLib.cxx:178
Athena::SharedLibrary::m_handle
void * m_handle
Definition: SealSharedLib.h:197
DeMoScan.index
string index
Definition: DeMoScan.py:364
windows.h
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
PATH
TString PATH
Definition: run_EoverP.cxx:91
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
Athena::SharedLibrary::loaded
static void loaded(InfoHandler &handler)
Iterate and provide information about all currently loaded shared libraries.
Definition: SealSharedLib.cxx:276
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
Athena::SharedLibraryError::SharedLibraryError
SharedLibraryError(const std::string &context, const std::string &cause)
Definition: SealSharedLib.cxx:81
Athena::SharedLibrary::self
static SharedLibrary * self(void)
Return a shared library object representing the application itself.
Definition: SealSharedLib.cxx:206
error
Definition: IImpactPoint3dEstimator.h:70
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:33
Athena::SharedLibrary::function
Function function(const std::string &name, bool mangle=true) const
Locate and return a reference to a function symbol called name.
Definition: SealSharedLib.cxx:678
Athena::ATLAS_NOT_THREAD_SAFE
void DebugAids::stacktraceLine ATLAS_NOT_THREAD_SAFE(IOFD fd, unsigned long addr)
Write out stack trace line to FD.
Definition: SealDebug.cxx:328