Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-03

What is / Where originates : FLAG_TRACE_BIT = $100; { our own invention } IN rtl\win\wininc\defines.inc

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

C:\FPC\SVN\fpc_2.6.4\rtl\win\wininc\defines.inc

line 5669 (in 3.6.4)
{ our own invention }

      FLAG_TRACE_BIT = $100;

This is only there for 32 bit and wince, but not for win64.

But the problem is finding out what it actually means. All googling has not brought any definition to it.

From usage in old code in fpdebug, it is given as flag to

   Context^.EFlags := Context^.EFlags or FLAG_TRACE_BIT;
   if not SetThreadContext(Handle, Context^)

An ideas?

Reply by email

Dmitry Boyarintsev
to Martin Frb

http://en.wikipedia.org/wiki/FLAGS_register

It's a trap (single-step) flag. to stop after each instruction. (IIRC with some exceptions).
I'd think it should be AMD64 compatible.

thanks,
Dmitry

Martin Frb wrote 23 lines
C:\FPC\SVN\fpc_2.6.4\rtl\win\wininc\defines.inc line 5669 (in 3.6.4) { our own invention } FLAG_TRACE_BIT = $100; This is only there for 32 bit and wince, but not for win64. But the problem is finding out what it actually means. All googling has not brought any definition to it. From usage in old code in fpdebug, it is given as flag to Context^.EFlags := Context^.EFlags or FLAG_TRACE_BIT; if not SetThreadContext(Handle, Context^) An ideas? _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Dmitry Boyarintsev
to Dmitry Boyarintsev

To add to that.

*nixes are using ptrace() function and PTRACE_SINGLESTEP request. I do believe that setting EFlag (FLAG_TRACE_BIT for x86 machines) would work for *nix systems (didn't try myself), but respecting defined API is always a better approach.

thanks,
Dmitry

On Mon, Mar 31, 2014 at 9:58 PM, Dmitry Boyarintsev <

Show quoted text 39 lines
wrote: http://en.wikipedia.org/wiki/FLAGS_register It's a trap (single-step) flag. to stop after each instruction. (IIRC with some exceptions). I'd think it should be AMD64 compatible. thanks, Dmitry On Mon, Mar 31, 2014 at 6:17 PM, Martin Frb wrote: > C:\FPC\SVN\fpc_2.6.4\rtl\win\wininc\defines.inc > > line 5669 (in 3.6.4) > { our own invention } > FLAG_TRACE_BIT = $100; > > This is only there for 32 bit and wince, but not for win64. > > But the problem is finding out what it actually means. All googling has > not brought any definition to it. > > From usage in old code in fpdebug, it is given as flag to > > Context^.EFlags := Context^.EFlags or FLAG_TRACE_BIT; > if not SetThreadContext(Handle, Context^) > > > An ideas? > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel >

Reply by email

Martin Frb
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote 7 lines
To add to that. *nixes are using ptrace() function and PTRACE_SINGLESTEP request. I do believe that setting EFlag (FLAG_TRACE_BIT for x86 machines) would work for *nix systems (didn't try myself), but respecting defined API is always a better approach.

I was mainly about win64.
I had mainly googled it as an argument to the windows API (which was where I had found it in fpdebug code), and I found nothing on msdn.

Anyway, If it exists for 64 bits, should/can it be added to rtl\win\wininc\defines.inc same as it is for 32 bit?

Show quoted text 11 lines
On Mon, Mar 31, 2014 at 9:58 PM, Dmitry Boyarintsev < > wrote: http://en.wikipedia.org/wiki/FLAGS_register It's a trap (single-step) flag. to stop after each instruction. (IIRC with some exceptions). I'd think it should be AMD64 compatible.

Reply by email

Dmitry Boyarintsev
to Martin Frb
Martin Frb wrote 5 lines
Anyway, If it exists for 64 bits, should/can it be added to rtl\win\wininc\defines.inc same as it is for 32 bit? Imho, no. At least not in "rtl" defines.

1) it's not part of originating Windows headers (if these are used as part of RTL definitions) - keep the base header as small as possible.
2) The flag itself is very debugging specific. Thus the declaration should go with either separate debugging package or more specific CPU definition header (not necessarily debugging related).

The idea here is to be as "component" as possible, rather than put everything into a single ready for anything RTL (that would bloat it a lot).

thanks,
Dmitry

Reply by email