(OK) 编译cBPM—CentOS7—gdb—gdbserver—成功—调试

博观而约取,厚积而薄发。这篇文章主要讲述(OK) 编译cBPM—CentOS7—gdb—gdbserver—成功—调试相关的知识,希望能为你提供帮助。
+++++++++++++编译Criteria.Tools.Executor————成功———调试


[root@localhost gdbserver]# pwd
/opt/android-on-linux/android-ndk-r8e/prebuilt/android-arm/gdbserver
[root@localhost gdbserver]# ls
gdbserver
[root@localhost gdbserver]# adb push gdbserver /data/data/criteria


[root@localhost lib]# pwd
/opt/cBPM-android/criteria-lin/lib
[root@localhost lib]# adb push executer /data/data/criteria




----------------------OK---------------------手机:


root@mb526:/ $ getprop |grep ip
[dhcp.wlan0.ipaddress]: [192.168.0.101]


root@mb526:/ # export WF_HOME=/data/data/criteria; export CRITERIA_HOME=/data/data/criteria
root@mb526:/ # cd /data/data/criteria
root@mb526:/data/data/criteria # ./gdbserver 192.168.0.100:1234 ./executer      (192.168.0.100是宿主机IP)




----------------------OK---------------------手机:


shell@mb526:/ $


getprop |grep ip


[dhcp.wlan0.ipaddress]: [192.168.0.101]


export WF_HOME=/data/data/criteria; export CRITERIA_HOME=/data/data/criteria
cd /data/data/criteria
./gdbserver 192.168.0.100:1234 ./executer


      (192.168.0.100是宿主机IP)


----------------------OK---------------------宿主机(命令行):


[root@localhost Tools.Executor]# pwd
/opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor


[root@localhost Tools.Executor]# ls
database notepad.txt  temp  TestNotePad.xml executer  Executor-3739-20150407-100423.trace src temp.c  




------------------------------------------------------------------------这段不用
[root@localhost Tools.Executor]# export PATH=$PATH:/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/
使用上面有问题:
readchar: Got EOF
Remote side has terminated connection. GDBserver will reopen the connection.


------------------------------------------------------------------------将配置文件复制到 手机
[root@localhost lib]# pwd
/opt/cBPM-android/criteria-lin/lib
[root@localhost lib]# ls
executer
[root@localhost lib]# adb push executer /data/data/criteria/


[root@localhost Tools.Executor]# ls
database  executer  notepad.txt  src  temp  temp.c  TestNotePad.xml
[root@localhost Tools.Executor]# pwd
/opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor
[root@localhost Tools.Executor]# adb push database/ /data/data/criteria/database


------------------------------------------------------------------------




------------------------------------------------------------------------使用这段
使用下面可以:
[root@localhost Tools.Executor]# export PATH=$PATH:/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/


------------------------------------------------------------------------
gdb调试的时候如何带参数
1,gdb --args ./A V1 V2 V3
2,gdb ./A,进入gdb后  r V1 V2 V3
3,gdb ./A,进入gdb后  设置参数set args V1 V2 V3 再直接 r
------------------------------------------------------------------------




------------------------------------------------------------------------宿主机(命令行):
[root@localhost Tools.Executor]# arm-linux-androideabi-gdb executer


(gdb)


target extended-remote 192.168.0.104:1234


//192.168.0.101是手机IP
//target remote 192.168.0.101:1234


//break main.cpp:63
//break main.cpp:155
//break WAPI.cpp:72
//break bOSXMLHelper.cpp:40


//break PlatformUtils.hpp:813
//break MemoryManagerImpl.cpp:37
//break WorkflowListener.cpp:67


//break XMLString.hpp:1451
//break Hashers.hpp:47


//break RangeToken.cpp:335


//break XMLRangeFactory.cpp:113


