Bagikan melalui


/debug (Visual Basic)

Causes the compiler to generate debugging information and place it in the output file(s).

/debug[+ | -]
' -or-
/debug:[full | pdbonly]

Arguments

  • + | -
    Optional. Specifying + or /debug causes the compiler to generate debugging information and place it in a .pdb file. Specifying - has the same effect as not specifying /debug.

  • full | pdbonly
    Optional. Specifies the type of debugging information generated by the compiler. If you do not specify /debug:pdbonly, the default is full, which enables you to attach a debugger to the running program. The pdbonly argument allows source-code debugging when the program is started in the debugger, but it displays assembly-language code only when the running program is attached to the debugger.

Remarks

Use this option to create debug builds. If you do not specify /debug, /debug+, or /debug:full, you will be unable to debug the output file of your program.

By default, debugging information is not emitted (/debug-). To emit debugging information, specify /debug or /debug+.

For information on how to configure the debug performance of an application, see Making an Image Easier to Debug.

To set /debug in the Visual Studio integrated development environment

  1. With a project selected in Solution Explorer, on the Project menu, click Properties. For more information, see Introduction to the Project Designer.

  2. Click the Compile tab.

  3. Click Advanced Compile Options.

  4. Modify the value in the Generate Debug Info box.

Example

The following example puts debugging information in output file App.exe.

vbc /debug /out:app.exe test.vb

See Also

Reference

/bugreport

Sample Compilation Command Lines

Other Resources

Visual Basic Compiler