# CodeView

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/CodeView
> Markdown URL: https://mediated.wiki/source/CodeView.md
> Source: https://en.wikipedia.org/wiki/CodeView
> Source revision: 1138142583
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Full-screen debugger for DOS by Microsoft

CodeView Original author David Norris Developer Microsoft Release 1985; 41 years ago (1985) Operating system MS-DOS Platform x86 Type Debugger

**CodeView** is a standalone [debugger](/source/Debugger) created by David Norris at [Microsoft](/source/Microsoft) in 1985 as part of its development toolset.[1] It originally shipped with Microsoft C 4.0 and later. It also shipped with [Visual Basic](/source/Visual_Basic_(classic)) for [MS-DOS](/source/MS-DOS), [Microsoft BASIC PDS](/source/Microsoft_BASIC_PDS), and a number of other Microsoft language products.[2] It was one of the first debuggers for MS-DOS to be full-screen oriented, rather than line-oriented (as Microsoft's predecessors [DEBUG](/source/DEBUG_(DOS_command)) and [SYMDEB](/source/SYMDEB) or [Digital Research](/source/Digital_Research)'s SID).

## Overview

When running, CodeView presents the user with several [windows](/source/Window_(computing)) that can be tiled, moved, sized and otherwise manipulated via the keyboard or mouse, with CodeView 4.x providing a richer interface. Some of the windows include:

- Code window – the code window showed the currently debugged code in its [source code](/source/Source_code) context.

- Data window – a [hexadecimal dump](/source/Hex_dump) of a user-specified memory area.

- Watch window – a contextual display of variables by name.

- Locals window – a contextual display of variables local to the current function.

- Command window – user commands (using the same or similar syntax as DEBUG and SYMDEB) could be entered here.

- Assembly window – the assembly (machine code) was displayed, allowing for single-stepping through functions.

- Register window – to visualize the [80x86](/source/80x86) register contents, including segments, flags and the [FPU](/source/Floating-point_unit) (CodeView existed before [MMX](/source/MMX_(instruction_set)) and other [SIMD](/source/SIMD) extensions).

- Output window – a window showing startup operations and debugging information relating to breakpoints,[2] hardware breaks (interrupt 0 and 3), etc.

### Features

- 386 mode – 8086, 80286 and 80386 and later processors. 386 enhanced mode is activated by a menu option, allowing for 32-bit registers and disassembly.

- Monochrome monitor support – allows debugging on either a single color (CGA, EGA or VGA) monitor with page/memory swapping between the user application and the CodeView screen, or using a separate monochrome monitor. The monochrome monitor exists in memory address space 0xb0000, while the color monitor exists at 0xb8000 for text and 0xa0000 for graphics. Use of the monochrome monitor with its separate memory address space allows debugging graphics applications without affecting the display, as well as all text modes. Monochrome monitors are limited to 25 lines, whereas color monitors allow 25, 43 or 50 line mode, allowing for more information on the screen at the same time.

Creating symbolic debugging output, which allows memory locations to be viewed by their programmer-assigned name, along with a program database showing the source code line related to every computer instruction in the binary executable, is enabled by the command line switch -Zi given to the compiler, and -CO given to the linker. Variants like -Zs and -Zd provide lesser information, and smaller output files which, during the early 1990s, were important due to limited machine resources, such as memory and hard disk capacity. Many systems in those days had 8MB of memory or less.

CodeView handles all program models, including TINY, SMALL, COMPACT, MEDIUM, LARGE and HUGE, with TINY (DOS-based .COM files) having their symbolic debugger information stored in a separate file, with all of the other .EXE formats containing the symbolic information directly inside the executable. This often introduced a notable size increase, and it therefore became desirable for some developers to use #pragma switches within their C (and later C++) source code to prevent the majority of the application from having symbolic output, and instead limiting that output to only those portions which required it for current debugging.

CodeView version 3.x and 4.x introduced various transport layers, which removed some of the memory space limitations to this form of symbolic debugging. Typically the debugger runs in the lower 640KB memory space alongside the application being debugged, which greatly decreases the amount of memory available to the application being debugged. The transport layer allows only a stub to exist in main memory, while the bulk of the debugger code resides in EMS or XMS (memory above the 1 MB barrier, or outside of the normal 0 KB - 640 KB address space typically used by DOS programs). CodeView also came with a CVPACK command-line utility, which can reduce the size of the CodeView-generated information internally, while still retaining full symbolic access to data.

## Visual C++ support

Microsoft released [Visual C++](/source/Visual_C%2B%2B) 1.0 with CodeView functionality integrated directly into a single programming environment, known as the [Integrated Development Environment](/source/Integrated_development_environment) (IDE) -- though CodeView was still available in the 16-bit versions of Visual C++. [QuickC](/source/QuickC) and a number of other development tools in the 'Quick' series also supported this move to a single-source IDE, what became the precursor to the modern Visual Studio developer environment, as well as the model for countless other developer toolsets.

This integration was seen by many developers as a more natural way of developing software because both coding and debugging could be handled without switching programs or context, and all from the same logical location (even though internally many separate programs were running to support editing, compiling and debugging). As a result, most development tools and/or platforms offer similar products or features.

