Bug 25358

Summary: Invalid mdb scopes for variables
Product: [Mono] Compilers Reporter: David Karlaš <david.karlas>
Component: C#Assignee: Marek Safar <masafa>
Severity: major CC: alain.rogister, dcjordan, mhutch, mono-bugs+mono, paul
Priority: High    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description David Karlaš 2014-12-12 17:43:28 UTC
If scopes in .mdb file are invalid XS Debugger(or debugger-libs) can't
determine which "e" is correct one.

First code example:
using System.IO;
using System;

namespace ExceptionEvalFails
  class MainClass
    public static void Main (string[] args)
      try {
        throw new Exception ();
      } catch (IOException e) {
        Console.WriteLine (e);
      } catch (Exception e) {
        Console.WriteLine (e);//Breakpoint here

This is mdbdump output(notice that it has 3 scopes but both variables are in 0
<?xml version="1.0" encoding="ibm852"?>
    <file id="1" name="Program.cs" checksum="70feb5658988698896c6888b83696faf"
    <file id="2" name="AssemblyInfo.cs"
checksum="53e1ea137859b9367e3248e7436133cc" />
    <method token="0x6000001" signature="System.Void
      <sequencepoints />
      <locals />
      <scopes />
    <method token="0x6000002" signature="System.Void
        <entry il="0x0" row="9" col="5" file_ref="1" />
        <entry il="0x1" row="10" col="11" file_ref="1" />
        <entry il="0x2" row="11" col="15" file_ref="1" />
        <entry il="0x8" row="12" col="9" file_ref="1" />
        <entry il="0x9" row="12" col="31" file_ref="1" />
        <entry il="0xa" row="13" col="9" file_ref="1" />
        <entry il="0xb" row="13" col="17" file_ref="1" />
        <entry il="0x10" row="14" col="7" file_ref="1" />
        <entry il="0x11" row="14" col="9" file_ref="1" />
        <entry il="0x17" row="14" col="29" file_ref="1" />
        <entry il="0x18" row="15" col="9" file_ref="1" />
        <entry il="0x19" row="15" col="17" file_ref="1" />
        <entry il="0x1e" row="16" col="7" file_ref="1" />
        <entry il="0x24" row="17" col="5" file_ref="1" />
        <entry name="e" il_index="0" scope_ref="0" />
        <entry name="e" il_index="1" scope_ref="0" />
        <entry index="0" start="0x2" end="0x8" />
        <entry index="1" start="0xa" end="0x10" />
        <entry index="2" start="0x18" end="0x1e" />
Comment 1 David Karlaš 2015-01-07 00:39:24 UTC
*** Bug 18430 has been marked as a duplicate of this bug. ***
Comment 2 David Karlaš 2015-01-07 00:40:08 UTC
*** Bug 21232 has been marked as a duplicate of this bug. ***
Comment 3 David Karlaš 2015-01-07 00:50:42 UTC
*** Bug 10188 has been marked as a duplicate of this bug. ***
Comment 4 David Karlaš 2015-01-12 15:32:24 UTC
*** Bug 25946 has been marked as a duplicate of this bug. ***
Comment 5 Marek Safar 2015-01-27 12:59:55 UTC
Fixed in mono master