From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8965 invoked by alias); 15 Jun 2007 19:52:10 -0000 Received: (qmail 8956 invoked by uid 22791); 15 Jun 2007 19:52:09 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Jun 2007 19:52:07 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0) with ESMTP id l5FJq2d4026658; Fri, 15 Jun 2007 21:52:02 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0/Submit) id l5FJq2B7009679; Fri, 15 Jun 2007 21:52:02 +0200 (CEST) Date: Fri, 15 Jun 2007 19:52:00 -0000 Message-Id: <200706151952.l5FJq2B7009679@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: kdsfinger@gmail.com CC: gdb@sourceware.org In-reply-to: (kdsfinger@gmail.com) Subject: Re: how to view content in stl vector References: Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00134.txt.bz2 > Date: Tue, 12 Jun 2007 11:05:21 -0400 > From: kdsfinger@gmail.com > > hi, all > How may I view the content in a stl vector in ddd? (or the command to > print it in gdb?). It seems I can only view the first element. I > searched google but did not find answer. Thanks for help. There isn't a simple way. You'll have to dig through the data structure yourself, which requires knowledge about the particulat stl implementation. In a running program you might be able to call the appropriate member functions (like operator[]), but doing so in the right way isn't easy for heavily templated code used in most stl implementations. And that doesn't work in core dumps. I generally consider C++ code to be undebuggable. Mark