Skip to content

Add stacktrace_to_short_text() for Java #249

Description

@mhabrnal

sr_stacktrace_to_short_text() uses for Java type the default stacktrace_to_short_text() function which do not normalize frames.

The truncated Java backtrace for 5 top frames can looks like follows:

#1 java.lang.NullPointerException
#2   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:30) [file:/usr/share/java/willcrash/willuncaught.jar]
#3   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:33) [file:/usr/share/java/willcrash/willuncaught.jar]
#4   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:33) [file:/usr/share/java/willcrash/willuncaught.jar]
#5   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:33) [file:/usr/share/java/willcrash/willuncaught.jar]

Some information is not needed in truncated backtrace, for instance file part. We would like to have something like follows:

#1 java.lang.NullPointerException
#2   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:30)
#3   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:33)
#4   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:33)
#5   at WontCatchNullPointerException.die_hard(WontCatchNullPointerException.java:33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions