Menu

#325 QSpy shows Sig=NULL if Q_EVT_CTOR is used

QP
closed
None
1
2024-08-01
2022-12-27
Anonymous
No

In case the option Q_EVT_CTOR is used, the macros Q_NEW and Q_NEW_X (qf.hpp (github.com)) call QF::newX_ with the sig argument set to 0.
This causes QS_SIG_PRE_ (qf_dyn.pp (github.com)) to be called with 0. As a result, QSpy is showing Sig=Nullon EV_NEW, instead of the correct sig value.

Discussion

  • Quantum Leaps

    Quantum Leaps - 2022-12-27

    In case you define Q_EVT_CTOR macro (perhaps in the qf_port.hpp), you also have to define the constructors for all your event classes. These event constructors must necessarily call the base-class constructor QEvt(sig), which sets the event signal.
    But this happens only after the event is allocated, so during the allocation the sig parameter is not set yet and therefore the QS software trace reports 0.
    The fix for this issue is quite simple and requires only slight modification of the macros Q_NEW() and Q_NEW_X() (as well as FreeRTOS "specials" Q_NEW_FROM_ISR() and Q_NEW_X_FROM_ISR()). The fix will be implemented in QP/C++ 7.2.0.
    --MMS

     
  • Quantum Leaps

    Quantum Leaps - 2023-01-10

    Fixed in QP/C/C++ 7.2.0.
    --MMS

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB