I'm posting an edited question since the whole business of segfaults and third-party libraries in the original question are just distracting.
What I have is a program that uses xerces-c and segfaults (creating a core-dump in the process). What I want to do is to fire up gdb and traverse the created DOMDocument from the core-dump.
e.g., I want to get the attributes of a given DOMElement or it's children nodes and so on. Does anyone have any articles I can read up for this that describe the internal structure of DOMElements and so on? Or even point me to some resources on the xerces-c source code since I've been unable to find the source code for DOMElement in my source tarball. (Having the source code might help since then I know exactly how DOMElement is implemented allowing me to traverse it).
As I said, I'm not too familiar with the xerces-c codebase and apache documentation is patently horrible.
Original Question:-
I'm using an third-party library that in turn uses xercesc for xml parsing somewhere which is segfaulting. How do I inspect xerces-c elements from the core-dump?
I have access to the library source code and it's segfaulting in a function that uses a DOMElement reference as a function argument. Something like
void func (DOMElement& e, ...) {
}
I want to inspect this DOMElement from the core-dump (as in print out it's name, tags, children elements and so on. basically traverse the DOMDocument below this DOMElement) but I'm not familiar with the xerces-c codebase.
Any idea of how I can go about doing this?
Additional info :- I'm using gdb.