Cyberiafreak

"Fortunate are those who take the first steps.” ― Paulo Coelho

How to debug an unmanaged exe under Windbg

Assume that we have got an exe(unmanaged/managed) which is crashing/hang/wanted to debug and see the intermediate values etc. For this example, I have used the below simple cpp program compiled to exe.

Steps for debugging this complied exe in Windbg:

1) Launch Windbg, -> Open Executable, browse and select our cpp program output “ConsoleApplication1.exe”

2) Now set the symbol path and source path pointing to its corresponding directory.

3) Reload the symbol to make sure the relevant symbols loaded.

4) If you press “g” mean go/F5 would run the program and displays the output.

5) Let us put some breakpoints at Main method and also Swap2Numbers to step in line by line debugging.

 >bp ConsoleApplication1!main 

  >bp ConsoleApplication1!Swap2numbers

6) Since we have mapped the source code path also, now on typing “t” would execute/step in line by line. You would also notice the source code window opened up and breakpoint indicator set.

7) If you wanted to unassemble, then use> uf ConsoleApplication1!main (assembly code).

8) When you go line by line debugging, you can view the intermediate value of the function by typing >dv  (display variable)

This slideshow requires JavaScript.

Advertisements

April 26, 2015 Posted by | windbg | | Leave a comment

Azure Cloud Patterns useful for WebSites, WebJobs, WebRole, WorkerRole

While I was going through the Exam: 70-532 preparation material, I hit these following pattern useful to the Availability, Resiliency and Scalability(ASR) of Azure WebSites and Azure Cloud Services. Wanted to table out here for later reference and detailed reading.

Useful for WebSites/WebJobs & WebRole/WorkerRole
■■ Static Content Hosting pattern
■■ Cache-Aside pattern
■■ Health Endpoint Monitoring pattern
■■ Compensating Transaction pattern
■■ Command and Query Responsibility Segregation pattern(CQRS)

Useful for WebJobs and WorkerRole
■■ Competing Consumers pattern
■■ Priority Queue pattern
■■ Queue-Based Load Leveling pattern
■■ Leader Election pattern
■■ Scheduler Agent Supervisor pattern

RESILIENT CLOUD ARCHITECTURES
> Microsoft Patterns & Practices at http://msdn.microsoft.com/en-us/library/dn568099.aspx [Download PDF]
> Designing resilient architectures for the cloud: http://msdn.microsoft.com/library/azure/jj853352.aspx [provides additinal insight, some specific to Cloud]

April 13, 2015 Posted by | Azure | , , | Leave a comment

Various ways to manage Azure resources explored

I just saw scott post on Azure Resource API lib intro. I thought let me think over all possible ways(recollect) today used to manage Azure Resources like VM, Websites, jobs etc from ones desktop.

1) https://portal.azure.com – famously called azure preview portal.

2) https://manage.windowsazure.com – old portal or manage azure portal.

3) Azure PowerShell PowerShell is a friendly tool for infra guys/DevOps/Admin who manages and automate stuffs using PS commandlets, or advanced stuff like DSC -Desired State configuration, puppet,chef etc.

> There are lot of infra tools available in market place.

4) Azure Resource Manager API –  over REST API – fire commands like PUT,GET,POST from your browser. You could also use ARM client here. It is really nice cmd utility with simple commands written by David E

5) Microsoft Azure Cross Platform Command Line (separate installer available for Mac and windows) – azure-xplat-cli

6) From your managed .NET code too – Microsoft Azure Management Libraries 2.0.0

> Scott H explained how one could do this coding here

7) Using Visual Studio Server Explorer – explained here.

P.s: Let me know if you have any comments regarding this and any other ways left out. 

Update:June-2

8) Blob Transfer Utility for Windows Azure Blob Storage  – https://blobtransferutility.codeplex.com/ read via – http://geekswithblogs.net/tmurphy/archive/2015/05/28/azure-utilities-you-should-have-in-your-toolbox.aspx 

April 12, 2015 Posted by | .NET General, Azure, Azure Tools | | 1 Comment

Azure website swapping — what will move and what not.

When we swap deployment slots, all of the website content is swapped, but the not the configuration.

The following configuration items will move to the destination slot:

■■ General settings (for example, .NET framework version, Web Sockets, Always On)
■■ Connection strings
■■ Handler mappings
■■ Application and site diagnostics settings
■■ Monitoring settings

The following configuration items will not move to the destination slot:
■■ Publishing endpoints
■■ Custom domain names
■■ SSL certificates and bindings
■■ Scale settings

Note: this means that settings such as your db connectiong strings should be configured with the prod values before swapping.

swap1

April 9, 2015 Posted by | Azure websites | , | Leave a comment

Certified for 70-487 !! [ recently cleared 70-532 too ]

Last week I have cleared my 70-487 Developing Microsoft Azure and Web Services certification. I have started preparing for 45+ days on and off, mostly weekend reading and able to clear through second shot offer. There are plenty of materials there to prepare, but I urge to stick with official curriculum + MVA (microsoft virtual academy videos) for this exam. I had internal employee measure up account with some sample questions, with deep understanding of all those concepts + small hands on helped me crack it. Here is what you will learn through this certification,

9780735677241f1256.70-532_3E18159EChapter 1) Accessing Data using – EF, WCF DataServices, Azure Data Storage, Transaction, Caching, XML ds (data). ..

Chapter 2) Querying and Manipulating data by using EF – LINQ to Objects, entities, ADO.NET, EF, Lazy loading,data model…

Chapter 3) Designing and implementing WCF Services – SOA concepts, WCF API obj and config, Securing, consuming, version, Azure Service bus, one way-two way, hosting..

Chapter 4) Create and consume Web API based services – Design a web api, implement, secure, host and consume web api web services

Chapter 5): Deploying web application and Services- Design, deployment strategy, Configure, manage packages using Nuget, create, configure and publish a web package, share assemblies.

Overall, we  will learn back-end programming/db programming + infra projecs like publishing, nuget, etc also helps us to uinderstand end -to end.

Study notes from Chris – http://www.bloggedbychris.com/2013/01/24/microsoft-exam-70-487-study-notes/

[Update: May first week  – I have cleared 70-532 🙂 ]

April 8, 2015 Posted by | .NET General, Certification | , , , , | Leave a comment

   

%d bloggers like this: