Knowledge of Perl Debugging commands summary _perl

Source: Internet
Author: User
Tags perl interpreter perl debugger

The default Perl debugger is the Perl interpreter itself, plus the graphical interface debugger.
Because Telnet is generally used to access the server while developing the program, this article mainly introduces the use of the default command-line debugger.

Start the Perl interpreter with the-D command-line option, such as perl-dtest.pl, which enters the interactive interface of the Perl debugger.

List of DEBUG commands: (All commands are below input at the debug prompt, the command case is case-sensitive)
H: Displays the debugger's help information.
|h: Displays the debugger's help information as a paging form.
HH: Displays a compressed help message.
H Debug Command: Displays Help for a debug command.

A P expression in Perl debugger usage: Displays the value of a variable or expression without displaying the structure and data embedded in the complex variable.

X expression: Displays the value of a variable or expression, displaying the embedded structure and data in a readable form for more complex variables.

V Package name variable names list: Displays the values of all (or part) variables within the specified package. (The default package name is main)

List of x variable names: Displays the values of all (or part) variables in the current package.

Note: The list of variable names in the V and X commands in the Perl debugger usage is separated by a space and the variable name should be removed $, @ or%

T: The call stack of the program is rolled back one level.

S-expression: Step into the child function. (Stepinto) If you provide an expression and include a function call in the expression, step into the function.

N expression: Stepping, bypassing the child function. (stepover)

C line number/function name: Executes to a row or a function.

L: Displays the contents of a window (one screen) that is not executed.

Lmin-max: Displays the contents of the file at Min to Max line.

L line Number: Displays the contents of the specified line.

L Function Name: Displays the contents of one window (one screen) of the specified function.

W line number: Displays the contents of a window (a screen) around a line.

F filename: Switch to another file.

/mode: Finds the matching string forward (end of file) in the current file.

? Mode: Finds a matching string in the current file, backward (header).

L: Displays all breakpoints and additional actions.

S mode: Displays the name of the function that matches (or does not match, plus!) in the pattern.

T: Toggle trace mode.

T-expression: Tracking execution of an expression procedure.

B Line number condition: Set a breakpoint on a line, interrupt when the program executes to the line and the condition is satisfied.

The B function name condition in Perl debugger usage: Set a breakpoint on a function that interrupts when the program executes to the function and the condition is satisfied.

Bload FileName: Sets a breakpoint on the first executable statement of a file.

D line number: Deletes a breakpoint on a row.

D: Remove all breakpoints.

A line number command: Add an additional action to a line in the program. Perform the additional action before executing the line statement.

A: Remove any attached actions that have been installed.

W expression: Adds a watch item.

W: Deletes all watches.

o option name?: The value of the query debugger optional.

o Option name = option value: Sets the value of the debugger's optional option.

Ltperl statement: Sets an action that displays the action performed before the debug prompt.

Ltltperl statement: Adds an action to be performed before the debug prompt is displayed.

Gtperl statement: Sets an action to take when leaving the debug prompt (into run state).

Gtgtperl statement: Adds an action that is performed when you leave the debug prompt (to run state).

{Debug command: Set an action that shows what to do before the debug prompt.

{{Debug command: Set an action that shows what to do before the debug prompt.

Note: Both Perl and Debug commands in the Perl debugger usage can be entered on multiple lines, with the end of the line escaped.

!number: Re-executes the debug command that was executed in the previous number of times.

!-number: Re-execute the debug command that was executed a number of times before now.

! Mode: Re-executes the previously executed debug command that matches the pattern.

!! Command: Do not exit the debugger to execute a shell command.

H-number: Displays the previously executed number bar debug command. If number is omitted, all executed
debugging commands.

R: Restart the program you are debugging.

Q or ^d: Exit the debugger.

| Debug command: Displays the output of the debug command as paging.

|| Debug commands: Similar to | debug commands, suitable for debugging commands with large output, for example: | Vmain.

= Alias Value: An alias to a debug command, for example: =QUITQ. All unrecognized commands: executed as a Perl statement inserted. (using eval)

There are many Perl debugger usages that can be set up to customize the debugger's environment, which is itself developed in Perl, and there are interfaces in Perl publishing that allow you to develop other Perl debuggers.
If you want to develop large projects in Perl, it is necessary to understand these details in detail.
For examples of using the debugger and setting debugger options, refer to the documentation for Perldebug in the Perl release.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.