Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 13th, 2007, 2:02 AM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
Watch the float stack

Do anyone know if there is a way to "watch" the float stack in Visual Studio? It is very handy to add watches like "eax" to see return values after function calles. But is there a way to do the same thing with floats by seeing the float stack while debugging?

Thanks for your help!

/Klarre
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote
Old Nov 13th, 2007, 7:49 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: Watch the float stack

A float is just another binary value. Find out what register(s) you're interested in and have a look. You can also watch the associated variable, of course.

The "return" register is just a convention. Don't expect it to be the same on every platform.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 13th, 2007, 3:42 PM   #3
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
Re: Watch the float stack

I am not sure you really got what I meant, or I did not understand your first two sentences of your post. The thing with seeing the FPU stack in the watch panel is because sometimes you don't see the associated variable. See example below.
return static_cast<float>(a * b / getFloatFromSomeWhere());
Here it is nice to see what has been put on the FPU stack to see what the functions has returned.

Thanks for your reply though!

Anyway...
I solved the problem. Opening the "Registers" tab and right-click on it will give me a list of registers to display. It was also possible to add a watch named like "st0".
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote
Old Nov 13th, 2007, 4:06 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: Watch the float stack

Quote:
Opening the "Registers" tab and right-click on it will give me a list of registers to display.
That sort of goes along with
Quote:
Find out what register(s) you're interested in and have a look.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heap vs. Stack memory Eric the Red C++ 11 Oct 24th, 2006 6:18 PM
stack question bl00dninja C++ 9 May 8th, 2006 7:54 PM
Don't read if you watch baseball uman Coder's Corner Lounge 31 Aug 10th, 2005 7:03 AM
Smashing a stack in MIPS assembly code tsgrimey Assembly 2 Feb 27th, 2005 1:06 PM
Help with stack implementation ridley C++ 0 Feb 26th, 2005 2:26 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC