Jump to content

    
Sign in to follow this  
Denisyuk

Симуляция MIPS64 в GDB

Recommended Posts

Есть такой код собранный с опциями GCC -mabi=64 -march=mips64:

./build/project.elf:     формат файла elf64-bigmips


Дизассемблирование раздела .text:

0000000080100000 <_ftext>:
    80100000:    00000000     nop

0000000080100004 <_start>:
    80100004:    40806800     mtc0    zero,c0_cause
    80100008:    00000000     nop
    8010000c:    3c080000     lui    a4,0x0
    80100010:    3c018010     lui    at,0x8010
    80100014:    65080001     daddiu    a4,a4,1
    80100018:    64210d28     daddiu    at,at,3368
    8010001c:    0008403c     dsll32    a4,a4,0x0
    80100020:    0101402d     daddu    a4,a4,at
    80100024:    3c090000     lui    a5,0x0
    80100028:    3c018010     lui    at,0x8010
    8010002c:    65290001     daddiu    a5,a5,1
    80100030:    64210d40     daddiu    at,at,3392
    80100034:    0009483c     dsll32    a5,a5,0x0
    80100038:    0121482d     daddu    a5,a5,at
    8010003c:    2529ffe8     addiu    a5,a5,-24
    80100040:    1509001c     bne    a4,a5,801000b4 <_start+0xb0>
    80100044:    00001025     move    v0,zero

 

при симуляции проекта в GDB выдает UNPREDICTABLE: PC = 0x8010003c

 

.gdbinit:

target sim
set architecture mips:isa64
load ./build/project.elf
file ./build/project.elf

 

подскажите что не так со сложением?

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this