This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: MIPS support for libjava (version 2).
Andrew Haley wrote:
Sure. It would help me if you could post the disassembly of the code
and the ouput of 'readelf --debug=F' for the method.
Andrew.
The same problem exists in c++, so I am using a c++ test program to
debug as it is easier for me to debug (It is difficult for me to debug
multithreaded programs which covers all java programs).
Attached are various forms of catcher3fa. catcherf3a.s is generated by
g++, catcherf3a.s.corrected is the same file patched by hand by me so
that it works.
[daney@dl proton]$ mipsel-linux-as -o catcherf3a.o catcherf3a.s
[daney@dl proton]$ mipsel-linux-readelf --debug-dump=frames catcherf3a.o
The section .eh_frame contains:
00000000 00000018 00000000 CIE
Version: 1
Augmentation: "zPR"
Code alignment factor: 1
Data alignment factor: 4
Return address column: 64
Augmentation data: 9b 00 00 00 00 1b
DW_CFA_def_cfa: r29 ofs 0
DW_CFA_nop
DW_CFA_nop
0000001c 0000001c 00000020 FDE cie=00000000 pc=00000024..00000068
DW_CFA_advance_loc: 20 to 00000038
DW_CFA_def_cfa_offset: 24
DW_CFA_advance_loc: 8 to 00000040
DW_CFA_offset_extended_sf: r28 at cfa-8
DW_CFA_offset_extended_sf: r30 at cfa-4
DW_CFA_advance_loc: 4 to 00000044
DW_CFA_def_cfa: r30 ofs 24
DW_CFA_nop
[daney@dl proton]$ mipsel-linux-as -o catcherf3a.o.corrected
catcherf3a.s.corrected
[daney@dl proton]$ mipsel-linux-readelf --debug-dump=frames
catcherf3a.o.corrected
The section .eh_frame contains:
00000000 00000018 00000000 CIE
Version: 1
Augmentation: "zPR"
Code alignment factor: 1
Data alignment factor: 4
Return address column: 64
Augmentation data: 9b 00 00 00 00 1b
DW_CFA_def_cfa: r29 ofs 0
DW_CFA_nop
DW_CFA_nop
0000001c 00000020 00000020 FDE cie=00000000 pc=00000024..00000068
DW_CFA_advance_loc: 20 to 00000038
DW_CFA_def_cfa_offset: 24
DW_CFA_advance_loc: 8 to 00000040
DW_CFA_offset_extended_sf: r28 at cfa-8
DW_CFA_offset_extended_sf: r30 at cfa-4
DW_CFA_register: r64 in r31
DW_CFA_advance_loc: 4 to 00000044
DW_CFA_def_cfa: r30 ofs 24
DW_CFA_nop
DW_CFA_nop
#include <stdio.h>
#include "catcher.h"
char
f3a(char *arg)
{
char c = *arg;
return c;
}
.file 1 "catcherf3a.cc"
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl _Z3f3aPc
.ent _Z3f3aPc
.type _Z3f3aPc, @function
_Z3f3aPc:
$LFB3:
.frame $fp,24,$31 # vars= 8, regs= 2/0, args= 0, extra= 8
.mask 0x50000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set reorder
subu $sp,$sp,24
.cprestore 0
$LCFI0:
sw $fp,20($sp)
$LCFI1:
sw $28,16($sp)
$LCFI2:
move $fp,$sp
$LCFI3:
sw $4,24($fp)
lw $2,24($fp)
lbu $2,0($2)
sb $2,8($fp)
lb $2,8($fp)
move $sp,$fp
lw $fp,20($sp)
addu $sp,$sp,24
j $31
$LFE3:
.end _Z3f3aPc
.section .eh_frame,"a",@progbits
$Lframe1:
.4byte $LECIE1-$LSCIE1
$LSCIE1:
.4byte 0x0
.byte 0x1
.ascii "zPR\000"
.uleb128 0x1
.sleb128 4
.byte 0x40
.uleb128 0x6
.byte 0x9b
.4byte DW.ref.__gxx_personality_v0-.
.byte 0x1b
.byte 0xc
.uleb128 0x1d
.uleb128 0x0
.align 2
$LECIE1:
$LSFDE1:
.4byte $LEFDE1-$LASFDE1
$LASFDE1:
.4byte $LASFDE1-$Lframe1
.4byte $LFB3-.
.4byte $LFE3-$LFB3
.uleb128 0x0
.byte 0x4
.4byte $LCFI0-$LFB3
.byte 0xe
.uleb128 0x18
.byte 0x4
.4byte $LCFI2-$LCFI0
.byte 0x11
.uleb128 0x1c
.sleb128 -2
.byte 0x11
.uleb128 0x1e
.sleb128 -1
.byte 0x4
.4byte $LCFI3-$LCFI2
.byte 0xc
.uleb128 0x1e
.uleb128 0x18
.align 2
$LEFDE1:
.align 0
.hidden DW.ref.__gxx_personality_v0
.weak DW.ref.__gxx_personality_v0
.section .gnu.linkonce.d.DW.ref.__gxx_personality_v0,"aw",@progbits
.align 2
.type DW.ref.__gxx_personality_v0, @object
.size DW.ref.__gxx_personality_v0, 4
DW.ref.__gxx_personality_v0:
.word __gxx_personality_v0
.ident "GCC: (GNU) 3.3.1"
.file 1 "catcherf3a.cc"
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl _Z3f3aPc
.ent _Z3f3aPc
.type _Z3f3aPc, @function
_Z3f3aPc:
$LFB3:
.frame $fp,24,$31 # vars= 8, regs= 2/0, args= 0, extra= 8
.mask 0x50000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set reorder
subu $sp,$sp,24
.cprestore 0
$LCFI0:
sw $fp,20($sp)
$LCFI1:
sw $28,16($sp)
$LCFI2:
move $fp,$sp
$LCFI3:
sw $4,24($fp)
lw $2,24($fp)
lbu $2,0($2)
sb $2,8($fp)
lb $2,8($fp)
move $sp,$fp
lw $fp,20($sp)
addu $sp,$sp,24
j $31
$LFE3:
.end _Z3f3aPc
.section .eh_frame,"a",@progbits
$Lframe1:
.4byte $LECIE1-$LSCIE1
$LSCIE1:
.4byte 0x0
.byte 0x1
.ascii "zPR\000"
.uleb128 0x1
.sleb128 4
.byte 0x40
.uleb128 0x6
.byte 0x9b
.4byte DW.ref.__gxx_personality_v0-.
.byte 0x1b
.byte 0xc
.uleb128 0x1d
.uleb128 0x0
.align 2
$LECIE1:
$LSFDE1:
.4byte $LEFDE1-$LASFDE1
$LASFDE1:
.4byte $LASFDE1-$Lframe1
.4byte $LFB3-.
.4byte $LFE3-$LFB3
.uleb128 0x0
.byte 0x4
.4byte $LCFI0-$LFB3
.byte 0xe
.uleb128 0x18
.byte 0x4
.4byte $LCFI2-$LCFI0
.byte 0x11
.uleb128 0x1c
.sleb128 -2
.byte 0x11
.uleb128 0x1e
.sleb128 -1
.byte 0x9
.uleb128 0x40
.uleb128 0x1f
.byte 0x4
.4byte $LCFI3-$LCFI2
.byte 0xc
.uleb128 0x1e
.uleb128 0x18
.align 2
$LEFDE1:
.align 0
.hidden DW.ref.__gxx_personality_v0
.weak DW.ref.__gxx_personality_v0
.section .gnu.linkonce.d.DW.ref.__gxx_personality_v0,"aw",@progbits
.align 2
.type DW.ref.__gxx_personality_v0, @object
.size DW.ref.__gxx_personality_v0, 4
DW.ref.__gxx_personality_v0:
.word __gxx_personality_v0
.ident "GCC: (GNU) 3.3.1"