CodeView: Difference between revisions

Content deleted Content added
Use the page's current name.
 
(26 intermediate revisions by 13 users not shown)
Line 1:
{{Short description|Full-screen debugger for DOS by Microsoft}}
{{no footnotes|date=December 2009}}
{{Use dmy dates|date=January 2020|cs1-dates=y}}
'''CodeView''' was 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 on the MS-DOS platform that was full-screen oriented, rather than line oriented (like its predecessors [[DEBUG (DOS Command)|DEBUG.COM]] and [[symdeb]]).
{{Infobox software
| name = CodeView
| logo =
| author = David Norris
| developer = [[Microsoft]]
| released = {{Start date and age|1985}}
| latest_release_version =
| latest_release_date =
| programming language =
| operating system = [[MS-DOS]]
| platform = [[x86]]
| genre = [[Debugger]]
| license =
| website =
}}
'''CodeView''' wasis a standalone [[debugger]] created by David Norris at [[Microsoft]] in 1985 as part of its development toolset.<ref name="CV3x"/> It originally shipped with Microsoft C 4.0 and later. It also shipped with [[Visual Basic (classic)|Visual Basic]] for [[MS-DOS]], [[Microsoft BasicBASIC PDS]], and a number of other Microsoft language products.<ref name="CV87"/> It was one of the first debuggers on thefor MS-DOS platformto that wasbe full-screen oriented, rather than line -oriented (likeas itsMicrosoft's predecessors [[DEBUG (DOS Commandcommand)|DEBUG.COM]] and [[symdebSYMDEB]] or [[Digital Research]]'s SID).
 
==Overview==
When running, CodeView would presentpresents the user with several [[window (computing)|windows]] that couldcan be tiled, moved, sized and otherwise manipulated via the keyboard or mouse, with CodeView 4.x providing a richer interface. Some of the windows includedinclude:
 
