AnsweredAssumed Answered

DEVKIT-MPC5748G c++ GDB server fails

Question asked by Kfir Ben shimon on May 20, 2017
Latest reply on Apr 12, 2018 by Norbert Unterberg

Hi,

 

I am using an example C++ project from S32 (hello) for the DEVKIT-MPC5748G.

When I take the project as is, I can compile it and debug it, using the Diab compiler v.5.9.4.8 and the USB debug.

 

But when adding a class that inherits from another class, and declaring it as global, the debug fails.

 

 

 

debugger version: GNU gdb (GDB) 7.8.2

 

main.cpp, in bold are my additions:

/*
* main implementation: use this 'C++' sample to create your own application
*/

#include "derivative.h" /* include peripheral declarations */
#include "ClassB.h"

#ifdef __cplusplus
extern "C" {
#endif

extern void xcptn_xmpl(void);

#ifdef __cplusplus
}
#endif

ClassB objectB(10);

class counterclass
{
private:
int m_counter;
public:
counterclass(void)
{
m_counter = 0;
};
void increment(void)
{
m_counter++;
};
};

int main()
{
counterclass myccounter;
int mode = 0;
int total = 0;

xcptn_xmpl (); /* Configure and Enable Interrupts */

/* Loop forever */
for(;;) {
myccounter.increment();
}
}

 

ClassB.cpp

#include "ClassB.h"

ClassB::ClassB(int startValue) :
fStartValue(startValue)
{
}

int ClassB::sum()
{
int sum = fStartValue;
for (int i = 0; i < 4; ++i)
{
sum += i;
}
return sum;

}

 

ClassA.h:

#ifndef CLASSA_H_
#define CLASSA_H_

class ClassA
{
public:
virtual int sum() = 0;
};

#endif /* CLASSA_H_ */

 

 

Can you help me sort out the issue? It seems like a but in S32 debuggger.

 

** I have attached the example with the addition I have used for reference.#

Outcomes