473,811 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does this VC.net dissasembly look right?

I declare two variables and call a function. The second to last statement
seems fishy to me. My other non-static function calls to other methods in
the same class do not have "this" line. Furthermore, after executing this
line, the addresses of my local variables change.

Is this normal?

Thanks,

Chris

===
int Ni;
double dt;
GetTrackDropPar ms(Track, dt, Ni);
01610981 lea ecx,[Ni]
01610984 push ecx
01610985 lea edx,[dt]
01610988 push edx
01610989 mov eax,dword ptr [Track]
0161098C push eax
0161098D mov ecx,dword ptr [this]
01610990 call CtTracker::GetT rackDropParms (0BC1830h)
Nov 17 '05
12 1605

"Carl Daniel [VC++ MVP]" <cp************ *************** **@mvps.org.nos pam>
wrote in message news:%2******** *********@TK2MS FTNGP12.phx.gbl ...
Should changes in ESP be visible in the "disassembl y" view?
Yes, it's visible in the Registers window along with all the others.
Debug|Windows|R egisters from the menu or Ctrl-Alt-G from the keyboard if
the reigsters window isn't visible.


That wasn't quite my question, although the point is moot since ESP is not
changing in my case. What I was trying to ask was "What should one think if
ESP changed, but the corresponding assembly instruction did not reference
ESP? Is that even possible?"

How do you conlucde that the address changes?
Watch window before F10:
dt = 100.0
&dt = 0x8812ab12 (Notional)

Watch window after F10:
dt = 3.12124554e-300
&dt = 0x125484ba (Notional)

Results consistent with small value of dt. More on that below.
Are you debugging an optimized build, or a debug build?


unoptimized "debug" build.
There have been two important developments in the case. As I was trying to
make screenshots to illustrate the example I produced above, I found...

1. the bad behavior (local var addresses changing [LVAC]) stopped.
Yesterday it was repeatable, but not today.

2. I had a logic error which led me into the debugger and to the LVAC issue.
It may have be that LVAC is just a "debugger" issue. My logic error
produced results consistent with a very small value of dt - which further
convinced me that LVAC was really happening.

I should have (and next time I will):
cout << &dt << endl;
f();
cout << &dt << endl;

Thanks a million for your help guys,

Chris
Nov 17 '05 #11
"William DePalo [MVP VC++]" <wi***********@ mvps.org> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Well, if you have _lots_ of time, and if the local variables are smallish,
you might want to put a few of them in the watch window. Use addresses
rather than names because names go out of scope. Then put breakpoints at
entry to each of the functions you suspect on the way from their last good
location to the place where they change. That should get you the function.
Once you find it, step through it a line at a time. That should get you
the location.
Excellent tip and I did just that. I found that the values [typing
addresses in the watch window] did not change. However, the values [typing
variable names in the watch window] did change. This was consistent with
"local variable addresses changing" [LVAC]
By the way, are you using any of the C runtime functions like memcpy() and
strcpy()


This is a huge application and there's no doubt that dangerous functions
such as these are being used. :(

Thanks for your help,

Chris
Nov 17 '05 #12
"Chris Stankevitz" <ch******@stank evitz.nospample ase.com> wrote in message
news:ui******** ******@TK2MSFTN GP09.phx.gbl...
Excellent tip and I did just that. I found that the values [typing
addresses in the watch window] did not change. However, the values
[typing variable names in the watch window] did change. This was
consistent with "local variable addresses changing" [LVAC]
Have you found the line where things go bad? Can you post it here?
Thanks for your help,


You are welcome.

Regards,
Will
Nov 17 '05 #13

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

Similar topics

14
4340
by: billy.becker | last post by:
I need to save a wav file that is HTTP POSTed to a php page. What does PHP5 do automatically to a POSTed variable when it puts it in the $_POST superglobal array? I haven't been able to find any info on this.... I have a script that does what I want in PERL, but I need to do it in PHP. I think the PERL does something magic when it does this:
11
3661
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own rules when it comes to file paths. A lot of Microsoft installers for example, and also installers of other companies, do not work because they handle paths in the following manner:
13
5065
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
3
4418
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
9
1361
by: william | last post by:
You guys are a great resource for learners such as I. I have seen the way that you go over and above in explaining even the most mudane things to beginners, and I think it is a great thing that you do here. I only hope that you can help me understand how a certain type of application works. I loaded an app that filters out spam (as it puts it) "before it hits your inbox". Now, how does this work? It changed my incoming and outgoing...
14
4867
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
89
6091
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
7
4657
by: Xah Lee | last post by:
Look at this page http://xahlee.org/emacs/wrap-url.html Look at it in Firebox, look at it in Safari, in Opera, and look at it in Microsoft Internet Explorer. The only fucked up case, is Firefox. Namely, that it does not respect the font used when dealing with «width:80ex». The way to test this visually, is by this code: <pre style="border:thin black solid;
55
6275
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in C# in some way? Or maybe no, because it is similar to a global variable (with its scope restricted) which C# is dead against? Zytan
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.