Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dumping a huge array in Intellij-Idea debugger

Tags:

Is there a way in Idea to dump the content of a large - very - array of ints into the clipboard ?

'copy value' on an array return nothing.

like image 422
ic3 Avatar asked Nov 05 '15 16:11

ic3


People also ask

What is drop frame IntelliJ debug?

Drop Frame within the debugger pops the current stack frame and puts control back out to the calling method, resetting any local variables. This is very useful to repeatedly step through a function, but be warned: field mutations or global state changes will remain.

How do I compile debug in IntelliJ?

Run the program in debug modeClick the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.

What does debugging do in IntelliJ?

During a debugging session, you launch your program with the debugger attached to it. The purpose of the debugger is to interfere with the program execution and provide you with the information on what's happening under the hood. This facilitates the process of detecting and fixing bugs in your program.

How to dump a huge array in IntelliJ-IDEA debugger?

Dumping a huge array in Intellij-Idea debugger. 1 Right click on your array variable. 2 Select "View as->Create..." 3 In the "Java Data Type Renderers" window, create a new entry, set "When rendering a node, use following expression" with Arrays.toString (this). 4 Apply, select your array variable and do Ctrl-C to get the content.

Can IntelliJ IDEA debug Java code?

IntelliJ IDEA provides a debugger for Java code. Depending on the installed/enabled plugins, you can also debug code written in other languages. During a debugging session, you launch your program with the debugger attached to it.

What is IntelliJ and how to use it?

IntelliJ allows creating breakpoints that pause the execution only if a user-defined condition is satisfied. Here's an example that uses the source code above: Now the debugger will stop on the breakpoint only if the given argument is greater than 3. 7. Object Marks This is the most powerful and the least known IntelliJ feature.

What's new in IntelliJ IDEA 2017?

As usual, the newest version of IntelliJ IDEA contains updates to help you debug applications. Given that we are working more and more with large data sets, IntelliJ IDEA 2017.2 has added the ability to filter arrays and collections in our variables or watches. In this example, I have a variable allWords that’s a list of Strings.


2 Answers

To get the value in the clipboard using copy value, you need to define a "Java Data Type Renderer" to interpret the content of your array.

  • Right click on your array variable
  • Select "View as->Create..."
  • In the "Java Data Type Renderers" window, create a new entry, set "When rendering a node, use following expression" with Arrays.toString(this).
  • Apply, select your array variable and do Ctrl-C to get the content.
like image 161
Mathieu Schmitt Avatar answered Oct 26 '22 22:10

Mathieu Schmitt


  1. Right click variable
  2. Evaluate expression
  3. Type *nameOfYourArray*.toString()
  4. Click evaluate
  5. Ctrl-C to get content
like image 44
Dodi Avatar answered Oct 26 '22 22:10

Dodi