473,394 Members | 1,693 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,394 software developers and data experts.

Printing stl::list objects in gdb

Hi all,

I am trying to print the contents of a std::list<Point> in gdb
(actually ddd). I have this function

void BezierCurveEvaluator::evaluateCurve(const std::vector<Point>&
ptvCtrlPts)

When I break into the function and say,

(gdb) print ptvCtrlPts

I get:

$1 = (vector<Point,std::allocator<Point> > &) @0x80b4f78:
{<_Vector_base<Point,std::allocator<Point> >> =
{<_Vector_alloc_base<Point,std::allocator<Point>,t rue>> = {_M_start =
0x80b67d8, _M_finish = 0x80b6800, _M_end_of_storage = 0x80b6818}, <No
data fields>}, <No data fields>}

which does not look very friendly :-)

Are there some tricks to force gdb to print the contents of a list, or
for that matter, any other STL container?
Thanks gurus.
Jul 22 '05 #1
2 7048
On 25 Oct 2004 01:20:36 -0700, Te*******@hotpop.com (Michael Jasn)
wrote in comp.lang.c++:
Hi all,

I am trying to print the contents of a std::list<Point> in gdb
(actually ddd). I have this function


This is a question about your debugger, not the language. The C++
standard does not define debuggers or how they operate. Try one of
the gnu.gcc.* support groups, or a group for your particular platform.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #2
> This is a question about your debugger, not the language. The C++
standard does not define debuggers or how they operate. Try one of
the gnu.gcc.* support groups, or a group for your particular platform.


Thanks for pointing me to the right group, Jack.
Jul 22 '05 #3

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

Similar topics

4
by: Asapi | last post by:
class base { }; class d1 : public base { }; class d2 : public base {
6
by: JustSomeGuy | last post by:
I have an stl list that grows to be too huge to maintain effectivly in memory. There are elements within the list that could be stored on disk until accessed. However I don't want to expose...
2
by: Barry Hynes | last post by:
G'Day folks, Have been working on this problem for quite some time and still no farther ahead. :( Here is my problem...bare with me i am very green :) I have to implement a Safe List,...
2
by: Jim Strathmeyer | last post by:
I have a weird question about const correctness when using an stl list. I have a wrapper Inventory class that holds a list of pointers to Items. (Yes, they have to be pointers.) Now, obviously...
3
by: Chrisitiaan | last post by:
Hi, I want to develop a 'truly' object oriented application, that is, my business logic objects handle the business logic (of course) and the persistence to a MS SQL server database. The user...
6
by: Jonathan | last post by:
Hi. I'm having trouble figuring out what I should be doing here. I'm trying to remove an object from a list. The function is: void Alive::FromRoom () { list<Alive>::iterator iter =...
2
by: giotheninman | last post by:
I have a stl list and i have a problem allocating memory for it. I am using the malloc operator in order to get memory for it and I have tried using placement new but it still isnt setting up the...
3
by: Christian Christmann | last post by:
Hi, reading the output of gprof for one of my projects, I found that the STL list assignment operator consumes a larger fraction of the program's execution time. The exact entry in gprof's...
12
by: Philip Mueller | last post by:
Hi, I am using multiple stl::list s of different types. Now I want to write a function list<type>::iterator s_erase(list<typel, list<type>::iterator it) that takes an iterator and deletes...
2
by: harsh.murari | last post by:
I wanted to know how the C++ STL list is implemented. Specifically, I wanted to understand the memory usage by the list objects. I have the following code snippet: std::list <intL; ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.