issueDebugMeta.stories.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import SentryTypes from 'app/sentryTypes';
  4. import DebugMeta from 'app/components/events/interfaces/debugMeta';
  5. const event = {
  6. id: 'deadbeef',
  7. eventID: 'deadbeef',
  8. groupID: '999',
  9. title: 'thread failing!',
  10. metadata: {
  11. function: 'thread_demo',
  12. type: 'thread_demo',
  13. value: 'Failing!',
  14. },
  15. tags: {},
  16. contexts: {},
  17. entries: [
  18. {
  19. type: 'debugmeta',
  20. data: {
  21. images: [
  22. {
  23. code_file: '/Users/uhoh/code/thread-demo.rs',
  24. image_vmaddr: '0x0',
  25. image_addr: '0x1fe1000',
  26. image_size: 439486848,
  27. type: 'symbolic',
  28. debug_id: '79398811-17a9-3884-9dfb-5552eed86a6f',
  29. features: {
  30. has_debug_info: true,
  31. has_symbols: true,
  32. },
  33. arch: 'x86',
  34. debug_status: 'found',
  35. unwind_status: 'found',
  36. },
  37. {
  38. code_file: '/usr/lib/libSystem.B.dylib',
  39. image_vmaddr: '0x7fff335cb000',
  40. image_addr: '0x7fff3ff1c000',
  41. image_size: 439486848,
  42. type: 'symbolic',
  43. debug_id: 'dfe2454f-2fe3-3b2b-a22b-422947c34c69',
  44. },
  45. {
  46. code_file:
  47. '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation',
  48. image_vmaddr: '0x7fff279a8000',
  49. image_addr: '0x7fff342f9000',
  50. image_size: 439486848,
  51. type: 'symbolic',
  52. debug_id: '79398803-19x7-3844-9dfb-5516cca93c1a',
  53. debug_status: 'malformed',
  54. unwind_status: 'malformed',
  55. },
  56. {
  57. code_file:
  58. '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Unused',
  59. image_vmaddr: '0x7fff279a8000',
  60. image_addr: '0x7fff342f9000',
  61. image_size: 439486848,
  62. type: 'symbolic',
  63. debug_id: '79398803-19x7-3844-9dfb-5516cca93c1a',
  64. debug_status: 'unused',
  65. unwind_status: 'unused',
  66. },
  67. ],
  68. },
  69. },
  70. {
  71. type: 'exception',
  72. data: {
  73. values: [
  74. {
  75. stacktrace: {
  76. frames: [{instructionAddr: '0x1fe1000'}],
  77. },
  78. },
  79. ],
  80. },
  81. },
  82. ],
  83. };
  84. const organization = {
  85. id: '1',
  86. slug: 'org-slug',
  87. access: ['project:releases'],
  88. };
  89. class OrganizationContext extends React.Component {
  90. static childContextTypes = {
  91. organization: SentryTypes.Organization,
  92. };
  93. getChildContext() {
  94. return {organization};
  95. }
  96. render() {
  97. return this.props.children;
  98. }
  99. }
  100. export default {
  101. title: 'Issues/DebugMeta',
  102. };
  103. export const Default = withInfo('Various debug image metadata states')(() => (
  104. <div className="section">
  105. <OrganizationContext>
  106. <DebugMeta
  107. event={event}
  108. data={event.entries[0].data}
  109. orgId={organization.id}
  110. projectId="1"
  111. />
  112. </OrganizationContext>
  113. </div>
  114. ));
  115. Default.story = {
  116. name: 'default',
  117. };