Hi,
I'm using the latest beta and I've also tried with the master branch (and
tried with the version used by Fody in the first place). I've managed to
gather some more info on this problem. As you can see in the attachment
dotPeek properly recognizes the mapping, however dia2dump gives an
interesting result. The proper.txt contains data before the rewrite and
bad.txt contains after it. If you like to see the code I've added it to
github https://github.com/csnemes/CecilTest
Thanks
Csaba
2017. május 2., kedd 20:28:58 UTC+2 időpontban Jb Evain a következőt írta:
> Hey,
>
> Which version of Cecil are you using?
>
> Thanks,
> Jb
>
> On Tue, May 2, 2017 at 11:04 AM, <[email protected] <javascript:>>
> wrote:
>
>> Hi JB,
>>
>> I'm stuck with this weird issue. When I inject some extra method calls
>> into a method the debug information gets messy at least in Visual Studio
>> 2015. Breakpoints cannot be set on some lines after the injection point.
>> The program still runs ok, and as far as I can tell the sequence points are
>> good too. This is what you can see before changes, after changes and after
>> calling optimize.
>>
>> ------ Test started: Assembly: CecilRewriter.dll ------
>> -------
>> 0 IL_0000: nop
>> 1 IL_0001: call System.String System.Console::ReadLine()
>> 6 IL_0006: pop
>> 7 IL_0007: ldstr "Original"
>> 12 IL_000c: call System.Void System.Console::WriteLine(System.String)
>> 17 IL_0011: nop
>> 18 IL_0012: ldstr "Whatever"
>> 23 IL_0017: call System.Void System.Console::WriteLine(System.String)
>> 28 IL_001c: nop
>> 29 IL_001d: call System.String System.Console::ReadLine()
>> 34 IL_0022: pop
>> 35 IL_0023: ret
>> 0 12:12[9:10] False c:\temp\CecilTest\Program.cs
>> 1 13:13[13:32] False c:\temp\CecilTest\Program.cs
>> 7 14:14[13:43] False c:\temp\CecilTest\Program.cs
>> 18 15:15[13:43] False c:\temp\CecilTest\Program.cs
>> 29 16:16[13:32] False c:\temp\CecilTest\Program.cs
>> 35 17:17[9:10] False c:\temp\CecilTest\Program.cs
>> -------
>> 0 IL_0000: nop
>> 1 IL_0001: call System.String System.Console::ReadLine()
>> 6 IL_0006: pop
>> 7 IL_0007: ldstr "Original"
>> 12 IL_000c: call System.Void System.Console::WriteLine(System.String)
>> 0 IL_0000: ldstr "Hello {0}!"
>> 0 IL_0000: ldstr "Joe"
>> 0 IL_0000: call System.Void
>> System.Console::WriteLine(System.String,System.Object)
>> 0 IL_0000: nop
>> 17 IL_0011: nop
>> 18 IL_0012: ldstr "Whatever"
>> 23 IL_0017: call System.Void System.Console::WriteLine(System.String)
>> 28 IL_001c: nop
>> 29 IL_001d: call System.String System.Console::ReadLine()
>> 34 IL_0022: pop
>> 35 IL_0023: ret
>> 0 12:12[9:10] False c:\temp\CecilTest\Program.cs
>> 1 13:13[13:32] False c:\temp\CecilTest\Program.cs
>> 7 14:14[13:43] False c:\temp\CecilTest\Program.cs
>> 18 15:15[13:43] False c:\temp\CecilTest\Program.cs
>> 29 16:16[13:32] False c:\temp\CecilTest\Program.cs
>> 35 17:17[9:10] False c:\temp\CecilTest\Program.cs
>> -------
>> 0 IL_0000: nop
>> 1 IL_0001: call System.String System.Console::ReadLine()
>> 6 IL_0006: pop
>> 7 IL_0007: ldstr "Original"
>> 12 IL_000c: call System.Void System.Console::WriteLine(System.String)
>> 17 IL_0011: ldstr "Hello {0}!"
>> 22 IL_0016: ldstr "Joe"
>> 27 IL_001b: call System.Void
>> System.Console::WriteLine(System.String,System.Object)
>> 32 IL_0020: nop
>> 33 IL_0021: nop
>> 34 IL_0022: ldstr "Whatever"
>> 39 IL_0027: call System.Void System.Console::WriteLine(System.String)
>> 44 IL_002c: nop
>> 45 IL_002d: call System.String System.Console::ReadLine()
>> 50 IL_0032: pop
>> 51 IL_0033: ret
>> 0 12:12[9:10] False c:\temp\CecilTest\Program.cs
>> 1 13:13[13:32] False c:\temp\CecilTest\Program.cs
>> 7 14:14[13:43] False c:\temp\CecilTest\Program.cs
>> 34 15:15[13:43] False c:\temp\CecilTest\Program.cs
>> 45 16:16[13:32] False c:\temp\CecilTest\Program.cs
>> 51 17:17[9:10] False c:\temp\CecilTest\Program.cs
>>
>> It starts to drive me crazy, I'm sure I miss something. Can you point me
>> to what else to check?
>>
>> Thanks a lot.
>>
>> --
>> --
>> --
>> mono-cecil
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "mono-cecil" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
--
--
mono-cecil
---
You received this message because you are subscribed to the Google Groups
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
*** MODULES
0001 CecilTest.Program
*** PUBLICS
PublicSymbol: [00000000][0000:06000001] COM+_Entry_Point(COM+_Entry_Point)
*** SYMBOLS
** Module: CecilTest.Program
Function : In MetaData, [00000000][0001:00000000], len = 00000024, Main
Function attribute:
Function info:
FuncDebugStart :
FuncDebugEnd :
*** GLOBALS
Function: [00000000][0001:00000000] Main
*** TYPES
** User Defined Types
** ENUMS
** TYPEDEFS
*** FILES
Compiland = CecilTest.Program
C:\Work\Spikes\CecilTest\CecilTest\Program.cs
*** LINES
** Main
line 12 at [00000000][0001:00000000], len = 0x1
C:\Work\Spikes\CecilTest\CecilTest\Program.cs
line 13 at [00000001][0001:00000001], len = 0x6
line 14 at [00000007][0001:00000007], len = 0x1B
line 15 at [00000022][0001:00000022], len = 0xB
*** SECTION CONTRIBUTION
RVA Address Size Module
00000000 0001:00000000 00000024 CecilTest.Program
*** DEBUG STREAMS
Stream: SECTIONHEADERS(1)
00 00 00 00 00 00 00 00 - 24 00 00 00 00 00 00 00 - 24 00 00 00 00 00 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 |
........$.......$.......................
Summary :
No of Elems = 1
Sizeof(Elem) = 40
*** INJECTED SOURCES TABLE
*** FPO
*** OEM Specific types
*** MODULES
0001 CecilTest.Program
*** PUBLICS
PublicSymbol: [00000000][0000:06000001] COM+_Entry_Point(COM+_Entry_Point)
*** SYMBOLS
** Module: CecilTest.Program
Function : In MetaData, [00000000][0001:00000000], len = 00000024, Main
Function attribute:
Function info:
FuncDebugStart :
FuncDebugEnd :
Block : static, [00000000][0001:00000000], len = 00000024, (none)
UsingNamespace : USystem
UsingNamespace : USystem.Collections.Generic
UsingNamespace : USystem.Linq
UsingNamespace : USystem.Text
UsingNamespace : USystem.Threading.Tasks
Custom : (none)
*** GLOBALS
Function: [00000000][0001:00000000] Main
*** TYPES
** User Defined Types
** ENUMS
** TYPEDEFS
*** FILES
Compiland = CecilTest.Program
C:\Work\Spikes\CecilTest\CecilTest\Program.cs
*** LINES
** Main
line 12 at [00000000][0001:00000000], len = 0x1
C:\Work\Spikes\CecilTest\CecilTest\Program.cs
line 13 at [00000001][0001:00000001], len = 0x6
line 14 at [00000007][0001:00000007], len = 0xB
line 15 at [00000012][0001:00000012], len = 0xB
line 16 at [0000001D][0001:0000001D], len = 0x6
line 17 at [00000023][0001:00000023], len = 0x1
*** SECTION CONTRIBUTION
RVA Address Size Module
00000000 0001:00000000 00000024 CecilTest.Program
*** DEBUG STREAMS
Stream: SECTIONHEADERS(1)
00 00 00 00 00 00 00 00 - 24 00 00 00 00 00 00 00 - 24 00 00 00 00 00 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 |
........$.......$.......................
Summary :
No of Elems = 1
Sizeof(Elem) = 40
*** INJECTED SOURCES TABLE
*** FPO
*** OEM Specific types