c++ debugging

hey
i have a problem with a switch case in program and the debugger is messy has hell ( we use normal VI and gdb in our schoool to make it more diffiacult)

any way i have a problom where for some unknown reason the debugger just skips a switch statment as if it wasent even there

the rest of the code works fine

but for some reason that switch statment is just ignored

it uses enums

enum name
{
    X,
    Y,
};

name Name;

name = a function that returns that enum;

switch (name)
{
    case (X):
    {
    }
    case (Y):
    {
    }
     default:
     {
     }

}

its all fine and i can see in the debugger that the name has a valid value

i know a lot of things can cause this but any help would be greatly appreciated

i will allso ask, can a memory leak or goingover the border of an array caouse this ?

It could be any number of things...a misplaced comment too can cause this...but it is hard to figure it out unless you post the code.

Your cases have no break at the end of them, so will keep going running through all the statements below them.

switch(x)
{
case 1:
        break; // Without this, 1 will keep going through 2 and default:
case 2:
        break; // Without this, it will keep going through default
default:
        break;
}