Debugger ignores me.

Posted by atch on Stack Overflow See other posts from Stack Overflow or by atch
Published on 2010-04-04T15:13:30Z Indexed on 2010/04/04 15:23 UTC
Read the original article Hit count: 532

Filed under:
|

Having code:

Date::Date(const char* day, const char* month, const char* year):is_leap__(false)
{
    my_day_ = lexical_cast<int>(day);


    my_month_ = static_cast<Month>(lexical_cast<int>(month));

    /*Have to check month here, other ctor assumes month is correct*/
    if (my_month_ < 1 || my_month_ > 12)
    {
        throw std::exception("Incorrect month.");
    }
    my_year_ = lexical_cast<int>(year);

    if (!check_range_year_(my_year_))
    {
        throw std::exception("Year out of range.");
    }

    if (check_leap_year_(my_year_))//SKIPS THIS LINE
    {
        is_leap__ = true;
    }
    if (!check_range_day_(my_day_, my_month_))
    {
        throw std::exception("Day out of range.");
    }

}

bool Date::check_leap_year_(int year)const//IF I MARK THIS LINE WITH BREAKPOINT I'M GETTING MSG THAT THERE IS NO EXECUTABLE CODE IS ASSOSIATED WITH THIS LINE
{
    if (!(year%400) || (year%100 && !(year%4)))
    {
        return true;
    }
    else
    {
        return false;
    }
}

Which is very strange in my opinion. There is call to this fnc in my code, why compiler ignores that.
P.S. I'm trying to debug in release.

© Stack Overflow or respective owner

Related posts about c++

Related posts about reverse-debugging

  • gdb reverse debugging error

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Hi, i started to try reverse debugging with gdb 7, followin the tutorial: http://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial and I thought, great! Then I started to debug a real program which gives an error at the end. So I run it with gdb, and I put a breakpoint just before the place… >>> More

  • Debugger ignores me.

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Having code: Date::Date(const char* day, const char* month, const char* year):is_leap__(false) { my_day_ = lexical_cast<int>(day); my_month_ = static_cast<Month>(lexical_cast<int>(month)); /*Have to check month here, other ctor assumes month is correct*/ if (my_month_… >>> More