Skip to content

[LLDB] MIPS, incorrect byte order issues with Cast and p/x #135840

Open
@patryk4815

Description

@patryk4815

Similar bug as in:

(btw qemu-mips don't work - I don't know why, probably qemu issue)

Steps to reproduction:
My small openwrt TP-LINK Switch with ~18MB disk space:

root@OpenWrt:/tmp# ./gdbserver 0:1234 /bin/sh
Process /bin/sh created; pid = 4445
Listening on port 1234

(not possible to build lldb-server, to fit there)

My host:

(lldb) file ./sh
Current executable set to '/tmp/dd/sh' (mipsr2).
(lldb) log enable gdb-remote all
(lldb) gdb-remote 192.168.1.1:1234
Process 4445 stopped
* thread #1, stop reason = signal SIGTRAP
    frame #0: 0x77f3abc0
->  0x77f3abc0: bal    0x77f3abd4
    0x77f3abc4: move   $fp, $zero
(lldb)
(lldb) register read sp
     r29 = 0x7fffbda0
(lldb) p/x $sp
(unsigned int) 0xa0bdff7f

p/x $sp should return 0x7fffbda0, but instead I see: 0xa0bdff7f

Basically internal lldb.SBValue Cast function mess-up byte-ordering somehow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions