Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Study the impact of integrating v22 exceptions and postmortem traces. #6

Open
sowebio opened this issue Nov 26, 2023 · 1 comment
Open

Comments

@sowebio
Copy link

sowebio commented Nov 26, 2023

In addition to the usual trace, a v22 exception give some extra information like: exception time, program uptime, program & library names & versions, start & home directories and Ada and all languages memory allocation, current & maximum (peak) values. In addition, v22 closes open DB connections after the trace has been output.

I'm obviously open to extend this code to Mac OS with atos command...

-------------------------------------------------------------------------------------

Exception time         : 20230921-123354
Program uptime         :  0h0 0m0 0s
Program build DT stamp : build 2023-09-21 12:33:15
Program name & version : testgui v0.1
Library name & version : v22 v0.1
Start directory        : /home/sr/Sowebio/informatique/dev/gpl/github/v22/tests
Home directory         : /home/sr
Ada mem. alloc. (bytes): Ada Cur: [ 4132 ] Max: [ 4708 ]
All mem. alloc. (bytes): All Cur: [ 15204352 ] Max: [ 15204352 ]

raised V22.RAISE_EXCEPTION.V22_EXCEPTION_TEST : v22.adb:81
[./testgui]
0x496f9e v22__raise_exception at v22.adb:81
0x41c1b1 _ada_testgui at testgui.adb:830
0x488d8f main at b__testgui.adb:1173
[/lib/x86_64-linux-gnu/libc.so.6]
0x7fb0fee29d8e
0x7fb0fee29e3e
[./testgui]
0x415973 _start at ???
0xfffffffffffffffe

-------------------------------------------------------------------------------------

20230921-123354 - INIT    - MSG - testgui > Exception detected, finalize application

20230921-123354 - SQL T1  - MSG - Closing SQLITE database: v22_testapi_1
20230921-123354 - SQL T1  - MSG - Closing SQLITE database: v22_testapi_2

@Blady-Com
Copy link
Owner

User logging feature allows to customize exception logger, see changes for align.adb and add:

   overriding procedure Log
     (Object     :    User_Defined_Logging_Type;
      Message    : in String;
      Occurrence : in Ada.Exceptions.Exception_Occurrence);

with your own code inside Log body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants