ArticleslgStudy

science

CodeView

CodeView is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand CodeView rather than just read about it. In short: CodeView is a standalone debugger created by David Norris at Microsoft in 1985 as part of its development toolset. It originally shipped with Microsoft C 4.0 and later.

Key takeaways

  • CodeView belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect CodeView to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of CodeView from memory before moving on to harder problems.

Reference excerpt

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

Overview When running, CodeView presents the user with several windows 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 context. Data window – a hexadecimal 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 register contents, including segments, flags and the FPU (CodeView existed before MMX and other SIMD extensions). Output window – a window showing startup operations and debugging information relating to breakpoints, 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++ 1.0 with CodeView functionality integrated directly into a single programming environment, known as the Integrated Development Environment (IDE) -- though CodeView was still available in the 16-bit versions of Visual C++. 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 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. It had over 30 commands, and was described by PC Magazine as a step up from DEBUG. Codeview in turn was described as "a fullscreen SYMDEB".

See also Borland Turbo Debugger SoftICE x86 memory models Microsoft Visual Studio Debugger Program database - CodeView formats and types are still present in debugging information generated by modern C++ toolchains

References

Further reading Petzold, Charles (1990). Programming Windows: the Microsoft Guide to Writing Applications for Windows 3. ISBN 9781556152641. CodeView Debugger User's Guide. Microsoft Corporation. 1993.

Worked examples

Example 1 — a first encounter with CodeView

Start with the simplest possible case. Write down what CodeView claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to CodeView before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about CodeView ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of CodeView

In research
CodeView appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses CodeView in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
CodeView is common in secondary-school and first-year university syllabi. It links to neighbouring topics Debuggers, Microsoft development tools, Programming tools for Windows, so understanding it makes those chapters shorter.
In everyday life
Look for CodeView outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “CodeView” →

How to study CodeView in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what CodeView means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain CodeView out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is CodeView in simple terms?

CodeView is a standalone debugger created by David Norris at Microsoft in 1985 as part of its development toolset. It originally shipped with Microsoft C 4.0 and later.

Why does CodeView matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study CodeView?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on CodeView.

Tags

  • Debuggers
  • Microsoft development tools
  • Programming tools for Windows

Keep exploring