This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: Questions about stabs in MIPS executable


Oh, also gcc 2.95.2 and binutils 2.11.2

some of the commandline prameters for gcc -gstabs3 -Wa,--gstabs -save-temps
-Wall

Here is a brief output of gcc keeping the temp files:

	.file	1 "boot.c"
gcc2_compiled.:
__gnu_compiled_c:
.stabs "boot.c",100,0,0,$Ltext0
	.text
$Ltext0:
.stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0
.stabs "char:t2=r2;0;127;",128,0,0,0
.stabs "long int:t3=r3;-2147483648;2147483647;",128,0,0,0
.stabs "unsigned int:t4=r4;0;-1;",128,0,0,0
.stabs "long unsigned int:t5=r5;0;-1;",128,0,0,0
.stabs "long long int:t6=r6;0;-1;",128,0,0,0
.stabs "long long unsigned int:t7=r7;0;-1;",128,0,0,0
.stabs "short int:t8=r8;-32768;32767;",128,0,0,0
.stabs "short unsigned int:t9=r9;0;65535;",128,0,0,0
.stabs "signed char:t10=r10;-128;127;",128,0,0,0
.stabs "unsigned char:t11=r11;0;255;",128,0,0,0
.stabs "float:t12=r1;4;0;",128,0,0,0
.stabs "double:t13=r1;8;0;",128,0,0,0
.stabs "long double:t14=r1;8;0;",128,0,0,0
.stabs "complex int:t15=s8real:1,0,32;imag:1,32,32;;",128,0,0,0
.stabs "complex float:t16=r16;4;0;",128,0,0,0
.stabs "complex double:t17=r17;8;0;",128,0,0,0
.stabs "complex long double:t18=r18;8;0;",128,0,0,0
.stabs "void:t19=19",128,0,0,0
.stabs "size_t:t20=4",128,0,0,0
.stabs "ptrdiff_t:t21=1",128,0,0,0
.stabs "wchar_t:t22=1",128,0,0,0
.stabs "wint_t:t23=4",128,0,0,0
.stabs "bool:t24=1",128,0,0,0
.stabs "cyg_uint8:t25=11",128,0,0,0
.stabs "cyg_int8:t26=10",128,0,0,0
.stabs "cyg_uint16:t27=9",128,0,0,0
.stabs "cyg_int16:t28=8",128,0,0,0
.stabs "cyg_uint32:t29=4",128,0,0,0
.stabs "cyg_int32:t30=1",128,0,0,0
.stabs "cyg_uint64:t31=7",128,0,0,0
.stabs "cyg_int64:t32=6",128,0,0,0
.stabs "cyg_bool:t33=1",128,0,0,0
.stabs "cyg_ucount8:t34=4",128,0,0,0
.stabs "cyg_count8:t35=1",128,0,0,0
.stabs "cyg_ucount16:t36=4",128,0,0,0
.stabs "cyg_count16:t37=1",128,0,0,0
.stabs "cyg_ucount32:t38=4",128,0,0,0
.stabs "cyg_count32:t39=1",128,0,0,0
.stabs "cyg_ucount64:t40=7",128,0,0,0
.stabs "cyg_count64:t41=6",128,0,0,0
.stabs "cyg_atomic:t42=11",128,0,0,0
.stabs "CYG_ATOMIC:t43=11",128,0,0,0
.stabs "CYG_WORD:t44=29",128,0,0,0
.stabs "CYG_BYTE:t45=25",128,0,0,0
.stabs "CYG_WORD16:t46=27",128,0,0,0
.stabs "CYG_WORD32:t47=29",128,0,0,0
.stabs "CYG_WORD64:t48=31",128,0,0,0
.stabs "CYG_ADDRESS:t49=29",128,0,0,0
.stabs "CYG_ADDRWORD:t50=29",128,0,0,0
.stabs "__gnuc_va_list:t51=52=*2",128,0,0,0
.stabs "
:T53=e__no_type_class:-1,__void_type_class:0,__integer_type_class:1,__char_t
ype_class:2,__enumeral_type_class:3,__boolean_type_class:4,__pointer_type_cl
ass:5,__reference_type_class:6,__offset_type_class:7,__real_type_class:8,__c
omplex_type_class:9,__function_type_class:10,__method_type_class:11,__record
_type_class:12,__union_type_class:13,__array_type_class:14,__string_type_cla
ss:15,__set_type_class:16,__file_type_class:17,__lang_type_class:18,;",128,0
,0,0
.stabs "va_list:t54=51",128,0,0,0
.stabs "fpos_t:t55=38",128,0,0,0
.stabs "FILE:t56=57=ar1;0;9998;49",128,0,0,0
.stabs "Cyg_ErrNo:t58=1",128,0,0,0
	.sdata
	.align	2
