Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - Is it possible to output the stacktrace with method signatures?

Is it possible to output the current stacktrace with method signatures? I'm trying to debug some obfuscated code that has a ton of methods with the same name that just differ in arguments and return type.

Some things that will not work:

Thread.currentThread().getStackTrace();
new Throwable().getStackTrace();
// etc..
like image 953
jli Avatar asked Nov 04 '11 21:11

jli


Video Answer


2 Answers

Nope, but you could instrument with AspectJ while troubleshooting to get more complete info without adding logging.

Depending on the nature of what you're trying to debug and how much you know about any data involved you might be able to target more or less precisely.

like image 179
Dave Newton Avatar answered Sep 23 '22 03:09

Dave Newton


Not possible. The stacktrace does't contain that info.

like image 37
Bozho Avatar answered Sep 21 '22 03:09

Bozho