随笔分类 - Windbg
摘要:目标:将一单线程Console程序改为MFC多线程。而且线程间无需通讯。现状:1、Windows线程栈,每线程都有自己的独立栈。进程创立时会创建一主线程。每线程栈存储默认1MB。2、Windows为抢先式多任务操作系统。级别高的线程会先运行。3、malloc序列化存储申请请求。Applications can safely use the memory management features of the C run-time library ( malloc, free, and so on) and C++ ( new, delete, and so on).4、MFC书看过一些,但没操作
阅读全文
摘要:#1 代码1#include<windows.h>2#include<stdio.h>34intmain(){5int*p=(int*)VirtualAlloc(NULL,256*4096,MEM_RESERVE,PAGE_NOACCESS);6printf("p==%p",p);78int*q=(int*)VirtualAlloc(p,4*4096,MEM_COMMIT,PAGE_READWRITE);9for(intt=0;t<4096;t++){10q[t]=t;11printf("%8d",q[t]);12}1314
阅读全文
摘要:源语言要求:C, C++, or assembly.#1 编译要求符号文件(.pdb files) ---- visual studio 2012默认生成源代码打开编译器开关 /Od /Oi#2 定位符号文件和源代码文件#3 单步源码调试的范例.lines enable source line informationbp mainset initial breakpointl+t stepping will be done by source linel+s source lines will be displayed at promptg run program until "ma
阅读全文
摘要:O、注意事项书写Windbg命令行需遵循的通用语法规则rule NO.1:命令和参数不区分大小写(除非特定指出)。rule NO.2:参数可用空格或者逗号分隔。rule NO.3:命令和首个参数间空格通常可省略。其它空格只要不导致曲解也可省略。Windbg帮助档阅读须知rule NO.1:粗体字须照抄。rule NO.2:斜体字会在Parameters部分解释。rule NO.3:[]内为可选参数。[ xxx | yyy ]最多可选其中一个参数。rule NO.4:{ xxx | yyy }必须使用其中一个参数。一、 设定环境变量_NT_SYMBOL_PATHD:\Doc\vsPmhSymbo
阅读全文