PDA

View Full Version : gdb-mipsel & gdbserver



tskitishvili
06-05-2010, 07:43 AM
...
1. GDB
- realtek kindly included gdbserver in their SDK, so applications like DvdPlayer can be debugged remotely

e.g. on PBO:

gdbserver pbo_ip:1234 ./DvdPlayer

on PC:

gdb-mipsel
>target remote pbo_ip:1234
...

What did you do to see assembler symbols ?
What toolchain did you use ? Was gdb-mipsel part of toolchain or you did you build it ?
I have downloaded and installed gdb for mipsel as debian package. But I cannot see assembler statements.

stepw
06-08-2010, 01:21 AM
What did you do to see assembler symbols ?
What toolchain did you use ? Was gdb-mipsel part of toolchain or you did you build it ?
I have downloaded and installed gdb for mipsel as debian package. But I cannot see assembler statements.

At the time I only used gdb to inspect memory and registers, hence there was no need for disassembly. To get the disassembly MIPS binary has to be loaded on the PC like this

gdb-mipsel DvdPlayer
Then remote session can be initiated the same way.

To be honest, I don't remember where I grabbed MIPSEL gdb, I stronlgy suspect I used a debian package too.

MIPSEL TRACE32 can be used as a remote GDB client, but it pulls the binary from PBO every time it seems, so it takes like 20 minutes to bring up a session.

tskitishvili
06-08-2010, 03:30 AM
gdb-mipsel DvdPlayer
Then remote session can be initiated the same way.

To be honest, I don't remember where I grabbed MIPSEL gdb, I stronlgy suspect I used a debian package too.


I have installed it from .deb package and ran it exactly as you quoted, but when I type disassemble or where I do not see any assembler instructions. Looking at memory only won't be very productive.

BTW. It is advertised that IDA Pro 5.6 will support connection to gdbserver running on MIPS.

stepw
06-08-2010, 02:13 PM
What about

gdb> x/8i $pc
?

wigout
06-08-2010, 02:20 PM
Where'd you download gdb-mipsel from? What OS/python version are you running it under?

When I try to run mipsel-linux-gnu-gdb from: http://www.emdebian.org/toolchains/search.php?package=gdb-mipsel-linux-gnu&arch=&distro=sid on the ubuntu 10.04 pc I get the following error:
./mipsel-linux-gnu-gdb: error while loading shared libraries: libpython2.5.so.1.0: cannot open shared object file: No such file or directory

libpython2.5.so.1.0 can be found in python 2.5 debug package- when downloaded and placed in /usr/lib, I get a segmentation fault

If I try to install the whole deb package from emdebian.org, I get an Error: Dependency is not satisfiable: python2.5 (>= 2.5), despite the fact that I have the ubuntu repository version of python2.6 installed.

Anyway: what are you using(OS/python/gdb-mipsel)/where'd you get it from?

thanks,
wigout

tskitishvili
06-08-2010, 05:05 PM
Where'd you download gdb-mipsel from? What OS/python version are you running it under?

...
Anyway: what are you using(OS/python/gdb-mipsel)/where'd you get it from?

thanks,
wigout


I had all the same issues :) I don't recall what exactly helped. But I was trying to install 2.5 version and I was trying to install gdb with option to ignore dependencies. etc. But again, I do not recall what exactly worked. :)

I use latest ubuntu desktop (www.ubuntu.com/desktop) running under VirtualBox (http://dlc.sun.com/virtualbox/vboxdownload.html). Virtual box allows transparent integration of your mouse interactions and dynamic virtual screen resize.

I have to get home to check the version of python and gdb. I will update this post.

stepw
06-08-2010, 11:29 PM
I grabbed mipsel gdb here:
http://downloads.pylone.jp/cross-toolchain/deb/

I suspect it could be statically linked with all required dependencies, as I had no issues at all running it on quite stripped down puppy Linux. It;s an older version though...

snappy46
06-09-2010, 12:07 AM
I grabbed mipsel gdb here:
http://downloads.pylone.jp/cross-toolchain/deb/

I suspect it could be statically linked with all required dependencies, as I had no issues at all running it on quite stripped down puppy Linux. It;s an older version though...

Thank stepw I had the same issues as wigout but the version at the link you provided worked great.

tskitishvili
06-09-2010, 03:40 AM
Fortunately I had VirtualBox session memory snap shot :)


Here is where I got gdb from:


wget http://www.emdebian.org/toolchains/pool/main/g/gdb/gdb-mipsel-linux-gnu_7.0-1_i386.deb




Here is how I forced to install it.


sudo apt-get purge python2.5-minimal && sudo dpkg --configure -a && sudo apt-get install python2.5-minimal
sudo apt-get -f install
sudo dpkg --install gdb-mipsel-linux-gnu_7.0-1_i386.deb




But the following installs without any issue. :)

I grabbed mipsel gdb here:
http://downloads.pylone.jp/cross-toolchain/deb/

I suspect it could be statically linked with all required dependencies, as I had no issues at all running it on quite stripped down puppy Linux. It;s an older version though...



The following worked too. Thank you. :)

What about

gdb> x/8i $pc
?

P.S. I never used gdb without some sort of gui.

tskitishvili
06-09-2010, 04:39 AM
Xtreamer busybox is crippled. It does not have telnetd service, More over it does not allow to type commands. Even within ROM monitor you can do nothing with it. All symbols are replaced with '*'.

So we need to transplant X DvdPlayer to A or P firmware to debug. :(