0

Netbeans has a variable tab that appears when debugging. It works great for for example booleans as I see the name of the variable and its value (e.g. "true") and Strings (as I see e.g. "Dog") but I in the case of arrays, for example an array of Strings, I see something like #57(length=13) but would like to see its contents i.e. {"a", "b", "c", "d"}. Is this possible in Netbeans?

2
  • 1
    I haven't used Netbeans, but I'd expect arrays to just be expandable to see their contents - like a directory in a file explorer... Commented Feb 21, 2016 at 12:45
  • You're right - there is a tiny "+" sign I haven't seen. Thanks. Commented Feb 21, 2016 at 12:54

4 Answers 4

1

A very old question, but I've found an easy solution for Netbeans 12.0.

When debugging, in the Variables tab, right-click on the table's header (for example Value header), and check String value: String representation of the value.

A new column String value will be added with the toString() value.

Sign up to request clarification or add additional context in comments.

Comments

0

You can add expressions to the watch expressions. They are expandable.

Comments

0

u can use the "Expression Evaluation" windows. It's less comfortable then "Variables" window but still helpful. to get this windows go to "WIndows" --> "Debugging" --> "Expression Evaluation".

there if you have, for example, array of type "items_t" called "items" , u just type "items[0]" and it shows you all what inside that index.

I still have not managed to find out how to print the whole array.

Comments

0

In variable tab, just add a new watch,

like *table_name@table_size

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.