Solved

Stop Delphi Debugging into System.pas _HandleFinally

Posted on 2010-09-06
9
1,177 Views
Last Modified: 2013-11-23
I have a big application.

When debugging and I come accross a "raise exception" in my application, Delphi asks me if I want to Break or Continue?

If I select Break the debugger puts me on the line where the raise was issued.

If I then hit F8 once it takes me to the end of the procedure.

If I hit it once more it takes me into soem assembly code in the middle of _HandleFinally in System.pas.

How can I stop this?
0
Comment
Question by:enigmasolutions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 500 total points
ID: 33611442
in the .dpr (project options), switch off checkbox "use debug dcu's"

this will switch off the debugging into native vcl system files



you need to recompile your app, for this to be in effect
0
 
LVL 1

Author Comment

by:enigmasolutions
ID: 33611447
This only started happenign recently.
The only thing I can think is that I added FastMM4.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 33611547
usually a program like that adds a compiler directive
which does the same as in the project options
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:enigmasolutions
ID: 33611587
Thanks Geert.

Yes, but it is set to false!!! (in the IDE that is).

Hmm I just checked MyApp.dproj and I notice that debugDCUs=true - see below

removing this line in this file fixed the problem

I "think" I also tried to change it in the IDE (eg turning it on / turnign it off) - but it didn't seem to help.

FYI - The "corrupted" dproj file was my fault (due to poor version control).


            <PropertyGroup Condition="'$(Cfg_1)'!=''">
                  <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
                  <DCC_DebugInformation>false</DCC_DebugInformation>
                  <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
                  <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
            </PropertyGroup>
            <PropertyGroup Condition="'$(Cfg_2)'!=''">
                  <DCC_DebugDCUs>true</DCC_DebugDCUs>
                  <DCC_SymbolReferenceInfo>2</DCC_SymbolReferenceInfo>
                  <DCC_MapFile>3</DCC_MapFile>
                  <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
            </PropertyGroup>

0
 
LVL 1

Author Comment

by:enigmasolutions
ID: 33611663
Whoa,

FastMM4 has masses of compiler directives.

I wonder if this setting in MyApp.DPROJ was caused by FastMM4.

See code here.  NOTE: From memory, I think I added the first {$D-} without any benefit.

Can you see anything in this code that migth cause the change to MyApp.DPROJ

{$D-} //prevent debugging into this unit

unit FastMM4;

interface

{$Include FastMM4Options.inc}

{$RANGECHECKS OFF}
{$BOOLEVAL OFF}
{$OVERFLOWCHECKS OFF}
{$OPTIMIZATION ON}
{$TYPEDADDRESS OFF}

{IDE debug mode always enables FullDebugMode and dynamic loading of the FullDebugMode DLL.}
{$ifdef FullDebugModeInIDE}
  {$define InstallOnlyIfRunningInIDE}
  {$define FullDebugMode}
  {$define LoadDebugDLLDynamically}
{$endif}

{Install in FullDebugMode only when the DLL is available?}
{$ifdef FullDebugModeWhenDLLAvailable}
  {$define FullDebugMode}
  {$define LoadDebugDLLDynamically}
  {$define DoNotInstallIfDLLMissing}
{$endif}

{Some features not currently supported under Kylix}
{$ifdef Linux}
  {$undef FullDebugMode}
  {$undef LogErrorsToFile}
  {$undef LogMemoryLeakDetailToFile}
  {$undef ShareMM}
  {$undef AttemptToUseSharedMM}
  {$undef RequireIDEPresenceForLeakReporting}
  {$undef UseOutputDebugString}
  {$ifdef PIC}
    {BASM version does not support position independent code}
    {$undef ASMVersion}
  {$endif}
{$endif}

{Do we require debug info for leak checking?}
{$ifdef RequireDebugInfoForLeakReporting}
  {$ifopt D-}
    {$undef EnableMemoryLeakReporting}
  {$endif}
{$endif}

{Enable heap checking and leak reporting in full debug mode}
{$ifdef FullDebugMode}
  {$STACKFRAMES ON}
  {$define CheckHeapForCorruption}
  {$ifndef CatchUseOfFreedInterfaces}
    {$define CheckUseOfFreedBlocksOnShutdown}
  {$endif}
{$else}
  {Error logging requires FullDebugMode}
  {$undef LogErrorsToFile}
  {$undef CatchUseOfFreedInterfaces}
  {$undef RawStackTraces}
  {$undef AlwaysAllocateTopDown}
{$endif}

