Class SentryStackTrace
- java.lang.Object
-
- io.sentry.protocol.SentryStackTrace
-
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
public final class SentryStackTrace extends java.lang.Object implements JsonUnknown, JsonSerializable
A stack trace of a single thread.A stack trace contains a list of frames, each with various bits (most optional) describing the context of that frame. Frames should be sorted from oldest to newest.
For the given example program written in Python:
```python def foo(): my_var = 'foo' raise ValueError()
def main(): foo() ```
A minimalistic stack trace for the above program in the correct order:
```json { "frames": [ {"function": "main"}, {"function": "foo"} ] } ```
The top frame fully symbolicated with five lines of source context:
```json { "frames": [{ "in_app": true, "function": "myfunction", "abs_path": "/real/file/name.py", "filename": "file/name.py", "lineno": 3, "vars": { "my_var": "'value'" }, "pre_context": [ "def foo():", " my_var = 'foo'", ], "context_line": " raise ValueError()", "post_context": [ "", "def main():" ], }] } ```
A minimal native stack trace with register values. Note that the `package` event attribute must be "native" for these frames to be symbolicated.
```json { "frames": [ {"instruction_addr": "0x7fff5bf3456c"}, {"instruction_addr": "0x7fff5bf346c0"}, ], "registers": { "rip": "0x00007ff6eef54be2", "rsp": "0x0000003b710cd9e0" } } ```
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SentryStackTrace.Deserializer
static class
SentryStackTrace.JsonKeys
-
Constructor Summary
Constructors Constructor Description SentryStackTrace()
SentryStackTrace(@Nullable java.util.List<SentryStackFrame> frames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.util.List<SentryStackFrame>
getFrames()
Gets the frames of this stacktrace.@Nullable java.util.Map<java.lang.String,java.lang.String>
getRegisters()
@Nullable java.lang.Boolean
getSnapshot()
@Nullable java.util.Map<java.lang.String,java.lang.Object>
getUnknown()
void
serialize(@NotNull JsonObjectWriter writer, @NotNull ILogger logger)
void
setFrames(@Nullable java.util.List<SentryStackFrame> frames)
Sets the frames of this stacktrace.void
setRegisters(@Nullable java.util.Map<java.lang.String,java.lang.String> registers)
void
setSnapshot(@Nullable java.lang.Boolean snapshot)
void
setUnknown(@Nullable java.util.Map<java.lang.String,java.lang.Object> unknown)
-
-
-
Constructor Detail
-
SentryStackTrace
public SentryStackTrace()
-
SentryStackTrace
public SentryStackTrace(@Nullable @Nullable java.util.List<SentryStackFrame> frames)
-
-
Method Detail
-
getFrames
@Nullable public @Nullable java.util.List<SentryStackFrame> getFrames()
Gets the frames of this stacktrace.- Returns:
- the frames.
-
setFrames
public void setFrames(@Nullable @Nullable java.util.List<SentryStackFrame> frames)
Sets the frames of this stacktrace.- Parameters:
frames
- the frames.
-
getRegisters
@Nullable public @Nullable java.util.Map<java.lang.String,java.lang.String> getRegisters()
-
setRegisters
public void setRegisters(@Nullable @Nullable java.util.Map<java.lang.String,java.lang.String> registers)
-
getSnapshot
@Nullable public @Nullable java.lang.Boolean getSnapshot()
-
setSnapshot
public void setSnapshot(@Nullable @Nullable java.lang.Boolean snapshot)
-
getUnknown
@Nullable public @Nullable java.util.Map<java.lang.String,java.lang.Object> getUnknown()
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
public void setUnknown(@Nullable @Nullable java.util.Map<java.lang.String,java.lang.Object> unknown)
- Specified by:
setUnknown
in interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws java.io.IOException
- Specified by:
serialize
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
-