debugImage.tsx 3.9 KB

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