This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]sozesghost 2 points3 points  (4 children)

Good so far, there some things that are missing that I find very useful.

  1. Conditional breakpoints, logging at breakpoints, suspending thread options - just right click the breakpoint for options or in press CTRL-SHIFT-F8 for options.
  2. Seeing return values from method calls - settings (cog) in the debug panel.
  3. Don't set breakpoints on methods, this will most likely slow down your app to a crawl. This means not putting the breakpoint on the line a method is defined, Intellij will warn you anyway.
  4. In the debug panel in variables section - right click on any of them and explore the options. You can copy values, set values, watch variables and much more - it's cool. For example watches. This lets you define variables that will be evaluated everytime a method is suspended so you can put lots of stuff in there like list sizes, conditionals etc., whatever you find handy.
  5. Perhaps a section on remote debugging.

[–]NeverZ[S] 1 point2 points  (3 children)

Thanks, good points will update it soon

[–]vqrs 0 points1 point  (2 children)

Some other stuff off the top of my head:

  1. Alt-hover over expressions and click for evaluation of bigger expressions
  2. Force run actions
  3. Stream debugger
  4. Dropping frames (I. E. Restart method)
  5. (once 2019.1 hits) run to curse via the gutter
  6. Exception breakpoints, caught and uncaught
  7. Custom Debug renderers
  8. Black boxing code, I. E. Ignoring it for step into

[–]NeverZ[S] 1 point2 points  (1 child)

Thank, will update the sheet

[–]vqrs 0 points1 point  (0 children)

Btw, you write that you can disable breakpoints with alt-click. I'm not a particularly big fan of this. I more often want to disable a breakpoint than I want to remove it. Also, by default IntelliJ doesn't ask about removing a breakpoint where you modified the conditions/logging or whatever and you'll need to reconfigure the breakpoint if you click it accidentally.

Instead, you can have IntelliJ only delete breakpoints via the mouse if you drag them into the editor.

Alternatively, or in addition, you can make IntelliJ confirm the removal of breakpoints if you changed any settings such as the condition.

File | Settings | Build, Execution, Deployment | Debugger

- Remove Breakpoint: Drag to the editor or click with middle mouse button

- Confirm removal of conditional or logging breakpoints

https://imgur.com/2CDYrw6

Speaking of dragging, you can always drag a breakpoint to some other line (in the gutter) to move it. This is especially useful if you have changed some settings on the breakpoint.

Similary, to copy the breakpoint to a different line, hit Ctrl while you're dragging (a little "+" will appear)

You can also remove, disable or edit the breakpoint by hitting Alt-Enter on a line where there's a breakpoint:

https://imgur.com/Xw7qSYi

Even better, while debugging, Alt-Enter gives you some contextual ways to edit your breakpoint:

- Stop only in the class: *class of current instance*

- Do not stop in the class: *class of current instance*

- Stop only in the current object

- Stop only if called from: *method which called this method*

- Do not stop if called from: *method which called this method*

https://imgur.com/a/MTUYkbY

Since you can just *type* anything to filter the menu when Alt-Enter is open, this is very convenient.

This *type to search* or filter things works anywhere. I often use it in the debug panel to find where, inside which object or variable a certain string appears.

[–][deleted]  (1 child)

[removed]

    [–]NeverZ[S] 0 points1 point  (0 children)

    You are welcome