Menu

Tree [006617] master /
 History

HTTPS access


File Date Author Commit
 include 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 source 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 test 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 test-pascal 2023-05-16 Björn Ganster Björn Ganster [abdd0a] Profiling support added
 .gitignore 2024-05-16 Björn Ganster Björn Ganster [9beba3] Fix corrupt string written by stGetCurrentThrea...
 CMakeLists.txt 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 Compiling with msvc.txt 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 Readme.txt 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 libinstrumentation.def 2025-04-22 Björn Ganster Björn Ganster [006617] Added pointer whitelists
 make_linux.sh 2022-12-19 bjoern bjoern [e65337] Linux port
 make_msvc_2017_x64.bat 2023-03-22 Björn Ganster Björn Ganster [175d23] Add scripts for building with MSVC 2022
 make_msvc_2017_x86.bat 2023-03-22 Björn Ganster Björn Ganster [175d23] Add scripts for building with MSVC 2022
 make_msvc_2022_x64.bat 2023-07-05 Björn Ganster Björn Ganster [06e1d9] cmake updates
 make_msvc_2022_x86.bat 2024-03-05 Björn Ganster Björn Ganster [a71504] It is good practice to delete objects after use...
 make_msys2_gcc_x64.bat 2023-07-03 Björn Ganster Björn Ganster [e55ee0] Rename startProfiling -> stStartProfiling, stop...
 make_msys2_gcc_x86.bat 2023-07-03 Björn Ganster Björn Ganster [e55ee0] Rename startProfiling -> stStartProfiling, stop...

Read Me

Use libinstrumentation to add stack traces to your code.  Usage:

- Add libinstrumentation to your project (details depend on the compiler used)
- Define a list of file numbers in a central location
- Add include: #include "libinstrumentation.h"
- Below the include, add a line like #define FILE_NUMBER FILE_NO_ARCHIVE_ACCESS_CPP
- Before any other call to the library, place a call to stInitialize()
- At the start of a function, add the macro SET_SCOPE;
- Before dangerous/long/critical operations, add a call to SET_OP;
- Replace any return statements with the RETURN macro
- Since RETURN is a macro, return statements after if need braces:

if (condition) return value;

becomes

if (condition) { RETURN value; }

- Any time you need a stacktrace, call stGetCurrentThreadStackTrace. This will get you a string composed of pairs a:b, where a is a file number you defined and b is a line number for that file

Please check out the latest version from git and please check the code samples.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.