Recent

Author Topic: Poject raised exception  (Read 2487 times)

MaxCuriosus

  • Full Member
  • ***
  • Posts: 118
Poject raised exception
« on: October 30, 2021, 03:24:49 pm »
I've ported some Lazarus projects from a Debian 10.7 to a brand new Debian 11.1 system, recompiled them and ran them. All work as expected but one, which gives this error message at execution with debugger:

Code: [Select]
Project ... raised exception class 'Unknown' with message:
### Not supported on GDB < 5.3 ###
At address ...

that apparently comes from the call to ShowMessage(...).

Since the others projects also have this procedure I looked at the project settings but could not find a reason.

Any suggestions welcome.

howardpc

  • Hero Member
  • *****
  • Posts: 3860
Re: Poject raised exception
« Reply #1 on: October 30, 2021, 03:49:42 pm »
Try recompiling your projects without debug information?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7693
  • Debugger - SynEdit - and more
    • wiki
Re: Poject raised exception
« Reply #2 on: October 30, 2021, 04:05:58 pm »
Ignore the "gdb < 5.3" part. That was added way back, when this situation was only knows for any gdb that old.

You got a normal exception somewhere. But the debugger was unable to get the class and msg of the exception.

Depending on how much debug info you have on your app, you may still get a stack trace in the stack window, if you break/pause when you get the dialog.

Alternatively you can try FpDebug / Install package LazDebuggerFp

MaxCuriosus

  • Full Member
  • ***
  • Posts: 118
Re: Poject raised exception
« Reply #3 on: October 30, 2021, 10:00:39 pm »
howardpc,
Martin_fr,
Thank you.

I was able to locate the cause simply by using the "Console In/Out" that led me to the  initialization section of one of the units in which the code tries to open a file on an external USB stick without verifying first if it is accesible(inserted). That error occurs before the first statement of the program, a call to ShowMessage(...). Lesson learned.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7693
  • Debugger - SynEdit - and more
    • wiki
Re: Poject raised exception
« Reply #4 on: October 31, 2021, 11:23:55 am »
I was able to locate the cause simply by using the "Console In/Out" that led me to the  initialization section of one of the units in which the code tries to open a file on an external USB stick without verifying first if it is accesible(inserted). That error occurs before the first statement of the program, a call to ShowMessage(...). Lesson learned.

Is that on Windows?

Is the EXCEPTION caused by the file-open? Or by the "ShowMessage" call?

The latter is kind of expected, but also maybe fix-able. I had a similar issue with a dialog (file select dialog).

MaxCuriosus

  • Full Member
  • ***
  • Posts: 118
Re: Poject raised exception
« Reply #5 on: November 02, 2021, 10:11:25 pm »
1. As mentioned in my intial post it's on Linux, with:

  Debian 11.1
  kernel 5.10.0-9-amd64
  libgtk2.0-dev_2.24.33-2_amd64.deb
  gdb (version 10.1-1.7)
  libcanberra-gtk-module (version 0.30-7) 
  fpc-src_3.2.0-1_amd64.deb
  fpc-laz_3.2.0-1_amd64.deb
  lazarus-project_2.0.10-0_amd64.deb
 
2. The EXCEPTION was triggered by:

   SL:=TStringList.Create;
   SL.LoadFromFile(Filename_on_USB_stick);
   
3. The "ShowMessage" call was the first statement in the "program" unit.

 

TinyPortal © 2005-2018