[Insight-users] GDB debuging couldn't find method GetPixel()
Matt McCormick
matt.mccormick at kitware.com
Fri Jul 29 09:54:13 EDT 2011
Hi Johnny,
GDB has recently greatly improved C++ support. You may have better luck
with a newer version of GDB.
The problem I have run into previously is with GDB resolving the
SmartPointer, not the templated methods. So, you may have to do something
like:
p (*(image.m_Pointer)).GetPixel(pixelIndex)
If you use vim, I like pyclewn (which works on top of GDB). If you want a
GUI, maybe KDevelop4?
Best,
Matt
On Thu, Jul 28, 2011 at 9:05 PM, Johnny <20673972 at student.uwa.edu.au> wrote:
> Hi all,****
>
> ** **
>
> Could be a silly question but did confuse me quite a few days. Your help
> are highly appreciated.****
>
> ** **
>
> While I was trying to use GDB debugging my code, I wanted to see what value
> the GetPixel(index) method returns.****
>
> ** **
>
> The easiest way to reproduce this issue is using the source code
> Examples/DataRepresentation/Image/Image3.cxx****
>
> ****
>
> Line113: ImageType:PixelType pixelValue = image->GetPixel(pixelINdex);***
> *
>
> ** **
>
> I set the break at line 113. Then using expression “p
> image->GetPixel(pixelIndex)” which is exactly the same in the code. ****
>
> However I always got the message “Couldn’t find method
> itk::SmartPointer<itk::Image<short unsined int, 3u>>::GetPixel”****
>
> What was confusing me is if I continued the program, it run OK, which means
> it could find the method. I just could not get it from debuging command.**
> **
>
> ** **
>
> I did heard that GDB are somehow tricky to deal with templated methods. Is
> this the issue?****
>
> ** **
>
> Btw I am using Intel mac osx, I cound not install ddd. Any suggestions for
> a good visual debugger?****
>
> ** **
>
> ** **
>
> Cheers****
>
> ** **
>
> Johnny****
>
> ** **
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110729/51d9d96c/attachment.htm>
More information about the Insight-users
mailing list