2011-07-21 7 views
6

मेरे पास एम्बेडेड SH3 linux डिवाइस से core फ़ाइल है, और मेरे होस्ट लिनक्स में क्रॉस कंपाइलर वातावरण (sh3-linux-gdb) का gdb है।crosstarget मशीन से कोर फ़ाइल की जांच करने के लिए क्रॉस जीडीबी का उपयोग कैसे करें

$ sh3-linux-gdb ./myprogram ./core 
GNU gdb 6.3 
Copyright 2004 Free Software Foundation, Inc. 
... 
This GDB was configured as "--host=i386-pc-linux-gnu --target=sh3-linux"... 
GDB can't read core files on this machine. 
(gdb) 

यह मूल फ़ाइल क्यों नहीं पढ़ सकते हैं:

लेकिन मैं gdb के साथ मुख्य फ़ाइल लोड करने में समस्या है? क्या लक्ष्य प्रणाली से क्रॉस जीडीबी तक कोर फ़ाइल पढ़ने का कोई तरीका है?

लक्ष्य मशीन (SH3-linux) में gdbserver है, लेकिन gdb स्वयं नहीं है। मैं gdbserver और sh3-linux-gdb के साथ लक्ष्य मशीन की प्रक्रियाओं के रनटाइम डीबगिंग करने में सक्षम हूं, इसलिए sh3-linux-gdb सही ढंग से संकलित किया जाना चाहिए।

संपादित करें: readelf डंप अनुरोध किया गया था:

[build]$ sh3-linux-readelf -a core 
ELF Header: 
    Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
    Class:        ELF32 
    Data:        2's complement, little endian 
    Version:       1 (current) 
    OS/ABI:       UNIX - System V 
    ABI Version:      0 
    Type:        CORE (Core file) 
    Machine:       Renesas/SuperH SH 
    Version:       0x1 
    Entry point address:    0x0 
    Start of program headers:   52 (bytes into file) 
    Start of section headers:   0 (bytes into file) 
    Flags:        0x0 
    Size of this header:    52 (bytes) 
    Size of program headers:   32 (bytes) 
    Number of program headers:   51 
    Size of section headers:   0 (bytes) 
    Number of section headers:   0 
    Section header string table index: 0 

There are no sections in this file. 

There are no sections in this file. 

Program Headers: 
    Type   Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align 
    NOTE   0x000694 0x00000000 0x00000000 0x00200 0x00000  0 
    LOAD   0x001000 0x00400000 0x00000000 0x00000 0x01000 R E 0x1000 
    ----- several boring lines removed ----- 
    LOAD   0x05a000 0x29952000 0x00000000 0x01000 0x01000 RW 0x1000 
    LOAD   0x05b000 0x7be48000 0x00000000 0x15000 0x15000 RWE 0x1000 

There is no dynamic section in this file. 

There are no relocations in this file. 

There are no unwind sections in this file. 

No version information found in this file. 

Notes at offset 0x00000694 with length 0x00000200: 
    Owner   Data size  Description 
    CORE   0x000000a8  NT_PRSTATUS (prstatus structure) 
    CORE   0x0000007c  NT_PRPSINFO (prpsinfo structure) 
    CORE   0x000000a0  NT_AUXV (auxiliary vector) 
[build]$ 

EDIT2: के साथ भी यही समस्या --core विकल्प:

$ sh3-linux-gdb ./myprogram --core=./core 
GNU gdb 6.3 
Copyright 2004 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 "--host=i386-pc-linux-gnu --target=sh3-linux"...RUN GDB INIT 
GDB can't read core files on this machine. 
(gdb) 
+1

इस http://bsdimp.blogspot.com/2007/11/quick- थंबनेल-to-cross-debugging-core.html – osgx

+0

नहीं, यह मदद नहीं करता है। Solib-absolute-prefix चाल के साथ एक ही समस्या होती है। – SKi

+0

क्या आप आउटपुट या 'रीडल्फ-कोर' पोस्ट कर सकते हैं? – osgx

उत्तर

-1

यह आपके आवेदन डिबग करने के लिए संभव है gdb के साथ सीधे नहीं लेकिन जीडीबी सर्वर के साथ। पहली बात करना है लक्ष्य प्रणाली में gdbserver कॉल करने के लिए है (यदि आप अपने सवाल में कहा कि इस पैकेज के पहले से स्थापित है):

gdbserver AAA.BBB.CCC.DDD:port ./myprogram 

यह मान रहा है कि लक्ष्य मशीन एक आईपी पता के लिए सुलभ है: AAA.BBB.CCC.DDD:port। एक बार, तो आप उस किया है, आप लक्ष्य दूरस्थ सर्वर को निर्दिष्ट करके अपनी विकास मशीन में gdb कॉल कर सकते हैं:

% gdb ./myprogram 
    % [...] 
    (gdb) target remote AAA.BBB.CCC.DDD:port 

नोट लक्ष्य दूरस्थ सर्वर आईपी पते gdbserver का एक ही हैं।

+1

यह मेरी समस्या का उत्तर नहीं है। मैं gdbserver का उपयोग कर सकते हैं, यह समस्या नहीं थी। समस्या कोर फ़ाइल खोलना है। – SKi

1

करने के लिए http://forums.freescale.com/t5/68K-ColdFire-reg-Microprocessors/GDB-can-t-read-core-files/td-p/70181

sh3-linux-gdb ./myprogram --core=./core 

यह पुराने gdb http://sourceware.org/bugzilla/show_bug.cgi?id=9542 में एक बग हो सकता अनुसार प्रयास करें - तो (7) भी नए gdb प्रयास करें।

यह भी संभव है कि कोर असमर्थित प्रारूप में डाला गया हो। लक्ष्य का ओएस, संस्करण क्या है?

क्या आप आउटपुट या readelf -a core पोस्ट कर सकते हैं?

+0

लक्ष्य ओएस: लिनक्स संस्करण 2.6.25.9 (जीसीसी संस्करण 3.4.5 20060103 (3.4.5-10.1 ए)) – SKi

+0

--कोर विकल्प मदद नहीं करता है। और बाद में जीडीबी के संस्करण 6.8 में मदद नहीं मिली। पुरानी बग अभी भी खुली प्रतीत होती है। मैं इस जवाब को स्वीकार करने जा रहा हूं, क्योंकि बग सबसे संभावित कारण है। – SKi

+0

यह एक बग नहीं है, यह कोर फ़ाइल प्रारूप और जीडीबी के कोर प्रारूप पार्सर का असमर्थित संयोजन है। जब आप gdbserver का उपयोग कर रहे हैं, तो दूसरा कोड सक्रिय है, और होस्ट gdb द्वारा आवश्यक कोर की कोई पार्सिंग नहीं है। – osgx

संबंधित मुद्दे