Solved

How to determine memory location of a variable in Visual Studio Debugger

Posted on 2011-03-20
4
895 Views
Last Modified: 2013-11-27
I'm running in the Visual Studio debugger and I have a line of code:
sa[j,1] = fn;

Open in new window

and I want to find out where these variables are stored in memory, the actual memory address of fn, j, and array sa. How can I determine that?
0
Comment
Question by:deleyd
  • 2
4 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
Comment Utility
I'm not sure if this is the answer for your particular scenario, but you can try  using the Memory window. Make sure you have "Enable address-level debugging" checked under Options->Debugging, then go to Debug->Windows->Memory->Memory[1,2,3,4]. In the new window that display after you pick one of the four available under the Memory menu, you will have a box that says, "Address." In here, you can type the name of your variable (while you are in debugging mode and while that variable is in scope) and hit Enter. The variable name you typed in should change to the variable's address once you hit enter.
0
 
LVL 47

Assisted Solution

by:dlethe
dlethe earned 250 total points
Comment Utility
What do you *really* want to know?   The reason is that the memory location (or footprint) used when a program is debugging is never going to be the same when program is running in production, nor will it be the same from invocation to invocation, or even at any point of time due to virtual memory.

0
 

Author Comment

by:deleyd
Comment Utility
I want to learn what's going on under the hood. I have a 2-D array of strings, sa, and I'm wondering how it' implemented. Is it an array of pointers to strings? Is the array stored in memory in row-major order or column-major order?

I'm always concerned about speed and efficiency. I don't just want to know that it will work, I want to know that it will work fast. I'd like to know how things like the generic Dictionary are implemented internally. I want to know what's going on under the hood.

Is there a good book explaining the internals of these things?
0
 

Author Closing Comment

by:deleyd
Comment Utility
just want to close out this old question
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now