{Only the Pascal version supports extended heap corruption checking.}
{$ifdef CheckHeapForCorruption}
  {$undef ASMVersion}
{$endif}

{$ifdef UseRuntimePackages}
  {$define AssumeMultiThreaded}
{$endif}

{Delphi versions}
{$ifndef BCB}
  {$ifdef ver120}
    {$define Delphi4or5}
  {$endif}
  {$ifdef ver130}
    {$define Delphi4or5}
  {$endif}
  {$ifdef ver140}
    {$define Delphi6}
  {$endif}
  {$ifdef ver150}
    {$define Delphi7}
  {$endif}
  {$ifdef ver170}
    {$define Delphi2005}
  {$endif}
{$else}
  {$ifndef PatchBCBTerminate}
    {Cannot uninstall safely under BCB}
    {$define NeverUninstall}
    {Disable memory leak reporting}
    {$undef EnableMemoryLeakReporting}
  {$endif}
  {for BCB4, use the Delphi 5 codepath}
  {$ifdef ver120}
    {$define Delphi4or5}
    {$define BCB4}
  {$endif}
  {for BCB5, use the Delphi 5 codepath}
  {$ifdef ver130}
    {$define Delphi4or5}
  {$endif}
{$endif}
{$ifdef ver180}
  {$define BDS2006}
{$endif}

{$ifndef Delphi4or5}
  {$ifndef BCB}
    {$define Delphi6AndUp}
  {$endif}
  {$ifndef Delphi6}
    {$define BCB6OrDelphi7AndUp}
    {$ifndef BCB}
      {$define Delphi7AndUp}
    {$endif}
    {$ifndef BCB}
      {$ifndef Delphi7}
        {$ifndef Delphi2005}
          {$define BDS2006AndUp}
        {$endif}
      {$endif}
    {$endif}
  {$endif}
{$endif}

{$ifdef Delphi6AndUp}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
{$endif}

{Leak detail logging requires error logging}
{$ifndef LogErrorsToFile}
  {$undef LogMemoryLeakDetailToFile}
  {$undef ClearLogFileOnStartup}
{$endif}

{$ifndef EnableMemoryLeakReporting}
  {Manual leak reporting control requires leak reporting to be enabled}
  {$undef ManualLeakReportingControl}
{$endif}

{$ifndef EnableMMX}
  {$undef ForceMMX}
{$endif}

{Are any of the MM sharing options enabled?}
{$ifdef ShareMM}
  {$define MMSharingEnabled}
{$endif}
{$ifdef AttemptToUseSharedMM}
  {$define MMSharingEnabled}
{$endif}

{Instruct GExperts to back up the messages file as well.}
{#BACKUP FastMM4Messages.pas}

{Should debug info be disabled?}
{$ifdef NoDebugInfo}
  {$DEBUGINFO OFF}
{$endif}

{$ifdef BCB}
  {$ifdef borlndmmdll}
    {$OBJEXPORTALL OFF}
  {$endif}
{$endif}

{-------------------------Public constants-----------------------------}
const
  {The current version of FastMM}
  FastMMVersion = '4.94';
  {The number of small block types}
{$ifdef Align16Bytes}
  NumSmallBlockTypes = 46;
{$else}
  NumSmallBlockTypes = 55;
{$endif}

Open in new window

0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 33613150
have you checked in the file
{$Include FastMM4Options.inc}

?
0
 
LVL 1

Author Comment

by:enigmasolutions
ID: 33623688
I suspect my problem is nothing to do with FastMM4.

However I did find an issue in the file you mentioned.

I think I should set the NoDebugInfo option in this file (since I am not interested in debuggin FastMM4) - what do you think?

see code below - the dot "." after the { disables the setting I think.

{Enable this option to suppress the generation of debug info for the
 FastMM4.pas unit. This will prevent the integrated debugger from stepping into
 the memory manager code.}
{.$define NoDebugInfo}

Open in new window

0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 33624381
the easiest thing to do is indeed test and see what happens
i don't use FastMM but i had the same problem with EurekaLog
it also depended on DebugInfo for reporting
switching it off solved the problem i had
0
 
LVL 1

Author Closing Comment

by:enigmasolutions
ID: 33624399
Thanks Geert.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question