|
Hi all
I am using debuggin API for my purposes.
After I have initialized everything correctly each time I use StackWalk64 function it doesn't work.
Evenet if it returns TRUE I can see on the debug output
First-chance exception at 0x00000000 in TestMyStackTraceDebugger.exe: 0xC0000005: Access violation reading location 0x00000000.
I notice that the CONTEXT returned is almost all set to 0 and data returned in STACKFRAME sturcture are all 0.
What is wrong?
Each of the following (in order) was successful returning TRUE
-CreateProcess //with Debug permission
-WaitForDebugEvent
-OpenThread
CONTEXT ctx;
memset( &ctx, 0, sizeof( CONTEXT ) ); //init struct!
HANDLE threadHandle = OpenThread( THREAD_GET_CONTEXT , FALSE, de.dwThreadId );
GetThreadContext( threadHandle , &ctx );
-GetThreadContext
-SymSetOptions
-SymInitialize
STACKFRAME64 sf;
memset( &sf, 0, sizeof(STACKFRAME64));
sf.AddrPC.Offset = ctx.Eip;
sf.AddrPC.Mode = AddrModeFlat;
sf.AddrStack.Offset = ctx.Esp;
sf.AddrStack.Mode = AddrModeFlat;
sf.AddrFrame.Offset = ctx.Ebp;
sf.AddrFrame.Mode = AddrModeFlat;
#endif
StackWalk64(
IMAGE_FILE_MACHINE_I386,
gamerProcess,
threadHandle,
&sf,
&ctx,
NULL,
SymFunctionTableAccess64,
SymGetModuleBase64,
NULL );
Kind Regards
ManuStone
<div class="ForumMod">modified on Wednesday, January 30, 2008 1:18:34 PM</div>
|
|
|
|
|
Did you use your debugger to see where the code crashes exactly ? Check the state of the different variables to see if everything looks OK.
|
|
|
|
|
Why didn't you set the ContextFlags member of CONTEXT .
Is the thread in suspended mode, as recommended by documentation?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Dear all,
Im my application when i cilck a music button , it has to pop up a window with a music file list selected to play and a option to add the othe files in to this list. and whenever i click the music button again it has to hide...
How to show a dialog and hide with the main dialog active always...
Manjunath S
|
|
|
|
|
Manjunath S wrote: Im my application when i cilck a music button , it has to pop up a window with a music file list selected to play and a option to add the othe files in to this list. and whenever i click the music button again it has to hide...
Probably the CHideAndSeek() class should help?
Seriously though, what is your requirement?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Actual i have to design a dialog similarly as the equavalizer window that comes in winamp,(whenever we press a arrow it opens and whenever we press a arrow again it hides)...
Manjunath S
GESL
Bangalore
|
|
|
|
|
Will the ShowWindow() API help you?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Use a combination of SetWindowPos and/or MoveWindow to grow/shrink said window; thus show or hiding a portion of the dialog.
|
|
|
|
|
|
|
Will the compiler optimize the MESSAGE MAP of each class?
Or else, I'd better rearrange it by putting high-frequent messages at top of the array.
|
|
|
|
|
Does it really matter?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
How could the compiler know which messages occur with more frequency?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I guess he supposes the compiler optimizing message handling on position (in the MESSAGE_MAP list) based mechanism, this way the developer could suggest the compiler itself what will be the more frequently used message.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
It's in the service pack, Mark. Come on, you're gonna have to keep up.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Exactly. You can lead a compiler to water but you can't make it fish.
led mike
|
|
|
|
|
Are you sure? That may be in the service pack as well!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
led mike wrote: Exactly. You can lead a compiler to water but you can't make it fish.
That was too good.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Reading through the list of threads below...
It must be the fishing season opener today
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: It must be the fishing season opener today
Yeah, it makes me picture that scene in Jaws where all the bounty hunters are flying around the marina in boats with shotguns and TNT etc.
led mike
|
|
|
|
|
Yeah!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
some can be determined, like
WM_PAINT vs WM_CREATE
|
|
|
|
|
followait wrote: some can be determined
By the compiler?
I don't know of any MFC/Windows-specific optimizations in the VC++ compiler.
The source code for the BEGIN_MESSAGE_MAP macro will tell you if
it's optimal to move frequent messages to the top.
FWIW, I've always done that, but I've never bothered to check if it helps.
For all I know, it's the reverse Please let me know what you find!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Do you have any metrics to claim that the MESSAGE_MAP is not optimal ?
anyway, if that's your only performance concern in your application, you can just stop there and go have a beer.
|
|
|
|
|
Why not put WM_PAINT before WM_CREATE ?
Maybe the perform here can be ignored.
|
|
|
|