Breakpoints

Breakpoints work like other breakpoints of your IDE.

How to set breakpoints

The easiest way to set a new breakpoint is to use the gutter on the left:

Bash script without breakpoint
Bash script without breakpoint

Click into the empty space on the left. A breakpoint is displayed like this:

Bash script with a breakpoint
Bash script with a breakpoint

Once you start the debugger, an active breakpoint has an additional check mark:

Bash script with an active breakpoint
Bash script with an active breakpoint

How to remove breakpoints

Click on the breakpoint icon to remove it.

Limitations

At this time, only line breakpoints are supported. You can only set breakpoints on non–empty lines.

A breakpoint is only stopping execution for the first instruction on a line. You can’t step over multiple instructions on the same line.

Conditional breakpoints

A conditional breakpoint only stops the execution when the conditional evaluates to true.

To set a condition on a breakpoint:

  1. Right–click on the breakpoint icon
  2. Enter the condition into the text input field
  3. Close the popup to apply the settings
    How to configure a conditional breakpoint in BashSupport pro
    How to configure a conditional breakpoint in BashSupport pro

A conditional breakpoint is marked with a question mark:

An active, conditional breakpoint is marked with an additional check mark:

Examples of conditional breakpoints
The script stops at the breakpoint when the condition evaluates to true (i.e. 0). Here are a few examples:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# stop execution when the value of $name equals "foo"
test $name = "foo"
# same as above
[ $name = "foo" ]

# stop execution when the value of $name begins with "fo"
[[ $name =~ "fo" ]]

# stop execution when the value of $num is a number greater than 120
[[ $num -gt 120 ]]
Conditional breakpoints in BashSupport Pro
Conditional breakpoints in BashSupport Pro

Temporary breakpoints

A temporary breakpoint is removed as soon as it’s hit.

  1. Right–click on a breakpoint
  2. Mark the checkbox Remove after first hit (temporary breakpoint)
    A temporary breakpoint in BashSupport Pro
    A temporary breakpoint in BashSupport Pro

How to configure breakpoints

Your IDE provides a list of the breakpoints. This dialog also allows you to configure the properties of each breakpoint.

Breakpoint settings dialog
Breakpoint settings dialog