473,406 Members | 2,387 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,406 software developers and data experts.

Debugger uses wrong typedef for local structure

In an application that has multiple files that each define a
typedef with the same name, the debugger does not correctly
use the local typedef when stepping in local functions.

The following example has two source files that each
define the type "ivars". If you place a breakpoint in
the "local2" function in File2.c, the debugger will
display *self using the typedef from File1.c

The generated code functions correctly, the problem
is only with the debugger's display of the data structure.

File1.c

extern void *malloc(size_t) ;

typedef struct
{ int a ;
int b ;
} ivars ;

void local1(ivars *self)
{ self->a = 1 ;
self->b = 2 ;
}

ivars *new1()
{ return malloc(sizeof(ivars)) ;
}

File2.c

extern void *malloc(size_t) ;

typedef struct
{ int p ;
int q ;
} ivars ;

void local2(ivars *self)
{ self->p = 3 ;
self->q = 4 ;
}

ivars *new2()
{ return malloc(sizeof(ivars)) ;
}

Main.c

void *local2(void*) ;

main()
{ void *x = new2() ;
local2(x) ;
}
Nov 17 '05 #1
1 1002
>The following example has two source files that each
define the type "ivars". If you place a breakpoint in
the "local2" function in File2.c, the debugger will
display *self using the typedef from File1.c


Hugh,

It displays p & q OK for me.

Which version of VC++ are you using?

I've tried with VC7.1 (VS2003).

Dave
Nov 17 '05 #2

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

Similar topics

1
by: A C | last post by:
Hi Can someone explain why the following is happening. ProjectA <-- depends on B, C, .... ProjectB ProjectC... etc Project B contains b.cpp and b.h. Also has conditional compiler directive...
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 -------------------------------------------------------------------------------- ...
8
by: Rob S | last post by:
I have UDB 8.1 Personal Edition installed. I'm using Development centre to develop JAVA Stored Procedues. I am unable to debug them. I have installed IBM Distributed Debugger and have set...
6
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module....
6
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
15
by: Ian Bush | last post by:
Hi All, I'm a bit confused by the following which is causing one of our user's codes fail in compilation: typedef struct SctpDest_S; 1) Is this standard ? 2) If so ( or even if not so ! )...
12
by: colin | last post by:
Hi, Ive got a difference in results depending on wether I run my app in the debugger, or run it seperatly (or with <ctrl-f5>) the results in the debugger seem to be more correct, although the...
7
by: colin | last post by:
Hi, Ive written a 3dmodel editor, and it works fairly well it harldy uses any cpu exept when its loading a texture from bitmap in the debugger, at all other times it hardly uses any cpu but from...
16
by: John Doe | last post by:
Hi, I wrote a small class to enumerate available networks on a smartphone : class CNetwork { public: CNetwork() {}; CNetwork(CString& netName, GUID netguid): _netname(netName),...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.