Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages
Started by quincy451
Fri, 06 Jul 2007 19:47
Stackwalk, map2dbg, BCB6 - solved???
Author: quincy451
Date: Fri, 06 Jul 2007 19:47
Date: Fri, 06 Jul 2007 19:47
6 lines
1327 bytes
1327 bytes
Someone named Sacha Manson-Smith posted an article announcing a solution to using Lucian Wischik's map2dbg code with bcb6. I have run into the same thing but can not find the solution. Anybody have it. Thanks, David
Re: Stackwalk, map2dbg, BCB6 - solved???
Author: quincy451
Date: Sat, 21 Jul 2007 22:48
Date: Sat, 21 Jul 2007 22:48
82 lines
3884 bytes
3884 bytes
Ok I have gotten map2dbg.exe to compile and run right under bcb6.
That was a case of recreating the project file and changing some of
the search strings for the updated .map file format.
I got calldemo.exe to compile by recreating the project file. But now
I run into a problem. The original code uses
GetThreadContext(hThread,&ctx); to get the context of the current
thread. This is documented my microsoft to return success but invalid
data for current thread. On bcb6 is that is what it does.
So I created the following program to gather the current thread
context as a test:
//---------------------------------------------------------------------------
#include <windows.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
CONTEXT ctx;
DWORD _eip, _ebp, _esp, _ax, _bx, _cx, _dx, _si, _di, _ss,
_cs, _ds, _es, _fs, _gs;
memset(&ctx, '\0', sizeof(CONTEXT));
ctx.ContextFlags=CONTEXT_FULL;
asm mov _ax, eax;
asm mov _bx, ebx;
asm mov _cx, ecx;
asm mov _dx, edx;
asm mov _si, esi;
asm mov _di, edi;
asm call x; // works bcb5, gives errors bcb6 why?
asm x:
asm pop eax;
asm mov _eip, eax; // save ip
asm mov _ebp, ebp;
asm mov _esp, esp;
asm mov _ss, ss;
asm mov _cs, cs;
asm mov _ds, ds;
asm mov _es, es;
asm mov _fs, fs;
asm mov _gs, gs;
ctx.Eax=_ax;
ctx.Ebx=_bx;
ctx.Ecx=_cx;
ctx.Edx=_dx;
ctx.Edi=_di;
ctx.Esi=_si;
ctx.Eip=_eip;
ctx.Ebp=_ebp;
ctx.Esp=_esp;
ctx.SegSs=_ss & 0xffff;
ctx.SegCs=_cs & 0xffff;
ctx.SegDs=_ds & 0xffff;
ctx.SegEs=_es & 0xffff;
ctx.SegFs=_fs & 0xffff;
ctx.SegGs=_gs & 0xffff;
}
//---------------------------------------------------------------------------
I get these errors:
[C++ Error] Unit1.cpp(22): E2451 Undefined symbol 'x'
[C++ Error] Unit1.cpp(22): E2451 Undefined symbol 'x'
[C++ Error] Unit1.cpp(22): E2329 Invalid combination of opcode and
operands
Why??? thanks.
I tried call +0x00000000; but that did not work on either compiler.
On Jul 6, 2:47 pm, quincy...@yahoo.com wrote:
> Someone named Sacha Manson-Smith posted an article announcing a
> solution to using Lucian Wischik's map2dbg code with bcb6. I have run
> into the same thing but can not find the solution. Anybody have it.
>
> Thanks,
> David
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads