debugImage.tsx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. source: string;
  84. location?: string;
  85. source_name?: string;
  86. }
  87. type InternalSource = {
  88. dateCreated: string;
  89. filename: string;
  90. prettyFileType: string;
  91. size: number;
  92. symbolType: SymbolType;
  93. location?: string;
  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. source: string;
  116. source_name?: string;
  117. }
  118. export type ImageCandidate =
  119. | ImageCandidateOk
  120. | ImageCandidateInternalOk
  121. | ImageCandidateUnApplied
  122. | ImageCandidateOthers;
  123. // Debug Status
  124. export enum ImageStatus {
  125. FOUND = 'found',
  126. UNUSED = 'unused',
  127. MISSING = 'missing',
  128. MALFORMED = 'malformed',
  129. FETCHING_FAILED = 'fetching_failed',
  130. TIMEOUT = 'timeout',
  131. OTHER = 'other',
  132. }
  133. export type Image = {
  134. features: ImageFeatures;
  135. type: string;
  136. arch?: string;
  137. candidates?: Array<ImageCandidate>;
  138. code_file?: string | null;
  139. code_id?: string;
  140. debug_file?: string;
  141. debug_id?: string;
  142. debug_status?: ImageStatus | null;
  143. image_addr?: string;
  144. image_size?: number;
  145. image_vmaddr?: string;
  146. unwind_status?: ImageStatus | null;
  147. uuid?: string;
  148. };
  149. export interface ImageWithCombinedStatus extends Image {
  150. /**
  151. * This is not returned from any API but is derived from debug and unwind status
  152. */
  153. status: ImageStatus;
  154. }