`
standalone
  • 浏览: 595182 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

How to print stack trace in your java code?

    博客分类:
  • java
阅读更多

When debugging java code, sometimes it's important to know where you come from. So you can print current stack trace to help you.

 

1. new Exception().printStackTrace();

2. Thread.currentThread().getStackTrace(); This returns an array of StackTraceElement that represents current stack of your program.

分享到:
评论

相关推荐

    Advanced Apple Debugging & Reverse Engineering v0.9.5

    You’ve learned how to create breakpoints, how to print and modify values, as well as how to execute code while paused in the debugger. But so far you’ve been left high and dry on how to move around ...

    JSP Simple Examples

    To print a Date in JSP firstly we are importing a class named java.util.Date of the package java.util. This package is imported in the jsp page so that the Date class and its properties can accessed ...

    Thinking in Java 4th Edition

    Arrays in Java .............................. 44 You never need to destroy an object .................. 45 Scoping ........................................ 45 Scope of objects ...........................

    BobBuilder_app

    You can switch to the SortedDictionary in the code at any time if you wish and it makes no difference to the overall code other than you can remove the sorting in the page splits. I also tried an ...

    Debugging with GDB --2002年5.11

    Table of Contents q q q q q Summary of GDB r Free software r Free Software Needs Free Documentation r Contributors to GDB ...r ADDENDUM: How to use this License for your documents Index

    2009 达内Unix学习笔记

    集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...

    php.ini-development

    If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line ...

    The Art of Assembly Language Programming

    Some Final Comments on the MOV Instructions <br>4.9 Laboratory ...Your Code with MASM 4.9.5 Debuggers and CodeView' 4.9.5.1 A Quick Look at CodeView 4.9.5.2 The Source Window 4.9.5.3 The...

    DebuggingWithGDB 6.8-2008

    2 Getting In and Out of gdb . . . . . . . . . . . . . . . . 11 2.1 Invoking gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Choosing Files . . . ....

    最新版的DebuggingWithGDB7.05-2010

    2 Getting In and Out of gdb . . . . . . . . . . . . . . . . . . . 11 2.1 Invoking gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Choosing ...

    Debugging with GDB --2003年6.0

    2 Getting In and Out of gdb . . . . . . . . . . . . . . . . 11 2.1 Invoking gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Choosing files . . . . . . . ....

    Debugging with GDB --2001年5.3

    2 Getting In and Out of GDB . . . . . . . . . . . . . . . 11 2.1 Invoking GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Choosing files . . . . . . . . . ....

Global site tag (gtag.js) - Google Analytics