debugImage.tsx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. type ImageCandidateBase = {
  83. source: string;
  84. location?: string;
  85. source_name?: string;
  86. };
  87. type InternalSource = {
  88. cpuName: string;
  89. dateCreated: string;
  90. fileType: string | null;
  91. filename: string;
  92. location: string;
  93. size: number;
  94. symbolType: SymbolType;
  95. };
  96. export type ImageCandidateOk = ImageCandidateBase & {
  97. download: CandidateDownloadOkStatus;
  98. debug?: CandidateProcessingInfo;
  99. unwind?: CandidateProcessingInfo;
  100. };
  101. export type ImageCandidateInternalOk = ImageCandidateBase &
  102. InternalSource & {
  103. download: CandidateDownloadOkStatus;
  104. debug?: CandidateProcessingInfo;
  105. unwind?: CandidateProcessingInfo;
  106. };
  107. export type ImageCandidateUnApplied = ImageCandidateBase &
  108. InternalSource & {
  109. download: CandidateDownloadUnAppliedStatus;
  110. source: string;
  111. source_name?: string;
  112. };
  113. type ImageCandidateOthers = ImageCandidateBase & {
  114. download:
  115. | CandidateDownloadNotFoundStatus
  116. | CandidateDownloadDeletedStatus
  117. | CandidateDownloadOtherStatus;
  118. source: string;
  119. location?: string;
  120. source_name?: string;
  121. };
  122. export type ImageCandidate =
  123. | ImageCandidateOk
  124. | ImageCandidateInternalOk
  125. | ImageCandidateUnApplied
  126. | ImageCandidateOthers;
  127. // Debug Status
  128. export enum ImageStatus {
  129. FOUND = 'found',
  130. UNUSED = 'unused',
  131. MISSING = 'missing',
  132. MALFORMED = 'malformed',
  133. FETCHING_FAILED = 'fetching_failed',
  134. TIMEOUT = 'timeout',
  135. OTHER = 'other',
  136. }
  137. export type Image = {
  138. candidates: Array<ImageCandidate>;
  139. features: ImageFeatures;
  140. type: string;
  141. arch?: string;
  142. code_file?: string | null;
  143. code_id?: string;
  144. debug_file?: string;
  145. debug_id?: string;
  146. debug_status?: ImageStatus | null;
  147. image_addr?: string;
  148. image_size?: number;
  149. unwind_status?: ImageStatus | null;
  150. uuid?: string;
  151. };