[DUG] Find the currently executing source line

Myles Penlington myles at ams.co.nz
Mon Jul 16 13:57:05 NZST 2007


You may find that it is stopped on a different thread. You may need to
use the thread view to switch to the main thread to see the correct call
stack - as it is thread specific, and hence see what call of yours
started it all off.

M.


-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Steve Peacocke
Sent: Monday, 16 July 2007 01:42
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Find the currently executing source line

Thanks Rohit.

It tells me that the error may not be in my source code. I'm running
an application in debug mode. The application calls various Windows
applications like MediaPlayer etc. Somewhere reasonably random, the
application stops, seemingly frozen. When I notice this, I can then
open the debugger and find out what the program is currently doing
(source code line) and perhaps why it should be causing this error.

I suspect now that the debugger is trying to tell me that the line its
currently processing is somewhere in one of those Windows events (eg.
MediaPlayer).

This doesn't bring me closer to the error though, but it "may" tell me
that the fault "may not" be in the delphi code .. or not.

Back to square one.

logging everything failes to tell me much either.

Steve

On 16/07/07, Rohit Gupta <rohit at cfl.co.nz> wrote:
> Thats because you have paused in the middle of those dlls.  If you
have
> debugging enable din your source, then I would expect F8 to stop in
your
> code.
>
>
> Steve Peacocke wrote:
> OK, there are two Stack windows.
>
> 1. The CPU Stack contains a list of two columns of 4 hex numbers, and
> a column of for characters. Not a lot to make sense in there.
>
> 2. The Call stack shows a DLL and the kernal32.dll. Steping though
> those, it changes. For example, I now have two QUARTZ.dll files and
> the kernal32.dll
>
> Anyone make sense of that?
>
> Steve
>
> On 13/07/07, Conor Boyd <Conor.Boyd at trimble.co.nz> wrote:
> At the very least, you should be able to look at the Stack Trace
window,
> and look down the stack until you find some of your own code.
>
> Once you find the "top" of your own code, then you should be able to
> work out where you want to put your breakpoint.
>
> HTH,
>
> Conor
>
> -----Original Message-----
> From: delphi-bounces at delphi.org.nz
> [mailto:delphi-bounces at delphi.org.nz]
> On Behalf Of Steve Peacocke
>
> Good afternoon All,
>
> I'm trying to do something rather unusual here with Delphi. Instead of
> tracing code one step at a time, I want to pause the code when I see
> that a certain error has occurred and ask delphi to show me the source
> line that its currently executing. The program is still running in the
> background, so I press pause. It then always loads the CPU window
> (meaning absolutely nothing to me) and when i try to "trace until the
> next source line", it comes up with the following error...
>
> ---------------------------
> Debugger Exception Notification
> ---------------------------
> Project <myname>.exe raised exception class EPrivilege with message
> 'Privileged instruction'.
> ---------------------------
> Break   Continue   Help
> ---------------------------
>
> Break stops at that same line in the CPU window, Continue shows the
> error in a message box; and help, well I haven't tried that but my
guess
> is that it doesn't, help that is.
>
> Can anyone help with how I can see what actual source code line the
> application is processing?
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with
Subject:
> unsubscribe
>
>
>
>
> --
>
> Rohit Gupta
> B.E. Elec.   M.E.   Mem IEEE    Associate IEE
> Technical Manager
> Computer Fanatics Limited
>
> Tel     +64 9 4892280
> Fax    +64 9 4892290
> Email  rohit at cfl.co.nz
> Web    www.cfl.co.nz
>
> ________________________________
>
> This email and any attachments contain information, which is
confidential
> and may be subject to legal privilege and copyright. If you are not
the
> intended recipient, you must not use, distribute or copy this email or
> attachments. If you have received this in error, please notify us
> immediately by return email and then delete this email and any
attachments.
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with
Subject:
> unsubscribe
>


-- 
Steve Peacocke
http://stevepeacocke.blogspot.com/
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe

Attention:
This communication is confidential and may be legally privileged.  If you are not the intended recipient, please do not use, disclose, copy or distribute it, other than to return it to us with your confirmation that it has been deleted from your system.



More information about the Delphi mailing list