yup, 1.7
i hacked around and got it to compile, that was a requirement for me today
because i have been working at home on my FreeBSD box, and some FreeBSD
showstoppers where fixed in 1.7
so, i got the xerces-c stuff sorted out, it compiles, it runs all the
c samples without dumping core.
so then i went on and fixed up my copy of xerces-p to work with 1.7. i
think that all i had to do was prepend "xercesc/" to the include paths and
it was good to go.
so now i am debugging the tests. i get a core dump on DOMException.t here:
my @persons1 = $doc1->getElementsByTagName('person');
here's z stacktrace
bash-2.05a$ gdb perl -c perl.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `perl'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from /usr/local/lib/libiconv.so.2...done.
Reading symbols from /usr/lib/libutil.so.3...done.
Reading symbols from
/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/auto/XML/Xerces/Xerces.so...done.
Reading symbols from /usr/local/lib/libxerces-c1_7_0.so...done.
Reading symbols from /usr/lib/libc_r.so.4...done.
Reading symbols from /usr/lib/libstdc++.so.3...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 0x28439009 in _wrap_DOM_Document_getElementsByTagName (cv=0x8492d8c)
at Xerces.C:45754
45754 XSRETURN(argvi);
(gdb) bt
#0 0x28439009 in _wrap_DOM_Document_getElementsByTagName (cv=0x8492d8c)
at Xerces.C:45754
#1 0x80b4df2 in Perl_pp_entersub () at pp_hot.c:2618
#2 0x80ad112 in Perl_runops_standard () at run.c:23
#3 0x805c358 in S_run_body (oldscope=1) at perl.c:1466
#4 0x805c01d in perl_run (my_perl=0x812b030) at perl.c:1393
#5 0x8059050 in main (argc=2, argv=0xbfbff7f8, env=0xbfbff804)
at perlmain.c:52
#6 0x8058f29 in _start ()
Current language: auto; currently c++
(gdb) print argvi
$1 = 1
any suggestions as to what my be going wrong here? here's the
implementation from Xerces.C
XS(_wrap_DOM_Document_getElementsByTagName) {
DOM_Document *arg1 ;
DOMString *arg2 ;
SwigValueWrapper<DOM_NodeList> result;
DOMString temp2 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2))
croak("Usage: DOM_Document_getElementsByTagName(self,tagname);");
{
if (SWIG_ConvertPtr(ST(0), (void **) &arg1,
SWIGTYPE_p_DOM_Document) < 0) {
croak("Type error in argument 1 of
DOM_Document_getElementsByTagName. Expected %s",
SWIGTYPE_p_DOM_Document->name);
}
}
{
if (SvPOK(ST(1))||SvIOK(ST(1))||SvNOK(ST(1))) {
STRLEN length;
char *ptr = (char *)SvPV(ST(1),length);
if (DEBUG_UTF8_IN) {
printf("Perl in length = %d: ",length);
for (unsigned int i=0;i<length;i++){
printf("<0x%.4X>",ptr[i]);
}
printf("\n");
}
XMLCh* temp_XMLCh;
if (SvUTF8(ST(1))) {
unsigned int charsEaten = 0;
unsigned char* sizes = new unsigned char[length+1];
temp_XMLCh = new XMLCh[length+1];
unsigned int chars_stored =
UTF8_TRANSCODER->transcodeFrom((const XMLByte*) ptr,
(unsigned int) length,
(XMLCh*) temp_XMLCh,
(unsigned int) length,
charsEaten,
(unsigned char*)sizes
);
delete [] sizes;
if (DEBUG_UTF8_IN) {
printf("Xerces in length = %d: ",chars_stored);
for (unsigned int i=0;i<chars_stored;i++){
printf("<0x%.4X>",temp_XMLCh[i]);
}
printf("\n");
}
// indicate the end of the string
temp_XMLCh[chars_stored] = '\0';
temp2 = DOMString(temp_XMLCh,chars_stored);
delete [] temp_XMLCh;
}else {
temp_XMLCh = XMLString::transcode(ptr);
if (DEBUG_UTF8_IN) {
printf("Xerces: ");
for (int i=0;temp_XMLCh[i];i++){
printf("<0x%.4X>",temp_XMLCh[i]);
}
printf("\n");
}
temp2 = DOMString(temp_XMLCh);
delete [] temp_XMLCh;
}
arg2 = &temp2;
}else if(SWIG_ConvertPtr(ST(1),(void
**) &arg2,SWIGTYPE_p_DOMString)) {
croak("Type error in argument 2 of $name, Expected perl-string
or DOMString.");
XSRETURN(1);
}
}
{
try {
result = ((DOM_Document const
*)arg1)->getElementsByTagName((DOMString const &)*arg2);
}
catch (const XMLException& e)
{
char *class_name = "XML::Xerces::XMLException";
HV *hash = newHV();
HV *stash = gv_stashpv(class_name, FALSE);
SV *tmpsv;
hv_magic(hash,
(GV *)sv_setref_pv(sv_newmortal(),
class_name, (void *)&e),
'P');
tmpsv = sv_bless(newRV_noinc((SV *)hash), stash);
SV *error = ERRSV;
SvSetSV(error,tmpsv);
(void)SvUPGRADE(error, SVt_PV);
Perl_die(Nullch);
}
catch (const DOM_DOMException& e)
{
char *class_name = "XML::Xerces::DOM_DOMException";
HV *hash = newHV();
HV *stash = gv_stashpv(class_name, FALSE);
SV *tmpsv;
hv_magic(hash,
(GV *)sv_setref_pv(sv_newmortal(),
class_name, (void *)&e),
'P');
tmpsv = sv_bless(newRV_noinc((SV *)hash), stash);
SV *error = ERRSV;
SvSetSV(error,tmpsv);
(void)SvUPGRADE(error, SVt_PV);
Perl_die(Nullch);
}
catch (...)
{
XMLPlatformUtils::Terminate();
croak("%s", "Handling Unknown exception");
}
}
{
DOM_NodeList * resultobj = new DOM_NodeList (result);
ST(argvi) = sv_newmortal();
SWIG_MakePtr(ST(argvi++), (void *) resultobj,
SWIGTYPE_p_DOM_NodeList);
}
XSRETURN(argvi);
}
tnx for any help you can provide
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]