Solved

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

Posted on 2011-03-20
4
910 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 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 35175782
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
ID: 35178537
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
ID: 35194602
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
ID: 35409241
just want to close out this old question
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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