• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applications
 

SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applications

on

  • 274 views

 

Statistics

Views

Total Views
274
Views on SlideShare
274
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applications SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applications Presentation Transcript

    • Production debugging of SharePoint applications #SPSBEUK Wouter van Vugt April 26th, 2014
    • Thanks to our sponsors! Gold Silver
    • Agenda
    • .NET Applications OS CLR App
    • Common Language Runtime Operation • Memory management • Thread synchronization • Error handling • Type Safety Security • Code Access Security • Data Execution Prevention (OS) • Address Space Layout Randomization (OS) Execution • Intermediate Language
    • Type Safety Car c = new Person() ‘Pointer type’ Pointer Object type
    • Circumventing type safety Demo
    • Creating .NET Applications C#, C++, VB.NET, F#.... (40+) Module PDB Compile Link Assembly PDB
    • Executing code C# Machine Code Language richness compared IL
    • Executing code with JIT Compilation Console.WriteLine("Hi"); Console.WriteLine("There"); JIT Compiler -Lookup IL for method -Compile IL to native -Modify metadata to point to compiled code -Jump to compiled code Console metadata static void WriteLine(string) JIT Compiler Address static void WriteLine() JIT Compiler Address Native CPU Instructions Native Address
    • Executing code with JIT Compilation Console.WriteLine("Hi"); Console.WriteLine("There"); Console metadata static void WriteLine(string) JIT Compiler -Lookup IL for method -Compile IL to native -Modify metadata to point to compiled code -Jump to compiled code Native Address static void WriteLine() JIT Compiler Address Native CPU Instructions
    • Code optimization
    • Running non optimized code
    • C# Compiler – Variable Generation
    • C# Compiler – Variable Generation
    • C# Compiler – Inserting NOP
    • C# Compiler – Inserting NOP
    • C# Compiler – Branching
    • C# Compiler – Branching
    • Compile time optimizations Demo
    • Just In Time Compilation Compiler switch C# IL Code Quality JIT Native Code Quality /optimize- /debug- Unoptimized Optimized /optimize- /debug+ Unoptimized Unoptimized /optimize+ /debug+ Optimized Optimized
    • NGEN.exe
    • JIT - Local variable elimination PrintUser(GetUser(3)); Before After
    • JIT – Range check elimination static int[] _array = new int[10]; static volatile int _i; static void Main(string[] args) { int[] localRef = _array; for (int i = 0; i < localRef.Length; ++i) _i += localRef[i]; } Before After
    • JIT – Method Inlining public class Program { static void Main(string[] args) { int i = 5 & 4; } } Before After
    • JIT – Tail Call Optimization static void Main(string[] args) { TestTailCallOptimization(); } public static void TestTailCallOptimization() { string s = "Test"; TailCall1(s); } static void TailCall1(string s) { Console.WriteLine(s); TailCall2(s); } static void TailCall2(string s) { Console.WriteLine(s + s); }
    • Native NGEN images are hard to debug Loading non-precompiled assemblies C:> SET COMPLUS_ZAPDISABLE=1 C:> NGEN uninstall MyAssembly
    • Preventing JIT optimization [.NET Framework Debugging Control] GenerateTrackingInfo=1 AllowOptimize=0 [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.EnableEditAndContinue | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.Default)]
    • Debugging optimized code Demo
    • Debugging code
    • PDB Files
    • Symbol Servers
    • Locating debug symbols MyAssembly.dll MyAssembly.pdb GUID GUID Equal
    • Dumpbin.exe
    • Prevent loading all PDBs
    • Visual Studio Source Server support
    • Configuring Symbol Locations
    • PDB alternate streams
    • SYMBOL SERVERS, SOURCE SERVERS AND SOURCE INDEXING Demo
    • Working with break points
    • Setting breakpoints on automatic properties
    • Breakpoints on automatic properties
    • Debugging third party code
    • Enabling remote debugging
    • Debugging SharePoint Demo
    • Thank you!