Recent

Author Topic: Debugger "Ingore this exception type"  (Read 6549 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Debugger "Ingore this exception type"
« on: August 19, 2012, 07:20:26 am »
When debugger shows "Ingore this exception type", and one choses to ignore it, would like verification that this becomes a permanent part of the application, even after more changes.

Also, I am not sure if this message shows at run time, so the end-user can ignore the exception, if so chosen. So, does it?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8819
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Debugger "Ingore this exception type"
« Reply #1 on: August 19, 2012, 08:25:00 am »
Quote
When debugger shows "Ingore this exception type", and one choses to ignore it, would like verification that this becomes a permanent part of the application, even after more changes.
It's saved in either .lps or .lpi (depending on your settings) AFAIK.
Quote
Also, I am not sure if this message shows at run time, so the end-user can ignore the exception, if so chosen. So, does it?
No, the message comes from the debugger catching the exception which is shown by the IDE. Outside debugging environment, it would simply execute the default exception handler installed to the application.

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Debugger "Ingore this exception type"
« Reply #2 on: August 19, 2012, 08:36:13 am »
The first line of your question is the answer: ignore exception is a debugger setting and his no impact on the application.

A little background: exception handling depends on OS/cpu. A common behavior is that exceptions are handled in a chain of exception handlers. Debuggers are inserted or can insert themselves as the first one in the chain. Every exception handler can decide to deal with the exception or hand it over to he next in chain. The configuration you are talking about is exactly that for the debugger. For a debugger handling an exception means stopping the application.
Now, when you write a try except block, you explicitely insert yourself in the exception handling chain so that you can do what you want when the exception occurs. FPC also insert a default excpetion handler which is the one you see at work when your program crashes with a stack dump on the console or the popup you see with OK Cancel that displays the exception message.

Use try except to handle the exceptions yourself. See the docimentation of try except on how to selectively handle certain types of exceptions and hand the others over to the next in chain.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Debugger "Ingore this exception type"
« Reply #3 on: August 19, 2012, 10:13:14 am »
Quote
When debugger shows "Ingore this exception type", and one choses to ignore it, would like verification that this becomes a permanent part of the application, even after more changes.
It's saved in either .lps or .lpi (depending on your settings) AFAIK.
Quote
Also, I am not sure if this message shows at run time, so the end-user can ignore the exception, if so chosen. So, does it?
No, the message comes from the debugger catching the exception which is shown by the IDE. Outside debugging environment, it would simply execute the default exception handler installed to the application.

Thanks.

This checks with what I am finding:

The resultant application no longer raises the exception, which is fine, because the exception happens within a DBgrid, when it was finding BCD data, and that data is OK.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Debugger "Ingore this exception type"
« Reply #4 on: August 19, 2012, 10:20:28 am »
The first line of your question is the answer: ignore exception is a debugger setting and his no impact on the application.

A little background: exception handling depends on OS/cpu. A common behavior is that exceptions are handled in a chain of exception handlers. Debuggers are inserted or can insert themselves as the first one in the chain. Every exception handler can decide to deal with the exception or hand it over to he next in chain. The configuration you are talking about is exactly that for the debugger. For a debugger handling an exception means stopping the application.
Now, when you write a try except block, you explicitely insert yourself in the exception handling chain so that you can do what you want when the exception occurs. FPC also insert a default excpetion handler which is the one you see at work when your program crashes with a stack dump on the console or the popup you see with OK Cancel that displays the exception message.

Use try except to handle the exceptions yourself. See the docimentation of try except on how to selectively handle certain types of exceptions and hand the others over to the next in chain.

I can't use try blocks because the "error" detection happens within the grid when it finds BCD data in a cell,  in an SQLite3 database.

At debug time, I accepted "ignore this type of excepton", and thereafter the application does not raise the error and runs fine.

As Leledumbo says, the "ignoring of the exception" seems to become a property of the project, somehow, and that's what I need.

So I am set, so far. But knowing exactly where it is kept in the project, so I can revert it if needed, would be useful to know, though.

Thanks.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11454
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger "Ingore this exception type"
« Reply #5 on: August 19, 2012, 03:30:56 pm »
The resultant application no longer raises the exception, which is fine, because the exception happens within a DBgrid, when it was finding BCD data, and that data is OK.

That is not possible.

The "Ignore Exception" does not modify haw your program works. It only says if the debugger (if your progrom runs in the debugger) will tell you about it.

If the debugger notifies you, it allows you to stop (actually this is "pause") your program. You can look at what happens, and then continue. If you do not stop/pause then your program continues right away.

In all cases:
- you paused, and continue
- you did not pause, and continue
- you set to "ignore", which is the same as continue

In all cases your program will then see the exception and has to deal with it. For example in a try...except block.

----------------
The setting is saved globally. See environments menu > options. Section Debugger. There are pages that list the exceptions.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8819
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Debugger "Ingore this exception type"
« Reply #6 on: August 19, 2012, 06:59:33 pm »
Quote
That is not possible.

The "Ignore Exception" does not modify haw your program works. It only says if the debugger (if your progrom runs in the debugger) will tell you about it.
Perhaps it's an internal (expected and already handled) exception in the DBGrid, which is still caught by the debugger. That's why it doesn't appear in the real application.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Debugger "Ingore this exception type"
« Reply #7 on: August 19, 2012, 07:29:01 pm »
The resultant application no longer raises the exception, which is fine, because the exception happens within a DBgrid, when it was finding BCD data, and that data is OK.

That is not possible.

The "Ignore Exception" does not modify haw your program works. It only says if the debugger (if your progrom runs in the debugger) will tell you about it.

If the debugger notifies you, it allows you to stop (actually this is "pause") your program. You can look at what happens, and then continue. If you do not stop/pause then your program continues right away.

In all cases:
- you paused, and continue
- you did not pause, and continue
- you set to "ignore", which is the same as continue

In all cases your program will then see the exception and has to deal with it. For example in a try...except block.

----------------
The setting is saved globally. See environments menu > options. Section Debugger. There are pages that list the exceptions.

Not really.

It did change how the .exe works. It no longer raises the exception, with the same database, and having made no changes at all to any cell.

It seems to me that it puts some type of metacommand option (or whatever the terminology) in the project, so that the exception type is ignored by the resultant application.

Unless you have documentation that supports what you state, I don't agree, for my case here.

Thanks.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Debugger "Ingore this exception type"
« Reply #8 on: August 20, 2012, 08:59:24 am »
Quote
Unless you have documentation that supports what you state, I don't agree, for my case here.
Please show the documentation that supports what you state. Unless you show that, I don't believe you are right.

I'd also apply Occam's razor to this question: a lot of your threads include your telling various other people they're wrong. Who is wrong, they or you?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11454
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger "Ingore this exception type"
« Reply #9 on: August 20, 2012, 02:59:57 pm »
Quote
Unless you have documentation that supports what you state, I don't agree, for my case here.
Please show the documentation that supports what you state. Unless you show that, I don't believe you are right.

Actually: about the effects of the "Ignore this type of exception".
I am the current maintainer of that bit of code. So I am rather sure about what it does.

http://wiki.lazarus.freepascal.org/IDE_Window:_Debugger_Options#Language_Exceptions
Quote
Programs can raise exceptions. For example, when a file can not be read. Here you setup, if the debugger should stop on an exception.

As I said:
- It does not change the fact that the exception is happening
- It only changes if the debugger will tell you

Exceptions are something normal to happen (despite, it is not what the name suggests). If you use code from packages, then there may be many exceptions, that are intended, and handled.

But for what you need, in this case it is the right thing to "ignore" it. Because (if) this exception is part of the package and dealt with, and you need not worry about it.

 

TinyPortal © 2005-2018