Solved

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

Posted on 2011-03-20
4
923 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:David
David 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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