Click here to Skip to main content
15,919,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: inet_addr for IPv6 Pin
Vijay_Vijay16-Dec-09 19:22
Vijay_Vijay16-Dec-09 19:22 
QuestionDevelop client app. to consume a web service? Pin
TigerNinja_4-Nov-02 12:18
TigerNinja_4-Nov-02 12:18 
AnswerRe: Develop client app. to consume a web service? Pin
Ravi Bhavnani4-Nov-02 12:37
professionalRavi Bhavnani4-Nov-02 12:37 
QuestionHow to view anonymous namespace variables' values in debugger? Pin
Tim Finer4-Nov-02 12:13
Tim Finer4-Nov-02 12:13 
AnswerRe: How to view anonymous namespace variables' values in debugger? Pin
Christian Graus4-Nov-02 12:19
protectorChristian Graus4-Nov-02 12:19 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Tim Finer4-Nov-02 12:27
Tim Finer4-Nov-02 12:27 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Christian Graus4-Nov-02 12:35
protectorChristian Graus4-Nov-02 12:35 
AnswerRe: How to view anonymous namespace variables' values in debugger? Pin
jbarton5-Nov-02 5:04
jbarton5-Nov-02 5:04 
Hi Tim,

While I have not used this with variables in anonymous namespaces, you should be able to setup a watch variable by using the address of the variable.

If you setup a breakpoint at a place that uses the variable, you can open the Disassembly window and find the address of the variable. I tried a sample program which did "cout << anon << endl;", and the disassembly showed:

mov eax,['anonymous namespace'::anon (00476dc0)]

The 00476dc0 is the address of the anon variable for my program. When you run this, it most likely will be a different address.

Once you have the address of the variable, you can setup a watch for it as follows:

* (int *) 0x476dc0

Substitute the address that you get for the 0x476dc0.

This tells the debugger to treat the address as a pointer to int, and then dereferences it. If you want, you can use:

(int *) 0x476dc0

You then get a plus sign which you need to expand to get to the value. For a single value, this isn't useful, but if you have an array, it can be very useful. For instance, if you had the following:

namespace
{
int array[5] = {5,4,3,2,1};
}

Once you find the address of the array in the debugger, you can display the array in a watch window as follows:

((int *) 0x476dc0),5

Again, replace address with the one found in the debugger. This will put a + next to the expression which will expand to 5 elements when clicked.

Best regards,
John

GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Tim Finer5-Nov-02 7:08
Tim Finer5-Nov-02 7:08 
AnswerRe: How to view anonymous namespace variables' values in debugger? Pin
dshatilov15-Sep-16 0:29
dshatilov15-Sep-16 0:29 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
Richard Deeming15-Sep-16 7:10
mveRichard Deeming15-Sep-16 7:10 
GeneralRe: How to view anonymous namespace variables' values in debugger? Pin
dshatilov15-Sep-16 7:56
dshatilov15-Sep-16 7:56 
GeneralPlease Help!! Pin
Autunmsky4-Nov-02 11:38
Autunmsky4-Nov-02 11:38 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 11:50
protectorChristian Graus4-Nov-02 11:50 
GeneralRe: Please Help!! Pin
Gary Kirkham4-Nov-02 11:48
Gary Kirkham4-Nov-02 11:48 
GeneralRe: Please Help!! Pin
Autunmsky4-Nov-02 11:55
Autunmsky4-Nov-02 11:55 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 12:22
protectorChristian Graus4-Nov-02 12:22 
GeneralRe: Please Help!! Pin
Chris Losinger4-Nov-02 12:23
professionalChris Losinger4-Nov-02 12:23 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 12:33
protectorChristian Graus4-Nov-02 12:33 
GeneralRe: Please Help!! Pin
Chris Losinger4-Nov-02 15:01
professionalChris Losinger4-Nov-02 15:01 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 15:17
protectorChristian Graus4-Nov-02 15:17 
GeneralRe: Please Help!! Pin
Chris Losinger4-Nov-02 17:29
professionalChris Losinger4-Nov-02 17:29 
GeneralRe: Please Help!! Pin
Autunmsky4-Nov-02 12:57
Autunmsky4-Nov-02 12:57 
GeneralRe: Please Help!! Pin
Christian Graus4-Nov-02 13:12
protectorChristian Graus4-Nov-02 13:12 
GeneralRe: Please Help!! Pin
Autunmsky4-Nov-02 14:29
Autunmsky4-Nov-02 14:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.