(platform, libName)
| 134 | async loadSymbols(libName) {} |
| 135 | |
| 136 | async loadSymbolsRemote(platform, libName) { |
| 137 | this.parsePos = 0; |
| 138 | const url = new URL("http://localhost:8000/v8/loadVMSymbols"); |
| 139 | url.searchParams.set('libName', libName); |
| 140 | url.searchParams.set('platform', platform); |
| 141 | this._setRemoteQueryParams(url.searchParams); |
| 142 | let response; |
| 143 | let json; |
| 144 | try { |
| 145 | response = await fetch(url, { timeout: 20 }); |
| 146 | if (response.status == 404) { |
| 147 | throw new Error( |
| 148 | `Local symbol server returned 404: ${await response.text()}`); |
| 149 | } |
| 150 | json = await response.json(); |
| 151 | if (json.error) console.warn(json.error); |
| 152 | } catch (e) { |
| 153 | if (!response || response.status == 404) { |
| 154 | // Assume that the local symbol server is not reachable. |
| 155 | console.warn("Disabling remote symbol loading:", e); |
| 156 | this._isEnabled = false; |
| 157 | return; |
| 158 | } |
| 159 | } |
| 160 | this._handleRemoteSymbolsResult(json); |
| 161 | } |
| 162 | |
| 163 | _setRemoteQueryParams(searchParams) { |
| 164 | // Subclass responsibility. |
no test coverage detected