1
0

patch-src_linux_mrd_components_cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --- mrd6-0.9.6.orig/src/linux/mrd_components.cpp 2007-01-07 03:11:27.000000000 +0100
  2. +++ mrd6-0.9.6/src/linux/mrd_components.cpp 2010-11-11 11:16:08.114995686 +0100
  3. @@ -28,10 +28,6 @@
  4. #include <mrdpriv/linux/us_mfa.h>
  5. #include <mrdpriv/linux/icmp_raw.h>
  6. -#if defined(__GLIBC__) && !defined(__UCLIBC__)
  7. -#include <execinfo.h>
  8. -#endif
  9. -
  10. bool mrd::prepare_os_components() {
  11. m_mfa = new us_mfa();
  12. @@ -57,45 +53,14 @@ const char *mrd::loopback_interface_name
  13. #define MAX_DEEP_BACKTRACE 32
  14. void mrd::output_backtrace(base_stream &out) const {
  15. -#if defined(__GLIBC__) && !defined(__UCLIBC__)
  16. - void *bt[MAX_DEEP_BACKTRACE];
  17. -
  18. - int count = backtrace(bt, MAX_DEEP_BACKTRACE);
  19. -
  20. - char **btnames = backtrace_symbols(bt, count);
  21. -
  22. - for (int i = 0; i < count; i++) {
  23. - out.xprintf("#%i %s\n", i+1, btnames[i]);
  24. - }
  25. -
  26. - free(btnames);
  27. -#else
  28. out.writeline("Backtraces aren't available in this system.");
  29. -#endif
  30. }
  31. char *mrd::obtain_frame_description(void *ptr) const {
  32. -#if defined(__GLIBC__) && !defined(__UCLIBC__)
  33. - void *p[1] = { ptr };
  34. -
  35. - char **names = backtrace_symbols(p, 1);
  36. - char *ret = strdup(names[0]);
  37. - free(names);
  38. -
  39. - return ret;
  40. -#else
  41. return 0;
  42. -#endif
  43. }
  44. void *mrd::posix_uctx::get_current_frame() const {
  45. -#if defined(__GLIBC__)
  46. -#if defined(__i386__)
  47. - return (void *)base->uc_mcontext.gregs[REG_EIP];
  48. -#elif defined(__mips__)
  49. - return (void *)base->uc_mcontext.gpregs[CTX_EPC];
  50. -#endif
  51. -#endif
  52. return 0;
  53. }