Bug 25358 - Invalid mdb scopes for variables
Summary: Invalid mdb scopes for variables
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Marek Safar
: 10188 18430 21232 25946 (view as bug list)
Depends on:
Reported: 2014-12-12 17:43 UTC by David Karlaš
Modified: 2015-01-27 12:59 UTC (History)
5 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Create a new report for Bug 25358 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Related Links: