This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using STL containers with GDB


 > >> The Python branch appears to work for executables compiled with Gcc  
 > >> only.  I'm
 > >> curious to know if this approach will work for executables built  
 > >> using other
 > >> compilers?
 > >
 > > Vincent's implementation has the layout of the GNU STL implementation
 > > hardcoded into it - so even less portable than the Python
 > > implementation, which uses the field names.
 > 
 > You are right, this patch is very hardcoded. I assume that fields of  
 > STL containers are always in the same order. I ask GDB the size of  
 > "void *", and I compute fields offsets using this information to read  
 > things I need. If you use another compiler, but with GNU STL headers,  
 > this patch *should* continue to work...

Thar's what I wonder: would your approach, implemented as a Python script,
give the best of both worlds?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]