473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Debugger won't show values

I'm using VC++ in Visual Studio 2003 to write a .NET wrapper class
which accesses some unmanaged c code. When debugging, I've noticed
that sometimes the debugger won't show values of unmanaged pointers.
I've reproduced the problem in a VC++ .NET console project. The file
containing the main functions is as follows:

----------------------------------------------------------------

// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include "stdafx.h"
#include <stdio.h>

#using <mscorlib.dll>

using namespace System;

struct TestStruct {
char term[20];
double value[4];
};

int _tmain()
{
// TODO: Please replace the sample code below with your own.
TestStruct *testStruct;
TestStruct *testStruct1;
//TestStruct testStruct2;

testStruct = (TestStruct*)malloc(sizeof(TestStruct));
testStruct->value[0]=0.0;

testStruct1 = new TestStruct();
testStruct1->value[0]=1.7;

//testStruct2.value[0]=1.5;

printf("%f\t%f\n", testStruct->value[0], testStruct1->value[0]);
return 0;
}

----------------------------------------------------------------------------

When setting a breakpoint at the printf statement, the watch window
lists the following for testStruct and testStruct2:
{TestStruct}{term=<undefined value> value=<undefined value>}

I don't get this problem in a Win32 console application, only in .NET.
What might cause this?

Thank you,
codex
Nov 17 '05 #1
0 1069

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Meier | last post by:
Environment: SQLServer Developer Edition on Machine A Enterprise Manager running on remote machine B Both machines are in the same subnet I open Enterprise Mgr on Machine A, right click...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
3
by: Gavin Kreuiter | last post by:
I am looking for some advice on how to debug a program when the debugger "print" command actually clears the corruption. This is not the usual non-initialised memory problem, because the program...
4
by: Jason | last post by:
This is an offshoot of my post "c# XOR equals (^=) bug?". While I was working on the code for that problem, I think I found a problem with the VS.NET debugger. That has to do with the quick...
6
by: VMI | last post by:
I have a really simple IF statement that looks like this: if (sNewString.Length == iCount) { MessageBox.Show (sNewString.Length.ToString() + " is equal to " + iCount.ToString() + "*" +...
4
by: Girish | last post by:
Ok, starting from the basics. Reference types and value types are all objects underneath. So, a String is an object as well. Now, when when we are debugging and we examine the contents of a...
18
by: R. Bernstein | last post by:
Okay, a bit of an exaggeration. Recently, I've been using Python more seriously, and in using the debugger I think one of the first things I noticed was that there is no "restart" ("R" in...
4
by: aramsey | last post by:
I have a javascript program that works fine under Firefox and on IE when running XP, but is having a problem with IE running under Windows 2000 Pro. On my personal XP development machine I have...
12
by: Arcticool | last post by:
Can anyone tell me why j never shows up in my locals window? 32 is printed to console so I know the assignment is working. I was under the impression that I could see everything as it happens by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.