Software Debugging series: Setting breakpoints for. NET application debugging

Source: Internet
Author: User
Setting breakpoints for. NET application debugging

In the software debugging process, the breakpoint function is crucial. Imagine how difficult it is to view the execution of a specific function if there is no breakpoint function.

. Net Applications compile intermediate code at cost during execution. That is to say, if the intermediate code is not compiled at cost, we cannot use the plug-in SOS of the BP program. DLL and sosex. DLL provides some useful extension commands to help us complete this task.

First, let's take a look at the application of the bpmd Command provided by SOS. dll.

! The bpmd command format is as follows:

0: 004>! Help bpmd

-------------------------------------------------------------------------------

! Bpmd [-nofuturemodule] <Module name> <Method Name>

! Bpmd-MD <methoddesc>

! Bpmd-list

! Bpmd-clear <pending breakpoint number>

! Bpmd-clearall

 

We can see from the above that bpmd supports setting assertions by function name or function address.

Note the following two points:

1: If it passes! To set a breakpoint, You need to include the namespace in the <Method Name> field, as shown in the following example:

! Bpmd consoleapplication test. ctest. Hello

Test Is the namespace.

2: If the breakpoint function is not compiled at the cost of code, bpmd will set the breakpoint when receiving the code that the breakpoint function is compiled at the cost, at the same time, if the module of the function where the breakpoint is to be set is not loaded, add the-nofuturemodule option to notify the bpdm module that it may not be loaded.

In addition, sosex. dll provides a particularly useful breakpoint setting function. You can set the breakpoint by specifying the source code line number. The command format is:

! Sosex. MBP <Source File> <line number> [column number> [Options] "command"

The functions of each field are as follows:

1: source file source code name

2: line number

3: column number

4: Options:

/1 set a breakpoint

/P: N: After skipping N times, set the breakpoint/P: 3 indicates that the breakpoint is set when the code is executed for 3rd Times.

5:/T: N: breakpoint on the specified Thread

6: "command" indicates the Command executed when a breakpoint is triggered.

 

 

 

 

2013-05-08 Cuiweican
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.