debugImage.tsx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. // Candidate Processing Info
  2. export enum CandidateProcessingStatus {
  3. OK = 'ok',
  4. MALFORMED = 'malformed',
  5. ERROR = 'error',
  6. }
  7. export enum SymbolType {
  8. UNKNOWN = 'unknown',
  9. BREAKPAD = 'breakpad',
  10. ELF = 'elf',
  11. MACHO = 'macho',
  12. PDB = 'pdb',
  13. PE = 'pe',
  14. SOURCEBUNDLE = 'sourcebundle',
  15. WASM = 'wasm',
  16. PROGUARD = 'proguard',
  17. }
  18. export enum ImageFeature {
  19. HAS_SOURCES = 'has_sources',
  20. HAS_DEBUG_INFO = 'has_debug_info',
  21. HAS_UNWIND_INFO = 'has_unwind_info',
  22. HAS_SYMBOLS = 'has_symbols',
  23. }
  24. type CandidateProcessingInfoOkStatus = {
  25. status: CandidateProcessingStatus.OK;
  26. };
  27. type CandidateProcessingInfoOtherStatus = {
  28. status: CandidateProcessingStatus.MALFORMED | CandidateProcessingStatus.ERROR;
  29. details?: string;
  30. };
  31. export type CandidateProcessingInfo =
  32. | CandidateProcessingInfoOkStatus
  33. | CandidateProcessingInfoOtherStatus;
  34. // Candidate Download Status
  35. export enum CandidateDownloadStatus {
  36. OK = 'ok',
  37. MALFORMED = 'malformed',
  38. NOT_FOUND = 'notfound',
  39. ERROR = 'error',
  40. NO_PERMISSION = 'noperm',
  41. DELETED = 'deleted',
  42. UNAPPLIED = 'unapplied',
  43. }
  44. type ImageFeatures = {
  45. [ImageFeature.HAS_SOURCES]: boolean;
  46. [ImageFeature.HAS_DEBUG_INFO]: boolean;
  47. [ImageFeature.HAS_UNWIND_INFO]: boolean;
  48. [ImageFeature.HAS_SYMBOLS]: boolean;
  49. };
  50. type CandidateFeatures = ImageFeatures;
  51. type CandidateDownloadOkStatus = {
  52. features: CandidateFeatures;
  53. status: CandidateDownloadStatus.OK;
  54. details?: string;
  55. };
  56. type CandidateDownloadDeletedStatus = {
  57. features: CandidateFeatures;
  58. status: CandidateDownloadStatus.DELETED;
  59. details?: string;
  60. };
  61. type CandidateDownloadNotFoundStatus = {
  62. status: CandidateDownloadStatus.NOT_FOUND;
  63. details?: string;
  64. };
  65. type CandidateDownloadUnAppliedStatus = {
  66. features: CandidateFeatures;
  67. status: CandidateDownloadStatus.UNAPPLIED;
  68. };
  69. type CandidateDownloadOtherStatus = {
  70. status:
  71. | CandidateDownloadStatus.MALFORMED
  72. | CandidateDownloadStatus.NO_PERMISSION
  73. | CandidateDownloadStatus.ERROR;
  74. details?: string;
  75. };
  76. export type CandidateDownload =
  77. | CandidateDownloadNotFoundStatus
  78. | CandidateDownloadOkStatus
  79. | CandidateDownloadDeletedStatus
  80. | CandidateDownloadUnAppliedStatus
  81. | CandidateDownloadOtherStatus;
  82. interface ImageCandidateBase {
  83. location: string;
  84. source: string;
  85. source_name?: string;
  86. }
  87. type InternalSource = {
  88. dateCreated: string;
  89. filename: string;
  90. location: string;
  91. prettyFileType: string;
  92. size: number;
  93. symbolType: SymbolType;
  94. };
  95. export interface ImageCandidateOk extends ImageCandidateBase {
  96. download: CandidateDownloadOkStatus;
  97. debug?: CandidateProcessingInfo;
  98. unwind?: CandidateProcessingInfo;
  99. }
  100. export interface ImageCandidateInternalOk extends ImageCandidateBase, InternalSource {
  101. download: CandidateDownloadOkStatus;
  102. debug?: CandidateProcessingInfo;
  103. unwind?: CandidateProcessingInfo;
  104. }
  105. export interface ImageCandidateUnApplied extends ImageCandidateBase, InternalSource {
  106. download: CandidateDownloadUnAppliedStatus;
  107. source: string;
  108. source_name?: string;
  109. }
  110. interface ImageCandidateOthers extends ImageCandidateBase {
  111. download:
  112. | CandidateDownloadNotFoundStatus
  113. | CandidateDownloadDeletedStatus
  114. | CandidateDownloadOtherStatus;
  115. location: string;
  116. source: string;
  117. source_name?: string;
  118. }
  119. export type ImageCandidate =
  120. | ImageCandidateOk
  121. | ImageCandidateInternalOk
  122. | ImageCandidateUnApplied
  123. | ImageCandidateOthers;
  124. // Debug Status
  125. export enum ImageStatus {
  126. FOUND = 'found',
  127. UNUSED = 'unused',
  128. MISSING = 'missing',
  129. MALFORMED = 'malformed',
  130. FETCHING_FAILED = 'fetching_failed',
  131. TIMEOUT = 'timeout',
  132. OTHER = 'other',
  133. }
  134. export type Image = {
  135. candidates: Array<ImageCandidate>;
  136. features: ImageFeatures;
  137. type: string;
  138. arch?: string;
  139. code_file?: string | null;
  140. code_id?: string;
  141. debug_file?: string;
  142. debug_id?: string;
  143. debug_status?: ImageStatus | null;
  144. image_addr?: string;
  145. image_size?: number;
  146. image_vmaddr?: string;
  147. unwind_status?: ImageStatus | null;
  148. uuid?: string;
  149. };