Today, the debugger is considered an integrated and essential part of the [Microsoft Visual Studio](/source/Microsoft_Visual_Studio) family of products, and owes its true roots to CodeView, and the enhancements seen in version 4.x specifically.

## Symdeb

Another debugging product available from Microsoft in the mid-1980s was *SYMDEB*.[3]

It had over 30 commands, and was described by [PC Magazine](/source/PC_Magazine) as a step up from DEBUG.[4] Codeview in turn was described as "a fullscreen SYMDEB".[5][6]

## See also

- [Borland Turbo Debugger](/source/Borland_Turbo_Debugger)

- [SoftICE](/source/SoftICE)

- [x86 memory models](/source/X86_memory_models)

- [Microsoft Visual Studio Debugger](/source/Microsoft_Visual_Studio_Debugger)

- [Program database](/source/Program_database) - CodeView formats and types are still present in debugging information generated by modern C++ toolchains[7]

## References

1. **[^](#cite_ref-CV3x_1-0)** ["CodeView 3.x"](https://winworldpc.com/product/codeview/3x). *WinWorld*.

1. ^ [***a***](#cite_ref-CV87_2-0) [***b***](#cite_ref-CV87_2-1) [*Microsoft Macro Assembler 5.1 - Microsoft CodeView and Utilities*](/source/Microsoft_Macro_Assembler). [Microsoft Corporation](/source/Microsoft_Corporation). 1987. p. 157. Document No. 4108-40010-500-R03-1287.

1. **[^](#cite_ref-SYMDEB_3-0)** Par, Jeff (2018-02-25). ["A Short History of SYMDEB"](https://www.pcjs.org/blog/2018/02/25). *PCjs Machines*. Retrieved 2019-05-19.

1. **[^](#cite_ref-PCW_1986_4-0)** ["SYMDEB: A step up from Debug"](https://books.google.com/books?id=nuXmVNll5JEC). *[PC World](/source/PC_World)*. 1986-10-14. p. 296.

1. **[^](#cite_ref-PCMag_1986_5-0)** "SYMDEB". *[PC Magazine](/source/PC_Magazine)*. Vol. 5, no. 17. [Ziff Davis, Inc.](/source/Ziff_Davis%2C_Inc.) 1986-09-30. p. 38. [ISSN](/source/ISSN_(identifier)) [0888-8507](https://search.worldcat.org/issn/0888-8507).

1. **[^](#cite_ref-MSC4_6-0)** ["MS C 4.0 Documentation Added"](http://www.os2museum.com/wp/ms-c-4-0-documentation-added). *OS2museum.com*.

1. **[^](#cite_ref-7)** ["CodeView Type Records — LLVM 13 documentation"](https://llvm.org/docs/PDB/CodeViewTypes.html#introduction). *llvm.org*. Retrieved 2021-12-19.

## Further reading

- [Petzold, Charles](/source/Charles_Petzold) (1990). [*Programming Windows: the Microsoft Guide to Writing Applications for Windows 3*](https://archive.org/details/programmingwindo0000petz). [ISBN](/source/ISBN_(identifier)) [9781556152641](https://en.wikipedia.org/wiki/Special:BookSources/9781556152641).

- *CodeView Debugger User's Guide*. [Microsoft Corporation](/source/Microsoft_Corporation). 1993.

v t e Microsoft development tools Development environments Visual Studio Code Express Team System Profiler Tools for Applications Tools for Office Others Blend Expression Web FxCop GW-BASIC MACRO-80 Macro Assembler MSBuild Pascal QuickBASIC QBasic QuickC Robotics Developer Studio Roslyn SharePoint Designer FrontPage Small Basic WebMatrix Windows App SDK Windows App Studio Windows SDK CLR Profiler ILAsm Native Image Generator WinDiff XAMLPad Languages Dynamics AX BASIC Visual Basic legacy VB.NET VBA VBScript Bosque Visual C++ C++/CX C++/CLI Managed C++ C++/WinRT C# C/AL Dafny Dexterity F# F* Visual FoxPro Java J++ J# JavaScript TypeScript JScript IronPython IronRuby Lean P Power Fx PowerShell Project Verona Q# Small Basic VPL XAML APIs and frameworks Native Windows API Silverlight XNA DirectX Managed DirectX UWP Xbox Development Kit Windows Installer WinUI .NET ASP.NET Core AJAX Dynamic Data MVC Razor Web Forms ADO.NET Entity Framework MAUI CardSpace Communication Foundation Identity Foundation LINQ Presentation Foundation Workflow Foundation Device drivers WDK WDF KMDF UMDF Windows HLK WDM Database SQL Server Express Compact Management Studio MSDE SQL services Analysis Reporting Integration Notification Other Visual FoxPro Microsoft Access Access Database Engine Extensible Storage Engine Source control Visual SourceSafe Team Foundation Version Control Testing and debugging CodeView OneFuzz Playwright Script Debugger WinDbg xUnit.net Delivery Active Setup ClickOnce npm NuGet vcpkg Web Platform Installer Windows Installer WiX Windows Package Manager Microsoft Store Category

---
Adapted from the Wikipedia article [CodeView](https://en.wikipedia.org/wiki/CodeView) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/CodeView?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