//break XMLInitializer.cpp:51
//break XMLInitializer.cpp:62                  // 调试到此处,停止
//break XMLInitializer.cpp:61                  // 所以,进入到initializeDatatypeValidatorFactory()单步跟踪,使用s,不要用n


break IconvTransService.cpp:432            //找到了故障点(在这一行的)。
break IconvTransService.cpp:460            //估计是内存分配问题,比如 溢出


set debug remote 1
set args TestNotePad


r
c
s
n


info break
delete  breakpoint-number
backtrace


monitor exit                  //terminate gdbserver


------------------------------------------------------------------------调试到此处,停止,并且 手机重启


(gdb) bt
#0  xercesc_3_1::RangeToken::doCreateMap (this=0x5bece8) at xercesc/util/regx/RangeToken.cpp:852
#1  0x00327af4 in xercesc_3_1::RangeToken::createMap (this=0x5bece8) at ./xercesc/util/regx/RangeToken.hpp:130
#2  0x00331f84 in xercesc_3_1::XMLRangeFactory::buildRanges (this=0x5bd338, rangeTokMap=0x5ba2c8) at xercesc/util/regx/XMLRangeFactory.cpp:113
#3  0x0031f4c4 in xercesc_3_1::RangeTokenMap::buildTokenRanges (this=0x5ba2c8) at xercesc/util/regx/RangeTokenMap.cpp:247
#4  0x0031e8d8 in xercesc_3_1::XMLInitializer::initializeRangeTokenMap () at xercesc/util/regx/RangeTokenMap.cpp:49


#5  0x00219aac in xercesc_3_1::XMLInitializer::initializeStaticData () at xercesc/util/XMLInitializer.cpp:51


#6  0x0020ddac in xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0,
      panicHandler=0x0, memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:307
#7  0x001534ac in bOS::XML::XMLHelper::initialize () at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp:40
#8  0x0000ec88 in InitSessionWithParams (acConfigFile=0x5b64b8 "/data/data/criteria/database/Criteria.xml", response=0x5b3b20)
      at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp:72
#9  0x0000e948 in InitSession (response=0x5b3b20) at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp:63
#10 0x0000b34c in main (argc=2, argv=0xbeb2fa34)
      at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Tools/Criteria.Tools.Executor/src/main.cpp:63




break XMLInitializer.cpp:61            // 所以,进入到initializeDatatypeValidatorFactory()单步跟踪,使用s,不要用n


#2  0x002aaf1c in xercesc_3_1::DatatypeValidatorFactory::expandRegistryToFullSchemaSet (this=0x5e3870)
      at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:180
#3  0x002aaca8 in xercesc_3_1::XMLInitializer::initializeDatatypeValidatorFactory () at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:135


break DatatypeValidatorFactory.cpp:180
break DatatypeValidatorFactory.cpp:281
break DatatypeValidatorFactory.cpp:315            // 到此处,手机死机
break DatatypeValidatorFactory.cpp:311            // 所以,单步跟踪
break DatatypeValidatorFactory.hpp:250            // 到此处,手机死机
break DatatypeValidatorFactory.hpp:246            // 所以,单步跟踪


#0  xercesc_3_1::RefHashTableOfEnumerator< xercesc_3_1::KVStringPair, xercesc_3_1::StringHasher> ::~RefHashTableOfEnumerator (this=0xbed963e4,
      __in_chrg=< optimized out> ) at ./xercesc/util/RefHashTableOf.c:554
#1  0x003989d4 in xercesc_3_1::AbstractStringValidator::assignFacet (this=0x5e4a30, manager=0x5b6c98)
      at xercesc/validators/datatype/AbstractStringValidator.cpp:221
#3  0x002bcaa0 in xercesc_3_1::StringDatatypeValidator::StringDatatypeValidator (this=0x5e4a30, baseValidator=0x5e3928, facets=0x5e4988, enums=0x0,
      finalSet=0, manager=0x5b6c98) at xercesc/validators/datatype/StringDatatypeValidator.cpp:50


break AbstractStringValidator.cpp:221            // 所以,单步跟踪
break StringDatatypeValidator.cpp:50


#0  xercesc_3_1::StringDatatypeValidator::StringDatatypeValidator (this=0x5e4a30, baseValidator=0x5e3928, facets=0x5e4988, enums=0x0, finalSet=0,
      manager=0x5b6c98) at xercesc/validators/datatype/StringDatatypeValidator.cpp:51
#1  0x002bcbbc in xercesc_3_1::StringDatatypeValidator::newInstance (this=0x5e3928, facets=0x5e4988, enums=0x0, finalSet=0, manager=0x5b6c98)
      at xercesc/validators/datatype/StringDatatypeValidator.cpp:64
#2  0x002add30 in xercesc_3_1::DatatypeValidatorFactory::createDatatypeValidator (this=0x5e3870,
      typeName=0x4da7b4 < xercesc_3_1::SchemaSymbols::fgDT_NORMALIZEDSTRING> , baseValidator=0x5e3928, facets=0x5e4988, enums=0x0,
      isDerivedByList=false, finalSet=0, isUserDefined=false, userManager=0x5b6c98) at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:678




break DatatypeValidatorFactory.cpp:678


Breakpoint 2, xercesc_3_1::DatatypeValidatorFactory::expandRegistryToFullSchemaSet (this=0x5e3870)
      at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:312
312                                                            getDatatypeValidator(XMLUni::fgNmTokenString), facets, 0, true, 0, false);


(gdb) break DatatypeValidatorFactory.cpp:312
(gdb) s
(gdb) n
(gdb)


      manager=0x5b6c98) at xercesc/validators/datatype/ListDatatypeValidator.cpp:58
58            if (!baseValidator)


(gdb) break ListDatatypeValidator.cpp:58
(gdb) break ListDatatypeValidator.cpp:61
(gdb) s
(gdb) n


(gdb) break AbstractStringValidator.cpp:152
(gdb) s


xercesc_3_1::XMLString::parseInt (toConvert=0x5e52c0, manager=0x5b6c98) at xercesc/util/XMLString.cpp:1449
1449            XMLSize_t trimmedStrLen = XMLString::stringLen(trimmedStr);


xercesc_3_1::IconvLCPTranscoder::transcode (this=0x5b7d20, toTranscode=0x5e52d0, manager=0x5b6c98)
      at xercesc/util/Transcoders/Iconv/IconvTransService.cpp:432
432            while (toTranscode[srcCursor] || src)


(gdb) break IconvTransService.cpp:432                  //找到了故障点。
(gdb) s








^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


--------------------------------下面是宿主机(命令行) 执行 r  s  n    c    的过程,目的是找到 故障点,太费时间,所以 结合 backtrace 查找 故障点
Breakpoint 4, bOS::XML::XMLHelper::initialize () at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp:40
40                  xercesc_3_1::XMLPlatformUtils::Initialize();
(gdb)


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:166
166     


xercesc_3_1::MemoryManagerImpl::MemoryManagerImpl (this=0x5b6c98) at ./xercesc/internal/MemoryManagerImpl.hpp:48
48            MemoryManagerImpl()


xercesc_3_1::MemoryManager::MemoryManager (this=0x5b6c98) at ./xercesc/framework/MemoryManager.hpp:108
108            MemoryManager()


xercesc_3_1::MemoryManagerImpl::MemoryManagerImpl (this=0x5b6c98) at ./xercesc/internal/MemoryManagerImpl.hpp:50
50           


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:208
208            if (!panicHandler)


xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:34
34     


xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813
813            XMLSize_t current = ptrSize % alignment;


xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:41
41                    );


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37
37     


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46
46            if(memptr==NULL & & size!=0)


xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:42
42            *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager;


xercesc_3_1::DefaultPanicHandler::DefaultPanicHandler (this=0x5b6cb0) at ./xercesc/util/DefaultPanicHandler.hpp:46
46            DefaultPanicHandler();


xercesc_3_1::XMemory::XMemory (this=0x5b6cb0) at ./xercesc/util/XMemory.hpp:132
132           


xercesc_3_1::PanicHandler::PanicHandler (this=0x5b6cb0) at ./xercesc/util/PanicHandler.hpp:70
70            PanicHandler();


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:223
223            endianTest.ch = 1;


xercesc_3_1::XMLPlatformUtils::makeMutexMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:725
725            XMLMutexMgr* mgr = NULL;


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:63
63            assert(manager != 0);


xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813
813            XMLSize_t current = ptrSize % alignment;


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:68
68            void* const block = manager-> allocate(headerSize + size);


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37
37     


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46
46            if(memptr==NULL & & size!=0)


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:69
69            *(MemoryManager**)block = manager;


xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:44
44      PosixMutexMgr::PosixMutexMgr()


xercesc_3_1::XMLMutexMgr::XMLMutexMgr (this=0x5b6cc0) at ./xercesc/util/XMLMutexMgr.hpp:36
36                    XMLMutexMgr()


xercesc_3_1::XMemory::XMemory (this=0x5b6cc0) at ./xercesc/util/XMemory.hpp:132
132           


xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:46
46     


xercesc_3_1::XMLPlatformUtils::makeMutexMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:737
737            return mgr;


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:249
249            fgFileMgr            = makeFileMgr(fgMemoryManager);


xercesc_3_1::XMLPlatformUtils::makeFileMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:504
504            XMLFileMgr* mgr = NULL;


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:63
63            assert(manager != 0);


xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813
813            XMLSize_t current = ptrSize % alignment;


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37
37     


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46
46            if(memptr==NULL & & size!=0)


xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:42
42            *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager;


xercesc_3_1::DefaultPanicHandler::DefaultPanicHandler (this=0x5b6cb0) at ./xercesc/util/DefaultPanicHandler.hpp:46
46            DefaultPanicHandler();


xercesc_3_1::XMemory::XMemory (this=0x5b6cb0) at ./xercesc/util/XMemory.hpp:132
132           


xercesc_3_1::PanicHandler::PanicHandler (this=0x5b6cb0) at ./xercesc/util/PanicHandler.hpp:70
70            PanicHandler();


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:223
223            endianTest.ch = 1;


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:63
63            assert(manager != 0);


Breakpoint 1, xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813
813            XMLSize_t current = ptrSize % alignment;


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:68
68            void* const block = manager-> allocate(headerSize + size);


Breakpoint 2, xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37
37     


xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46
46            if(memptr==NULL & & size!=0)


xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:69
69            *(MemoryManager**)block = manager;


xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:44
44      PosixMutexMgr::PosixMutexMgr()


xercesc_3_1::XMLMutexMgr::XMLMutexMgr (this=0x5b6cc0) at ./xercesc/util/XMLMutexMgr.hpp:36
36                    XMLMutexMgr()


xercesc_3_1::XMemory::XMemory (this=0x5b6cc0) at ./xercesc/util/XMemory.hpp:132
132           


xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:46
46     


xercesc_3_1::XMLPlatformUtils::makeMutexMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:737
737            return mgr;


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:249
249            fgFileMgr            = makeFileMgr(fgMemoryManager);


xercesc_3_1::XMLPlatformUtils::makeFileMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:504
504            XMLFileMgr* mgr = NULL;


...


循环 1065行


xercesc_3_1::PosixMutexWrap::PosixMutexWrap (this=0x5b6cf8) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:38
38      class PosixMutexWrap : public XMemory


xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 < xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,
      memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:269
269            XMLInitializer::initializeTransService(); // TransService static data.


xercesc_3_1::RefHashTableOf< xercesc_3_1::ENameMap, xercesc_3_1::StringHasher> ::put (this=0x5b6d30,
      key=0x4ccf90 < xercesc_3_1::XMLUni::fgXMLChEncodingString> , valueToAdopt=0x5b6f90) at ./xercesc/util/RefHashTableOf.c:412
412            if (newBucket)


      key=0x4ccde0 < xercesc_3_1::XMLUni::fgUSASCIIEncodingString> , hashVal=@0xbed324ec: 2180388) at ./xercesc/util/RefHashTableOf.c:492
492            hashVal = fHasher.getHashVal(key, fHashModulus);


      key=0x4cce10 < xercesc_3_1::XMLUni::fgUSASCIIEncodingString4> , hashVal=@0xbed324ec: 93) at ./xercesc/util/RefHashTableOf.c:495
495            RefHashTableBucketElem< TVal> * curElem = fBucketList[hashVal];


xercesc_3_1::StringHasher::getHashVal (this=0x5b6d48, key=0x4cce24 < xercesc_3_1::XMLUni::fgUTF8EncodingString> , mod=103)
      at ./xercesc/util/Hashers.hpp:47
47       


xercesc_3_1::XMLTransService::initTransService (this=0x5b6f48) at xercesc/util/TransService.cpp:227
227            gMappings-> put((void*)XMLUni::fgUSASCIIEncodingString, new ENameMapFor< XMLASCIITranscoder> (XMLUni::fgUSASCIIEncodingString));


xercesc_3_1::XMemory::operator new (size=8) at xercesc/util/XMemory.cpp:41
41                    );


xercesc_3_1::XMLString::hash (tohash=0x4cce04 < xercesc_3_1::XMLUni::fgUSASCIIEncodingString3> , hashModulus=103) at ./xercesc/util/XMLString.hpp:1588
1588            if (tohash == 0 || *tohash == 0)


      encodingName=0x4ccb48 < xercesc_3_1::XMLUni::fgISO88591EncodingString> ) at ./xercesc/util/TransENameMap.c:32
32      ENameMapFor< TType> ::ENameMapFor(const XMLCh* const encodingName) :


xercesc_3_1::ENameMap::ENameMap (this=0x5b7198, encodingName=0x4ccb48 < xercesc_3_1::XMLUni::fgISO88591EncodingString> )
      at ./xercesc/util/TransENameMap.hpp:75


xercesc_3_1::XMLString::stringLen (src=https://www.songbingjia.com/android/0x4ccbbc < xercesc_3_1::XMLUni::fgISO88591EncodingString7> ) at ./xercesc/util/XMLString.hpp:1451
1451            if (src =https://www.songbingjia.com/android/= 0)


      encodingName=0x4ccbcc < xercesc_3_1::XMLUni::fgISO88591EncodingString8> ) at ./xercesc/util/TransENameMap.c:36
36     


xercesc_3_1::RangeToken::addRange (this=0x5c2fc8, start=6155, end=6467) at xercesc/util/regx/RangeToken.cpp:335
335            fCaseIToken = 0;








Sending packet: $X98ff0,4:?\\001??#27...Packet received: OK
Sending packet: $QPassSignals:e; 10; 14; 17; 1a; 1b; 1c; 21; 24; 25; 2c; 4c; #5f...Packet received: OK
Sending packet: $vCont; c:pc6b.-1#d9...


Sending packet: $m2abd08,4#8e...Packet received: 1c00a0e3
Sending packet: $X2abd08,4:?\\001??#7b...Packet received: OK
Sending packet: $vCont; c:pcdf.-1#0b...


------调试到此处,停止,并且 手机重启


--------------------------------上面是 执行 r  s  n    c    的过程,目的是找到 故障点,太费时间,所以 结合 backtrace 查找 故障点










------------------------------------------------------------------------
/opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp


xercesc_3_1::XMLPlatformUtils::Initialize();       //程序至步于此,并且手机自动重启,说明xercesc_3_1有问题


include/bOS/xercesc/util/PlatformUtils.cpp
include/bOS/xercesc/util/XercesDefs.hpp:      #define XERCES_CPP_NAMESPACE_BEGIN namespace XERCES_CPP_NAMESPACE
--------------------将下面两个文件中xercesc_3_1替换为xercesc_3_0
[root@localhost criteria-lin]# pwd
/opt/cBPM-android/criteria-lin


./src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp
./include/bOS/bOSXMLHelper.h


--------------------编译xercesc_3_0静态库——以下 不看,不用了
编译xerces-c (静态库)—CentOS 7— android-ndk


[root@localhost xerces-c-3.0.0]# pwd
/opt/cBPM-android/xerces-c-3.0.0
[root@localhost xerces-c-3.0.0]# make clean


export XERCES="/opt/cBPM-android/xerces-c-3.0.0/"
export NDK_ROOT="/opt/android-on-linux/android-ndk-r8e"
export SYSROOT="$NDK_ROOT/platforms/android-14/arch-arm"
export CFLAGS="--pipe --sysroot=$SYSROOT -I$NDK_ROOT/sources/cxx-stl/stlport/stlport -I$NDK_ROOT/platforms/android-14/arch-arm/usr/include -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/include -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include-fixed -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L$SYSROOT/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/cBPM-android/criteria-lin/lib -lstlport_static -lgcc -lc"
export CPATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/arm-linux-androideabi-cpp"
export CXX="$CPATH/arm-linux-androideabi-g++"
export CC="$CPATH/arm-linux-androideabi-gcc"
export LD="$CPATH/arm-linux-androideabi-ld"
export AR="$CPATH/arm-linux-androideabi-ar"


[root@localhost xerces-c-3.0.0]# ac_cv_func_iconv_open=yes ac_cv_func_iconv_close=yes ac_cv_func_mblen=yes ac_cv_func_wcstombs=yes ac_cv_func_mbstowcs=yes ac_cv_func_iconv=yes ./configure --host="arm-linux-eabi" --enable-static --disable-shared --enable-transcoder-iconv


[root@localhost xerces-c-3.0.0]# make -j5
[root@localhost xerces-c-3.0.0]# cp ./src/.libs/libxerces-c.a /opt/cBPM-android/criteria-lin/lib


至此,成功编译 xerces-c-3.0.0 静态库


---------------------------------
xercesc/util/XMLAbstractDoubleFloat.cpp:431:27: error: struct lconv has no member named decimal_point
[root@localhost xerces-c-3.0.0]# gedit ./src/xercesc/util/XMLAbstractDoubleFloat.cpp


//      lconv* lc = localeconv();
//      char delimiter = *lc-> decimal_point;


      char delimiter = .;             //把localeconv()调用给绕过去了


保存,重新编译xerces-c (静态库)
---------------------------------
/usr/include/curl/curlbuild.h:1:27: fatal error: bits/wordsize.h: No such file or directory
/usr/include/curl/curlbuild.h:4:26: fatal error: curlbuild-32.h: No such file or directory


[root@localhost xerces-c-3.0.0]# find /usr/include/ -name wordsize.h
/usr/include/bits/wordsize.h


yum install libcurl-devel.i686


--------------------编译xercesc_3_0静态库——以上 不看,不用了




------------------------------------------------------------------------


[root@localhost lib]# /opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb


(gdb) file executer


进行调试                         
(gdb) list    or l
(gdb) break func
(gdb) break 22
(gdb) info br   
(gdb) continue    or c      // 这里不能用 run
(gdb) next    or n
(gdb) print or p      result  
(gdb) finish              // 跳出func函数
(gdb) next
(gdb) quit
建立连接后进行gdb远程调试和gdb本地调试方法相同
【(OK) 编译cBPM—CentOS7—gdb—gdbserver—成功—调试】


    推荐阅读