??
对于驱动程序设计来说,核心问题之一就是如何完成调试。当前常用的驱动调试技术可分为:
? 打印调试(printk)
? 调试器调试(kgdb)
? 查询调试
1、合理使用printk
#ifdef PDEBUG
#define PLOG(fmt,args...) printk(KERN_DEBUG "scull:"fmt,##args)
#else
#define PLOG(...
分类:
系统相关 时间:
2015-08-29 18:53:55
阅读次数:
268
(1)获取系统环境变量: ACE_OS::getenv#ifdef _DEBUG
#pragma comment (lib,"ACEd.lib")
#else
#pragma comment (lib,"ACE.lib")
#endif#include "ace/OS.h"
#include "ace/Log_Msg.h"int ACE_TMAIN(int argc, ACE_TCHAR** arg...
分类:
其他好文 时间:
2015-08-29 12:46:21
阅读次数:
436
#ifndef __CFG_OP_H__#define __CFG_OP_H__#ifdef __cplusplusextern "C" {#endif//获取配置项int GetCfgItem(char *pFileName /*in*/, char *pKey /*in*/, char * p....
分类:
编程语言 时间:
2015-08-29 00:44:20
阅读次数:
193
STL,标准模板库,无处不存在GP(generic programming泛型编程),有多种实现版本。
GNU C++采用的STL为:SGI STL,源码下载,参考文档。
STL文件讲解一: 针对不同的编译器,定义各种环境常量。选取其中的针对GNU编译器的一部分。
# ifdef __GNUC__
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7...
分类:
其他好文 时间:
2015-08-28 21:34:17
阅读次数:
237
#ifdef __OBJC__#import "UIView+Frame.h"#import "UIImage+Image.h"#define CZKeyWindow [UIApplication sharedApplication].keyWindow// ...表示宏定义的可变参数// __VA...
分类:
其他好文 时间:
2015-08-27 18:26:02
阅读次数:
161
参考博客天堂大鸟的程序,并调试成功,可以记录程序调试过程。代码记录如下:#include
#include
#define COMMLIB_DBG_FILE "./MyLog.log"
void mydbgprintf(const char *str, ...)
{
va_list ap;
FILE *fh = NULL;
#ifdef __ST...
分类:
编程语言 时间:
2015-08-27 15:29:45
阅读次数:
234
__objc__表示宏内引用的文件确保只被使用Objective-C语言的文件所引用,保证引用关系的清晰。#ifdef __OBJC__ #import #import #import #import "SDWebImageManager.h" #import "...
分类:
其他好文 时间:
2015-08-27 00:20:13
阅读次数:
231
只需要 在ProjectName_Prefix.pch中追加你对应的宏定义,不用import 就可以直接使用了。#define DEBUG//宏输出函数#ifdef DEBUG#define SFun_Log(fmt, ...) NSLog((@"%s," "[lineNum:%d]" fmt) ,...
分类:
其他好文 时间:
2015-08-21 12:49:23
阅读次数:
136
MFC 选项选择: 静态库编译
加入头文件:
#pragma once
#ifdef WIN32
#include
//定义宏,保证在debug模式下,导入opencv_xxxd.lib,release模式下导入opencv_xxx.lib
#ifdef _DEBUG
# define CC_CVLIB(name) "opencv_" name CC_CVVERSION...
分类:
编程语言 时间:
2015-08-20 15:21:56
阅读次数:
237
使用C++编程时,有时要用到第三方的库,而第一方库是以C给出的,奇怪的是明明已经把C文件加入工程,头文件也已经引入,编译里还是出现 undefined reference 问题在这里,第三方的C库的头文件没有加入extern "C",在C文件的头文件加入如下即可 #ifdef __cplusplus...
分类:
编程语言 时间:
2015-08-19 10:47:18
阅读次数:
174