When I am trying to set the break point on a constructor of a
 templated class (two vector type template parameters), and I use TAB
 TAB to get the completion list in the *Completions* buffer (under
 emacs) and then mouse-2 or RETURN to select the desired constructor,
 I get this pasted into my gdb session:

(gdb) break 'TxDataModelFunctor<vector<double, allocator<double> >,
vector<double, allocator<double> >
>::TxDataModelFunctor(vector<double, allocator<double> > const &,
vector<double, allocator<double> > const &,
TxParametricModel<vector<double, allocator<double> >, vector<double,
allocator<double> > > *)

After adding the closing single quote, I get the error:
malformed template specification in command


If I do a simmple query replace in a temporary buffer to substitute:

        from: vector<double, allocator<double> >
        to:   vec_t
the result looks ok to me:

break 'TxDataModelFunctor<vec_t, vec_t >::TxDataModelFunctor(vec_t
const &, vec_t const &, TxParametricModel<vec_t, vec_t > *)


I assume this is a bug because I am using the syntax provided to me by
GDB and the program compiles.

Thanks,
John Hunter

version info:
gdb 5.0 under emacs 20.5.1.  The program I am debugging was
compiled with 'g++ --ggdb' using gcc-2.95.2. 

Here is the header file for the TxDataModelFunctor.  The template
parameters RetVecType and ArgVecType were both instantiated with
vector<double>.


//----------------------------------------------------------------------------
//
//   TxDataModelFunctor.h
//
//----------------------------------------------------------------------------

#ifndef TX_DATA_MODEL_FUNCTOR
#define TX_DATA_MODEL_FUNCTOR

#include <TxFunctor.h>
#include <TxMatrix.h>
#include <TxVectorFunctor.h>
#include "TxParametricModel.h"

template <class RetVecType, class ArgVecType> 
class TxDataModelFunctor : 
  public TxVectorFunctor<RetVecType, ArgVecType>{
  
  /// Value type of the vector argument.
  typedef typename TxUnaryContainerTraits<ArgVecType>::ValueType
  ArgType;
  
  /// Value type of the vector valued function.
  typedef typename TxUnaryContainerTraits<RetVecType>::ValueType
  RetType;
  
  /// Type of the derivative.
  typedef typename
  TxBinaryContainerTraits<ArgVecType, RetType>::PromoteType
  PromoteType;
  
  /// A vector of derivative types.
  typedef typename
  TxBinaryContainerTraits<ArgVecType, RetType>::PromoteVectorType
  PromoteVectorType;

  //the functions which calculate the function and gradient values and
  //return the results in the last arg by reference
  typedef TxParametricModel<RetVecType, ArgVecType>* PtrModel;
public:
  
  ///Constructor passing the dependent variables, the independent
  //variables, the parametric model, the dimension of the param space
  //and the number of data points:

  TxDataModelFunctor(const RetVecType& ydata, const ArgVecType& xdata, 
                     PtrModel pm);
  
  /// Virtual destructor does nothing
  virtual ~TxDataModelFunctor() { };
  
( ... snip ... )  
  
  
};

#if defined(__DECCXX) && !defined(TX_VECTOR_PTR_FUNCTOR_CPP)

#pragma do_not_instantiate TxDataModelFunctor<std::vector<double>,
 std::vector<double> >
#pragma do_not_instantiate TxDataModelFunctor<std::vector<float>,
 std::vector<double> >

#endif

#endif // TX_VECTOR_PTR_FUNCTOR_H






 

Reply via email to