• 6530阅读
  • 4回复

[讨论]qt debug问题 [复制链接]

上一主题 下一主题
离线迈克老狼
 
只看楼主 倒序阅读 楼主  发表于: 2011-05-01
各位好,

       小弟初次使用qt来编程,主要用它来编写一个image filter的gui,安装好qt creator之后,使用CDB进行debug。
下面的代码主要是读取一个QImage的像素值,然后放到一个动态创建的uchar数组srcimgdata中,但是
我在debug的过程中,执行到srcimgdata的代码时候,会提示your debugger is not using the correct symbols.
就是说不能watchsrcimgdata的内容,但是其他静态变量比如i,j值之类的都可以watch,是我的cdb没有设置好吗?
我的qt creator是2.1.84,
cdb中symbol paths: D:\Qt\4.7.0\lib
source paths :
  1.     //intitialize srcimg and dstimg
  2.     ui->tlbSrcimg->setIconSize(resultSize);
  3.     loadImage("lenna.jpg", &srcImage, ui->tlbSrcimg);  
  4.     if(srcImage.format()!=QImage::Format_ARGB32)  
  5.     {  srcImage = srcImage.convertToFormat(QImage::Format_ARGB32);    }  
  6.   
  7.    qDebug()<<srcImage.bytesPerLine();  
  8.   
  9.    if(imgheight>0&&imgwidth>0)
  10.    {      
  11.        dstImage = new QImage(imgwidth,imgheight,QImage::Format_ARGB32);
  12.        dstImage->fill(qRgba(0, 0, 0, 0));  
  13.        ui->lblDstimg->setPixmap(QPixmap::fromImage(*dstImage));    
  14.        srcimgdata = new uchar[imgwidth*imgheight*4];    
  15.        int i, j;    
  16.        for(i = 0; i < imgheight; i++)  
  17.        {          
  18.            for(j = 0; j < imgwidth; j++)  
  19.            {            
  20.              QRgb color = srcImage.pixel(j, i);    
  21.         
  22.            srcimgdata[i*imgwidth*4+j] = qAlpha(color);    
  23.             // qDebug()<<srcimgdata[i*imgwidth*4+j]<<" "<<i<<" "<<j;      
  24.           srcimgdata[i*imgwidth*4+j+1] = qRed(color);          
  25.           srcimgdata[i*imgwidth*4+j+2] = qGreen(color);      
  26.          srcimgdata[i*imgwidth*4+j+3] = qBlue(color);          
  27.         }    
  28.      }  
  29.   }

Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: srcimgdata



[ 此帖被迈克老狼在2011-05-01 10:04重新编辑 ]
离线迈克老狼
只看该作者 1楼 发表于: 2011-05-01
加了符号服务器,倒是可以调试了,可是速度实在是太慢了
离线ppdayz

只看该作者 2楼 发表于: 2011-05-01
windows 是比较慢的。。。
离线zzjin

只看该作者 3楼 发表于: 2011-05-01
win下面调试是很慢的...
离线downstairs

只看该作者 4楼 发表于: 2011-05-01
stdafx.h 启用预编译功能。谢谢
喜爱编程的猫头鹰
快速回复
限100 字节
 
上一个 下一个