Skip to main content
formatting
Source Link
Nathaniel Ford
  • 21k
  • 20
  • 94
  • 106

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
  {
  static void Main(string[] args)
  {
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
  }
  //1. configuration: release
  //2. platform target: x64 or Any Cpu
  //3. debug info: pdb only or full
  //4. OS: Win7 x64
  //5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;
  2. VS build configuration: release;
  3. VS build platform target: x64 or Any Cpu;
  4. VS build debug info: pdb only or full;
  5. VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.!

And if you can reproduce this issue, please consider to votevoting on this post.

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
 {
static void Main(string[] args)
 {
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;
  2. VS build configuration: release;
  3. VS build platform target: x64 or Any Cpu;
  4. VS build debug info: pdb only or full;
  5. VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

And if you can reproduce this issue, please consider to vote on this post.

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program {
  static void Main(string[] args) {
    bool b = false;

    if (b) {
        List<string> list = new List<string>();
        foreach (var item in list) {

        }
    } else {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
  }
  //1. configuration: release
  //2. platform target: x64 or Any Cpu
  //3. debug info: pdb only or full
  //4. OS: Win7 x64
  //5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;
  2. VS build configuration: release;
  3. VS build platform target: x64 or Any Cpu;
  4. VS build debug info: pdb only or full;
  5. VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance!

And if you can reproduce this issue, please consider voting on this post.

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
{
static void Main(string[] args)
{
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;
  2. VS build configuration: release;
  3. VS build platform target: x64 or Any Cpu;
  4. VS build debug info: pdb only or full;
  5. VS build optimize code: enabled;

2.VS build configuration: release;

3.VS build platform target: x64 or Any Cpu;

4.VS build debug info: pdb only or full;

5.VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

And if you can reproduce this issue, please consider to vote on this post: http://connect.microsoftthis post.com/VisualStudio/feedback/details/664400/a-curious-case-of-visual-studio-2010-debugger-it-can-not-hit-a-break-point#tabs

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
{
static void Main(string[] args)
{
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;

2.VS build configuration: release;

3.VS build platform target: x64 or Any Cpu;

4.VS build debug info: pdb only or full;

5.VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

And if you can reproduce this issue, please consider to vote on this post: http://connect.microsoft.com/VisualStudio/feedback/details/664400/a-curious-case-of-visual-studio-2010-debugger-it-can-not-hit-a-break-point#tabs

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
{
static void Main(string[] args)
{
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;
  2. VS build configuration: release;
  3. VS build platform target: x64 or Any Cpu;
  4. VS build debug info: pdb only or full;
  5. VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

And if you can reproduce this issue, please consider to vote on this post.

Bounty Ended with Dennis's answer chosen by Cui Pengfei 崔鹏飞
added 226 characters in body
Source Link

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
{
static void Main(string[] args)
{
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;

2.VS build configuration: release;

3.VS build platform target: x64 or Any Cpu;

4.VS build debug info: pdb only or full;

5.VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

And if you can reproduce this issue, please consider to vote on this post: http://connect.microsoft.com/VisualStudio/feedback/details/664400/a-curious-case-of-visual-studio-2010-debugger-it-can-not-hit-a-break-point#tabs

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
{
static void Main(string[] args)
{
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;

2.VS build configuration: release;

3.VS build platform target: x64 or Any Cpu;

4.VS build debug info: pdb only or full;

5.VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

A curious case of Visual Studio 2010 debugger(it can not hit a break point)

This is the code that reproduces the problem:

class Program
{
static void Main(string[] args)
{
    bool b = false;

    if (b)
    {
        List<string> list = new List<string>();
        foreach (var item in list)
        {

        }
    }
    else
    {
        Console.WriteLine("1");
    }
    Console.WriteLine("2");//add a break point here in VS2010
}
//1. configuration: release
//2. platform target: x64 or Any Cpu
//3. debug info: pdb only or full
//4. OS: Win7 x64
//5. optimize code: enabled
}

Add a break point to the last statement of the code, then debug it in vs2010, you'll see that the break point can not be hit.

To reproduce this curious case, you'll need to meet the following conditions:

  1. Operation system: windows 7 x64;

2.VS build configuration: release;

3.VS build platform target: x64 or Any Cpu;

4.VS build debug info: pdb only or full;

5.VS build optimize code: enabled;

I am not sure those conditions are sufficient to reproduce it, but it's how my machine was configured when I found this issue.

Why is the debugger not able to hit the break point?

Thanks in advance.

And if you can reproduce this issue, please consider to vote on this post: http://connect.microsoft.com/VisualStudio/feedback/details/664400/a-curious-case-of-visual-studio-2010-debugger-it-can-not-hit-a-break-point#tabs

added 4 characters in body
Source Link
Loading
Bounty Started worth 50 reputation by Cui Pengfei 崔鹏飞
added 45 characters in body
Source Link
Loading
Source Link
Loading