* Code window - the code window showed the currently debugged code in its [[source code]] context.
* Data window - a [[hex dump|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.COM and [[symdeb]]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 [[Floating-point unit|FPU]] (CodeView existed before [[MMX (instruction set)|MMX]] and other [[SIMD]] extensions).
* Output window - a window showing startup operations and debugging information relating to breakpoints,<ref name="CV87"/> hardware breaks (interrupt 0 and 3), etc.
* 386 mode - CodeView supported 8086, 80286 and 80386 and later processors. 386 enhanced mode was activated by a menu option, allowing for 32-bit registers and disassembly.
* Monochrome monitor support - CodeView supported debugging on either a single color (CGA, EGA or VGA) monitor with page/memory swapping between the user application and the CodeView screen, or through a feature which utilized a separate monochrome monitor. The monochrome monitor existed in memory address space 0xb0000, while the color monitor existed at 0xb8000 for text and 0xa0000 for graphics. Use of the monochrome monitor with its separate memory address space allowed debugging graphics applications without affecting the display, as well as all text modes. Monochrome monitor support was limited to 25 lines, whereas color monitors could utilize 25, 43 or 50 line mode, allowing for more information on the screen at the same time.
 
===Features===
Creating symbolic debugging output, which allowed 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, was provided for by the command line switch -Zi given to the compiler, and -CO given to the linker. Variants like -Zs and -Zd provided 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.
* 386 mode - CodeView supported 8086, 80286 and 80386 and later processors. 386 enhanced mode wasis activated by a menu option, allowing for 32-bit registers and disassembly.
* Monochrome monitor support - CodeView supportedallows debugging on either a single color (CGA, EGA or VGA) monitor with page/memory swapping between the user application and the CodeView screen, or through a feature which utilizedusing a separate monochrome monitor. The monochrome monitor existedexists in memory address space 0xb0000, while the color monitor existedexists at 0xb8000 for text and 0xa0000 for graphics. Use of the monochrome monitor with its separate memory address space allowedallows debugging graphics applications without affecting the display, as well as all text modes. Monochrome monitormonitors support wasare limited to 25 lines, whereas color monitors could utilizeallow 25, 43 or 50 line mode, allowing for more information on the screen at the same time.
 
Creating symbolic debugging output, which allowedallows 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, wasis provided forenabled by the command line switch -Zi given to the compiler, and -CO given to the linker. Variants like -Zs and -Zd providedprovide 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 supported 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 supportedhandles 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 would run in the lower 640KB memory space alongside the application being debugged, which greatly decreased the amount of memory available to the application being debugged. The transport layer allowed only a stub to exist in main memory, while the bulk of the debugger code resided in EMS or XMS (memory above the 1MB barrier, or outside of the normal 0KB - 640KB address space typically used by DOS programs). CodeView also came with a CVPACK command-line utility, which could reduce the size of the CodeView-generated information internally, while still retaining full symbolic access to data.
 
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 would runruns in the lower 640KB memory space alongside the application being debugged, which greatly decreaseddecreases the amount of memory available to the application being debugged. The transport layer allowedallows only a stub to exist in main memory, while the bulk of the debugger code residedresides in EMS or XMS (memory above the 1MB1&nbsp;MB barrier, or outside of the normal 0KB0&nbsp;KB - 640KB640&nbsp;KB address space typically used by DOS programs). CodeView also came with a CVPACK command-line utility, which couldcan 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|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, compilercompiling and debugging). As a result, most development tools and/or platforms offer similar products or features.
 
This integration was so popular that 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==
<!-- Header linked by redirects -->
Another debugging product available from Microsoft in the mid-1980s was ''SYMDEB''.<ref name="SYMDEB"/>
 
It had over 30 commands, and was described by [[PC Magazine]] as a step up from DEBUG.<ref name="PCW_1986"/> Codeview in turn was described as "a fullscreen SYMDEB".<ref name="PCMag_1986"/><ref name="MSC4"/>
 
==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<ref>{{cite web |title=CodeView Type Records — LLVM 13 documentation |url=https://llvm.org/docs/PDB/CodeViewTypes.html#introduction |website=llvm.org |access-date=19 December 2021}}</ref>
 
== References ==
{{Reflist}}|refs=
<ref name="CV3x">{{cite magazine |magazine=WinWorld |title=CodeView 3.x |url=https://winworldpc.com/product/codeview/3x}}</ref>
<ref name="CV87">{{cite book |title=Microsoft Macro Assembler 5.1 - Microsoft CodeView and Utilities |title-link=Microsoft Macro Assembler |date=1987 |id=Document No. 4108-40010-500-R03-1287 |publisher=[[Microsoft Corporation]] |page=157}}</ref>
<ref name="SYMDEB">{{cite web |url=https://www.pcjs.org/blog/2018/02/25 |work=PCjs Machines |title=A Short History of SYMDEB |date=2018-02-25 |author-first=Jeff |author-last=Par |access-date=2019-05-19}}</ref>
<ref name="PCW_1986">{{cite magazine |magazine=[[PC World]] |date=1986-10-14 |page=296 |title=SYMDEB: A step up from Debug |url=https://books.google.com/books?id=nuXmVNll5JEC}}</ref>
<ref name="PCMag_1986">{{cite magazine |magazine=[[PC Magazine]] |title=SYMDEB |date=1986-09-30 |page=38 |volume=5 |number=17 |issn=0888-8507 |publisher=[[Ziff Davis, Inc.]]}}</ref>
<ref name="MSC4">{{cite web |title=MS C 4.0 Documentation Added |website=OS2museum.com |url=http://www.os2museum.com/wp/ms-c-4-0-documentation-added}}</ref>
}}
 
==Further reading==
This integration was so popular that 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.
* {{cite book |lastauthor-first=PetzoldCharles |firstauthor-last=CharlesPetzold |authorlinkauthor-link=Charles Petzold |yeardate=1990 |title=Programming Windows: the Microsoft Guide to Writing Applications for Windows 3 |isbn=9781556152641 |url=https://archive.org/details/programmingwindo0000petz |url-access=registration}}
* {{cite book |authorlinkpublisher=[[Microsoft Corporation]] |yeardate=1993 |title=CodeView Debugger User's Guide}}
 
{{Microsoft development tools}}
== References ==
{{Reflist}}
*{{cite book |authorlink=Microsoft Corporation|year=1987 |title=Microsoft Macro Assembler 5.1 CodeView and Utilities}}
*{{cite book |authorlink=Microsoft Corporation|year=1987 |title=Microsoft CodeView and Utilities Update}}
*{{cite book |last=Petzold |first=Charles |authorlink=Charles Petzold |year=1990 |title=Programming Windows: the Microsoft Guide to Writing Applications for Windows 3}}
*{{cite book |authorlink=Microsoft Corporation|year=1993 |title=CodeView Debugger User's Guide}}
 
{{DEFAULTSORT:Codeview}}