$LC0:
	.ascii	"%s: %s\n\000"
.stabs "cyg_addrword_t:t59=50",128,0,0,0
.stabs "cyg_handle_t:t60=59",128,0,0,0
.stabs "cyg_priority_t:t61=29",128,0,0,0
.stabs "cyg_code_t:t62=30",128,0,0,0
.stabs "cyg_vector_t:t63=29",128,0,0,0

-----Original Message-----
From: Tim Michals [mailto:Tim.Michals@Cygnetinc.com]
Sent: Wednesday, November 07, 2001 8:17 AM
Cc: ecos-discuss@sources.redhat.com
Subject: [ECOS] Questions about stabs in MIPS executable



All,

I'm working with a MIPS JTAG emulator and eCOS; in order to get source level
debug for the emulator, the elf file has to be processed through a
conversion utility to create a symbols file to be used by the debugger.  I'm
trying to understand how stabs is used for example:

This is the output from mips-elf-readelf of a file that the conversion
utility is successful creating symbols on (as a side point the compiler is a
hacked gcc compiler)

ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x80010040
  Start of program headers:          52 (bytes into file)
  Start of section headers:          7491772 (bytes into file)
  Flags:                             0x1, noreorder, mips1 UNKNOWN
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         2
  Size of section headers:           40 (bytes)
  Number of section headers:         13
  Section header string table index: 10

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk
Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0
0  0
  [ 1] .text             PROGBITS        80010000 010000 1eb540 00  AX  0
0 16
  [ 2] .rodata           PROGBITS        801fb540 1fb540 03aad0 00   A  0
0 16
  [ 3] .reginfo          MIPS_REGINFO    80236010 236010 000018 01   A  0
0  4
  [ 4] .data             PROGBITS        80236030 236030 079570 00  WA  0
0 16
  [ 5] .sdata            PROGBITS        802af5a0 2af5a0 000020 00 WAp  0
0 16
  [ 6] .sbss             NOBITS          802af5c0 2af5c0 00050c 00 WAp  0
0  8
  [ 7] .bss              NOBITS          802afad0 2af5c0 07a860 00  WA  0
0 16
  [ 8] .stab             PROGBITS        00000000 2af5c0 15c834 0c      9
0  4
  [ 9] .stabstr          STRTAB          00000000 40bdf4 31926d 00      0
0  1
  [10] .shstrtab         STRTAB          00000000 725061 000059 00      0
0  1
  [11] .symtab           SYMTAB          00000000 7252c4 028760 10     12
12c5  4
  [12] .strtab           STRTAB          00000000 74da24 01e35f 00      0
0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)


Using the gcc compiler with eCOS:

ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x80000000
  Start of program headers:          52 (bytes into file)
  Start of section headers:          778900 (bytes into file)
  Flags:                             0x10000001, noreorder, mips2 UNKNOWN
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         1
  Size of section headers:           40 (bytes)
  Number of section headers:         16
  Section header string table index: 13

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk
Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0
0  0
  [ 1] .rom_vectors      PROGBITS        80000000 001000 000800 00  AX  0
0  1
  [ 2] .text             PROGBITS        80000800 001800 00b1f0 00  AX  0
0 16
  [ 3] .fini             PROGBITS        8000b9f0 00e990 000000 00   W  0
0  1
  [ 4] .ctors            PROGBITS        8000b9f0 00c9f0 000034 00  WA  0
0  4
  [ 5] .dtors            PROGBITS        8000ba24 00ca24 000024 00  WA  0
0  4
  [ 6] .rodata           PROGBITS        8000ba48 00ca48 000e38 00   A  0
0  8
  [ 7] .rodata1          PROGBITS        8000c880 00e990 000000 00   W  0
0  1
  [ 8] .fixup            PROGBITS        8000c880 00e990 000000 00   W  0
0  1
  [ 9] .gcc_except_table PROGBITS        8000c880 00e990 000000 00   W  0
0  1
  [10] .data             PROGBITS        8000c880 00d880 001110 00  WA  0
0  8
  [11] .bss              NOBITS          8000d990 00e990 808d60 00  WA  0
0 16
  [12] .mdebug           MIPS_DEBUG      00000000 00e990 0af884 01      0
0  4
  [13] .shstrtab         STRTAB          00000000 0be214 00007f 00      0
0  1
  [14] .symtab           SYMTAB          00000000 0be514 0031b0 10     15
109  4
  [15] .strtab           STRTAB          00000000 0c16c4 00265d 00      0
0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)


Notice how a couple of sections are missing (.stabs and .stabstr) So is this
the issue?  Also another clue is if mips-elf-obj -g <file> is used on the
file created by the working gcc it dumps debug information.

Also if the same command on the eCOS compiler mips-elf-obj -g <file>  it
indicates that there is no debug info?  Any clues?


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