GDB skips over my code!
Posted
by sheepsimulator
on Stack Overflow
See other posts from Stack Overflow
or by sheepsimulator
Published on 2010-04-05T14:58:06Z
Indexed on
2010/04/05
15:03 UTC
Read the original article
Hit count: 341
So, I've defined a class like
DataLoggingSystemStateReceiver
{
DataLoggingSystemStateReceiver()
{
// stuff
}
// ... other functions here
};
In main, I instantiate DataLoggingSystemStateReceiver like so:
int main()
{
// ... run stuff
Sensor sensor(port, timer);
DataLoggingSystemStateReceiver dlss();
Log::notice("started");
return 0;
}
However, when I step through this code in gdb, it runs:
Sensor sensor(port, timer);
skips
DataLoggingSystemStateReceiver dlss();
and continues with
Log::notice("started");
What gives?
EDIT: By changing
DataLoggingSystemStateReceiver dlss();
to
DataLoggingSystemStateReceiver dlss;
in main(), the line executes. Can someone explain why?
© Stack Overflow or respective owner