| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.sys2; |
| |
| using fuchsia.component; |
| using fuchsia.component.types; |
| using zx; |
| |
| /// Information stored when a thread crashes. |
| type ComponentCrashInfo = table { |
| 1: url string:fuchsia.component.types.MAX_URL_LENGTH; |
| 2: moniker string:fuchsia.component.MAX_MONIKER_LENGTH; |
| }; |
| |
| /// When a thread from a component using the ELF runner crashes, the thread |
| /// koid along with other information is stored. This protocol can be used to |
| /// retrieve that stored information. |
| @discoverable |
| protocol CrashIntrospect { |
| /// Given a thread koid, returns the information that was stored when the |
| /// ELF runner observed a crash from that thread. |
| /// |
| /// The information for a crash is deleted when it is accessed or when 10 |
| /// minutes have passed, whichever comes first. |
| /// |
| /// If there is no information available on the given thread koid, |
| /// `zx::Status::NOT_FOUND` is returned. |
| FindComponentByThreadKoid(resource struct { |
| thread_koid zx.koid; |
| }) -> (struct { |
| info ComponentCrashInfo; |
| }) error fuchsia.component.Error; |
| }; |