This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Accessing the references (pointers) from debug server script

Other Parts Discussed in Thread: PMP

Hi,

In my code implementation, i don't have direct access to global variables in the code, meaning

the signals are defined as enums (used via QP/C++ framework)

*****extract of the code base****

enum Signals
{
// Settings
INDX_SETTING_VALUE_SIG = QP::Q_USER_SIG,

REQUIRE_PMP_START_SIG

};

and then these are accessed via pointers as shown below through the QP class:

QP::QState PerPumpControl::Stopped(PerPumpControl * const me, QP::QEvt const * const e) {

QP::QState status_;
switch (e->sig) {
// ${AOs::PeristalticPumpC~::SM::Enabled::Stopped::REQ_PUMP_START}
case REQUIRE_PMP_START_SIG: {
// Store the setpoint
me->setpoint = PmpRequest::GetFlowRate(e);

}

Though the defined enums are global since they are being accessed via these buffers, the address of  the signal "REQUIRE_PMP_START_SIG" is not visible in the map file generated, and hence i will not be able to probe the value for "REQUIRE_PMP_START_SIG".

Is there any mechanism through which this can be acheived?

The structure which is shown above is a common module every module will be using the same class inheritance mechanism and accessing all the required signals via e->sig.

I tried generating the disassembly of that particular object using the required linker module, it is of less help.

Also generated the cross-reference file, which shows the following kind of information:

*****Extract of the Cross-reference.crl file*****

8283240 QP::QHsm::Q_UNHANDLED R ../models/Generated/PeristalticPumpControl.cpp 182 27
15541996 status_ M ../models/Generated/PeristalticPumpControl.cpp 182 17
14938844 REQUIRE_PMP_START_SIG R ../models/Generated/PeristalticPumpControl.cpp 187 14

But i am unable to link it back to the equivalent memory location in the map file.

Any help in this regard would be very much helpful.

I would like to probe the value of REQUIRE_PMP_START_SIG, through the respective DSS memory.read API.

Thanks,

-Nikhilesh

  • Would request the people to respond....if you have come across such tricky situations!
  • Hello,

    Nikhilesh Saggere said:
    I would like to probe the value of REQUIRE_PMP_START_SIG, through the respective DSS memory.read API.

    Unless I misunderstood, you typically do not access the members of an enum. An enum is a type of variable that can be assigned to one of several different values. Defining an enum makes the values of the enum visible, like constants or #defines, and those values can be assigned to variable of the enum's type.

    Thanks

    ki

  • Thank you Ki.

    My question here is these enum's (signals) are being accessed via pointer de-referencing in the application code, is there any mechanism to decode such information via accessing pointers and i don't have individual pointer named for each enum, it is typlically done by referring a common pointer for all the enums and based on switch case the value gets decoded and corresponding operation will be taken place.

    To simplify with the above example:
    QP::QState status_;
    switch (e->sig) {
    // ${AOs::PeristalticPumpC~::SM::Enabled::Stopped::REQ_PUMP_START}
    case REQUIRE_PMP_START_SIG: {
    // Store the setpoint
    me->setpoint = PmpRequest::GetFlowRate(e);

    i would like to know/access via debug server script, whenever the control reaches above shown case (REQUIRE_PMP_START_SIG), will be having may such cases in the application code, based on the number of enums declared.

    Right now i can think of inserting breakpoint at this code location and validating whether the microcontroller has halted or not, is there any better mechanism to do this, i generally want to avoid breakpoints unless and untill they are absolutely necessary.

    I would appreciate any thoughts/ideas in this regard.

    -Nikhilesh