Your SlideShare is downloading. ×
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applications
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applications

382

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
382
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Production debugging of SharePoint applications #SPSBEUK Wouter van Vugt April 26th, 2014
  • 2. Thanks to our sponsors! Gold Silver
  • 3. Agenda
  • 4. .NET Applications OS CLR App
  • 5. 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
  • 6. Type Safety Car c = new Person() ‘Pointer type’ Pointer Object type
  • 7. Circumventing type safety Demo
  • 8. Creating .NET Applications C#, C++, VB.NET, F#.... (40+) Module PDB Compile Link Assembly PDB
  • 9. Executing code C# Machine Code Language richness compared IL
  • 10. 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
  • 11. 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
  • 12. Code optimization
  • 13. Running non optimized code
  • 14. C# Compiler – Variable Generation
  • 15. C# Compiler – Variable Generation
  • 16. C# Compiler – Inserting NOP
  • 17. C# Compiler – Inserting NOP
  • 18. C# Compiler – Branching
  • 19. C# Compiler – Branching
  • 20. Compile time optimizations Demo
  • 21. 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
  • 22. NGEN.exe
  • 23. JIT - Local variable elimination PrintUser(GetUser(3)); Before After
  • 24. 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
  • 25. JIT – Method Inlining public class Program { static void Main(string[] args) { int i = 5 & 4; } } Before After
  • 26. 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); }
  • 27. Native NGEN images are hard to debug Loading non-precompiled assemblies C:> SET COMPLUS_ZAPDISABLE=1 C:> NGEN uninstall MyAssembly
  • 28. 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)]
  • 29. Debugging optimized code Demo
  • 30. Debugging code
  • 31. PDB Files
  • 32. Symbol Servers
  • 33. Locating debug symbols MyAssembly.dll MyAssembly.pdb GUID GUID Equal
  • 34. Dumpbin.exe
  • 35. Prevent loading all PDBs
  • 36. Visual Studio Source Server support
  • 37. Configuring Symbol Locations
  • 38. PDB alternate streams
  • 39. SYMBOL SERVERS, SOURCE SERVERS AND SOURCE INDEXING Demo
  • 40. Working with break points
  • 41. Setting breakpoints on automatic properties
  • 42. Breakpoints on automatic properties
  • 43. Debugging third party code
  • 44. Enabling remote debugging
  • 45. Debugging SharePoint Demo
  • 46. Thank you!

×