gzip 编译及调试
Post on 05-Feb-2016
299 Views
Preview:
DESCRIPTION
TRANSCRIPT
Lei Zhao, USTC
Gzip 编译及调试
Speaker: Lei Zhao (赵雷 )
Department of Computer Science & TechnologyUniversity of Science & Technology of China
September 13, 2006
Gzip: Compilation and Debug 2/35Lei Zhao, USTC
一些概念及本文简称
IDE: Integrated Development Environment
VC: Visual C++ 6.0 BC: Borland C++ 3.1 TC: Turbo C 2.0各种软件根目录,一律简称 $SOME_HOME
如 $GZIP_HOME、 $VC_HOME
Gzip: Compilation and Debug 3/35Lei Zhao, USTC
各编译器 IDE用于 Gzip源码
VC 编译通过,可直接运行,调试方便
BC for DOS 编译通过,不能直接运行,因此不能调试
BC for Win 编译通过,可直接运行,操作系统不支持 16位调试器 TDW
TC 编译通过,可直接运行、调试,不支持鼠标
结论:推荐使用 VC
Gzip: Compilation and Debug 4/35Lei Zhao, USTC
各种编译环境下 Gzip的编译步骤
VC IDE BC IDE for DOS/Windows TC IDE VC/BC/TC命令行
Gzip: Compilation and Debug 5/35Lei Zhao, USTC
各种编译环境下 Gzip的编译步骤
VC IDE BC IDE for DOS/Windows TC IDE VC/BC/TC命令行
Gzip: Compilation and Debug 6/35Lei Zhao, USTC
VC IDE中 Gzip编译步骤——建立工程
Gzip: Compilation and Debug 7/35Lei Zhao, USTC
VC IDE中 Gzip编译步骤——建立工程
Gzip: Compilation and Debug 8/35Lei Zhao, USTC
VC IDE中 Gzip编译步骤——添加源文件
Gzip: Compilation and Debug 9/35Lei Zhao, USTC
VC IDE中 Gzip编译步骤——编译运行
Gzip: Compilation and Debug 10/35Lei Zhao, USTC
VC IDE中 Gzip编译步骤——参数设置
Gzip: Compilation and Debug 11/35Lei Zhao, USTC
VC IDE中 Gzip的调试
单步调试 Ctrl+F10:执行到光标处 F10:单步执行(不跟进函数调用) F11:单步执行(跟进函数调用)
Gzip: Compilation and Debug 12/35Lei Zhao, USTC
VC IDE中 Gzip的调试
断点 F9:设置 /取消断点 F5:执行到下一断点
Gzip: Compilation and Debug 13/35Lei Zhao, USTC
VC IDE中 Gzip的调试
查看信息 变量 寄存器 内存 调用栈
Gzip: Compilation and Debug 14/35Lei Zhao, USTC
各种编译环境下 Gzip的编译步骤
VC IDE BC IDE for DOS/Windows TC IDE VC/BC/TC命令行
Gzip: Compilation and Debug 15/35Lei Zhao, USTC
BC IDE中 Gzip编译步骤
$BC_HOME\BIN目录下, BC.EXE/BCW.EXE分别是 for DOS/Windows的版本
建议使用 BCW.EXE
Gzip: Compilation and Debug 16/35Lei Zhao, USTC
BC IDE中 Gzip编译步骤——建立工程
打开工程 ->选择目录 ->输入名称 ->ok
Gzip: Compilation and Debug 17/35Lei Zhao, USTC
BC IDE中 Gzip编译步骤——添加源文件
只添加 .c文件
Gzip: Compilation and Debug 18/35Lei Zhao, USTC
BC IDE中 Gzip编译步骤——设置目录
头文件: $BC_HOME\INCLUDE 库: $BC_HOME\LIB 输出:存放 .obj .exe .map文件
Gzip: Compilation and Debug 19/35Lei Zhao, USTC
BC IDE中 Gzip编译步骤——编译运行
Make or Build all Arguments Run
Gzip: Compilation and Debug 20/35Lei Zhao, USTC
Gzip124 for BC 改变的源代码
拷贝 $GZIP_HOME\msdos\tailor.c到 $GZIP_HOME\目录下
$GZIP_HOME\tailor.h 添加NO_ASM宏
Gzip: Compilation and Debug 21/35Lei Zhao, USTC
各种编译环境下 Gzip的编译步骤
VC IDE BC IDE for DOS/Windows TC IDE VC/BC/TC命令行
Gzip: Compilation and Debug 22/35Lei Zhao, USTC
TC IDE中 Gzip编译步骤——设置工程
File->Load 打开 $GZIP_HOME\GZIP_TC.PRJ
Project->Project name 设置为 GZIP_TC.PRJ
File->Change dir 设置为 $GZIP_HOME\
Operation->Directories 设置类似 BC
Gzip: Compilation and Debug 23/35Lei Zhao, USTC
TC IDE中 Gzip编译步骤——编译运行
F9:Make Run->Run Options->Arguments调试指令在 Run中,与
VC同名的指令作用也相同
Gzip: Compilation and Debug 24/35Lei Zhao, USTC
Gzip124 for TC 改变的源代码
所有文件由UNIX格式转为DOS格式 $GZIP_HOME\tailor.h添加了NO_ASM宏 $GZIP_HOME\msdos\gzip.prj删去了第 16行的match.obj
拷贝 $GZIP_HOME\msdos\gzip.prj到 $GZIP_HOME\下并更名为 GZIP_TC.prj
$GZIP_HOME\目录下拷贝了 $TC_HOME\目录下的WILDARGS.OBJ
Gzip: Compilation and Debug 25/35Lei Zhao, USTC
分别针对三个 IDE的 Gzip124下载地址
ftp://pb0511:pb0511@202.38.79.124:221/gzip/ Gzip124 for VC.rar Gzip124 for BC.rar Gzip124 for TC.rar
Gzip: Compilation and Debug 26/35Lei Zhao, USTC
VC/BC/TC命令行
命令行的方式不推荐使用请参见另一篇文档《 gzip的命令行方式编译》
下载地址:ftp://pb0511:pb0511@202.38.79.124:221/gzip/
Gzip: Compilation and Debug 27/35Lei Zhao, USTC
Thanks!
top related