Miss Cellanie
Miss Cellanie

Reputation: 153

toString() unavailable error in Eclipse debugger

While stepping through a method using the Eclipse debugger, I started seeing "toString() unavailable - no suspended threads" for all the variables I wanted to inspect.

Why did I get that error, and what should I do next to narrow down the problem in my code?

edit My code does create a new process, but the variables I wanted to examine exist in the main application thread, and that thread didn't appear dead (in the Debug panel or the Console).

I'm using Eclipse 3.4.

Upvotes: 5

Views: 14704

Answers (2)

Eli Acherkan
Eli Acherkan

Reputation: 6411

I can think of a few scenarios when a method (in particular, toString()) would be unavailable:

  • When the execution is suspended by pressing the "Suspend" button (the one with the "pause" icon), as opposed to reaching a breakpoint.
  • When you've reached a breakpoint, and you're in the middle of evaluating an expression.

In any case, even with toString() unavailable, you should be able to inspect the current values in the upper part of the "Variables" view.

Also, try looking at the relevant preferences (Window → Preferences → Java → Debug), in particular the ones under "Detail Formatters". You can also try the "Restore Defaults" button.

Upvotes: 4

Joe Daley
Joe Daley

Reputation: 46466

This sounds like a bug in early versions of Eclipse 3.1: https://bugs.eclipse.org/bugs/show_bug.cgi?id=81249

Try upgrading your Eclipse?

Upvotes: 0

Related Questions