Article View: borland.public.cppbuilder.nativeapi
Article #1504Re: Stackwalk, map2dbg, BCB6 - solved???
From: 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
Technical Details
Message-ID:
<1185058092.019283.128320@57g2000hsv.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!57g2000hsv.googlegroups.com!not-for-mailReferences:
<1183751222.193809.318620@w3g2000hsg.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c4ab6aed570260b3 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!57g2000hsv.googlegroups.com!not-for-mail From: quincy451@yahoo.com Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Stackwalk, map2dbg, BCB6 - solved??? Date: Sat, 21 Jul 2007 22:48:12 -0000 Organization: http://groups.google.com Lines: 84 Message-ID: <1185058092.019283.128320@57g2000hsv.googlegroups.com> References: <1183751222.193809.318620@w3g2000hsg.googlegroups.com> NNTP-Posting-Host: 76.185.246.13 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185058092 14673 127.0.0.1 (21 Jul 2007 22:48:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 21 Jul 2007 22:48:12 +0000 (UTC) In-Reply-To: <1183751222.193809.318620@w3g2000hsg.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 57g2000hsv.googlegroups.com; posting-host=76.185.246.13; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0