Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Xori

GDB/DDD and the STL

This topic is 5224 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In a project I am working on, I use a STL member object in a class such as: std::vector m_sceneList; I am using G++ as the compiler and GDB/DDD to debug, and I am unable to view the contents of the STL objects present in the program. Is there a way to get these, or should I move away from using the STL in this project?

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Xori
In a project I am working on, I use a STL member object in a class such as:

std::vector<srSolidObject *> m_sceneList;

I am using G++ as the compiler and GDB/DDD to debug, and I am unable to view the contents of the STL objects present in the program. Is there a way to get these, or should I move away from using the STL in this project?

As I roughly recall, if you tell it to "print m_sceneList" it should show you one of the values inside the structure called something like "begin"

I think something like "print *(srSolidObject*)begin" should show you the first one, and just do (begin+1) i think to go on to the second.

although, gdb may want you to add the size of the structure, not just 1...

Share this post


Link to post
Share on other sites
Trouble is though, that when I attempt to access the STL object, it tells me < error type >. Example:

I have an object srScene MainScene, which has a STL member
std::vector< srSolidObject * > m_sceneList     
so that it would be accessed in code as
MainScene.m_sceneList[ i ]->etc...    

When I try to tell GDB "print MainScene.m_sceneList", it gives me < error type > in return. Thus, I'm not entirely sure if it is possible for me to ask it about begin, espeically since begin returns an iterator object, right?

When I perform a ptype on MainScene:

(gdb) ptype MainScene
type = struct srScene {
unsigned int m_errorCode;
char *m_errorMessage;
bool m_verbose : 8;
int m_currentLine;
srColor m_bgColor;
< unknown type > m_cameraList;
< unknown type > m_sceneList;
< unknown type > m_lightList;
srColor m_ambientLight;
srOctree *m_scene;
}

Thanks for your reply, though! I appreciate any help I can get on this matter!

(sorry about the edits, I had formatting issues, and sorry I had to mangle stuff with spaces to make it display the angle and square brackets. *goes to read about proper formatting on this forum* )

[edited by - Xori on June 6, 2004 10:05:48 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!