- mracer
- Feb 23, 2004
-
The M racer
|
Ok, more of a Visual Studio question. Whats the best way to step thru code with many macros. you know #define functions.
for example:
code:#define COPY_PMV(adst,asrc) { \
Ipp32s nn; \
for(nn=0; nn<sizeof(adst)/sizeof(Ipp32s); nn++) \
((Ipp32s*)adst)[nn] = ((Ipp32s*)asrc)[nn]; \
}
is there an option for the debugger to show that instead of COPY_PMV(pointer,pointer) ?
|
#
¿
Feb 16, 2008 21:31
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 6, 2024 11:09
|
|
- mracer
- Feb 23, 2004
-
The M racer
|
more falafel please posted:
This will work if adst is an array, but not if it's a pointer (and not if it's an array that's degraded to a pointer in the current scope).
First off, you should use memcpy() or std::copy (if C++), because they're generally optimized beyond what you're going to write.
But if you want to debug this, I would suggest putting printfs/couts/however you log in the macro itself.
code:#define COPY_PMV(adst,asrc) { \
Ipp32s nn; \
for(nn=0; nn<sizeof(adst)/sizeof(Ipp32s); nn++) \
{ \
printf("nn=%d &(adst[nn])=%p &(asrc[nn])=%p asrc[nn]=%d\n", nn, &(adst[nn]), &(asrc[nn]), asrc[nn]); \
((Ipp32s*)adst)[nn] = ((Ipp32s*)asrc)[nn]; \
} \
}
I know that this macro doesn't look optimize. (the goal of video encoding is to confuse ) But Intel loves to put them throughout their code. I didn't write the code but if i did i would inline and such. This was just one of the basic ones so i used it as an example. I think i will though take the printf advice and use it. thank you.
|
#
¿
Feb 17, 2008 21:49
|
|