bxfqing 发表于 2011-10-13 15:07

how to run valgrind at android with ARMv6

when I run valgrind at ARM11 MPcore base on ARMv6:

an issue occurred:==2291== Process terminating with default action of signal 4 (SIGILL)
==2291==Illegal opcode at address 0x380A2B6C
==2291==    at 0x79996000: ??? (in /system/bin/linker)
==2291== ......

Illeagle Instruction at 0x38039e50

There are some URL to referabout "Illeagle Instruction":

Illegal instruction的解决?
http://hi.baidu.com/caicry/blog/item/ede3b8fa01ebc89059ee908a.html

bxfqing 发表于 2011-10-13 15:32

valgrind 3.6.* not supprot ARMv6

本帖最后由 bxfqing 于 2011-10-13 15:38 编辑

Reference:
http://old.nabble.com/valgrind-for-ARM-Linux-td28299108.html
AFAIK Valgrind currently runs on ARMv7, but supports only ARMv5
instruction set (plus several v6 and v7 instructions).

Valgrind cross compilation for ARMv5tel
http://stackoverflow.com/questions/4228339/valgrind-cross-compilation-for-armv5tel
The ARM support in valgrind covers all ARMv5 instructions and a select subset of v6 and v7 instructions. BUT, and it's a big but, to actually RUN valgrind you must use a CPU capable of running ARMv7 code. That means Cortex-A or better.

If you intend to run valgrind on an ARMv5 class processor (like XScale) it will not work and the target program will fault with an illegal opcode.

bxfqing 发表于 2011-10-13 15:43

回复 2# bxfqing


http://permalink.gmane.org/gmane.comp.debugging.valgrind/10907
Does Valgrind -3.6.0 (or 3.6.1) support ARMv6 ?

   

My friend said that valgrind can't work on ARMv6 hardware. ( bad instruction
ofmovw and movt , in VEX/priv/host_arm_defs.c ; which are mandatory only on
ARMv7. )

I thought:ARMv7 use thumb2 instruction, and ARMv6 use thumb instruction, so
ARMv7 including most of instructions of ARMv6. As valgrind support ARMv7, it
also has the ability to support ARMv6 potentially.

bxfqing 发表于 2011-10-13 18:22

* ================== PLATFORM CHANGES =================

* Support for ARM/Linux. Valgrind now runs on ARMv7 capable CPUs
running Linux. It is known to work on Ubuntu 10.04, Ubuntu 10.10,
and Maemo 5, so you can run Valgrind on your Nokia N900 if you want.

This requires a CPU capable of running the ARMv7-A instruction set
(Cortex A5, A8 and A9). Valgrind provides fairly complete coverage
of the user space instruction set, including ARM and Thumb integer
code, VFPv3, NEON and V6 media instructions. The Memcheck,
Cachegrind and Massif tools work properly; other tools work to
varying degrees.

bxfqing 发表于 2011-10-13 22:23

Android on OMAP
http://elinux.org/Android_on_OMAP
his page collects information about and guides you through the installation of Google's Android on TI's ARM based OMAP SoCs.
Note: Only small parts of this page should be TI OMAP specific. The basic tasks should also apply to all other ARM926 or higher based SoCs at least able to run a 2.6.23 Linux kernel.
Note: If you like this page, please see the Android Portal on this site for much more information about Android systems programming. See Android Porting for more links to porting information, articles and tutorials.
Note: This article assumes that your are familiar with some basics of embedded ARM Linux. E.g. you should know how to use diff & patch, how to boot your embedded ARM SoC with a recent non-Android Linux, how to use a cross compiler etc.

tpopusher 发表于 2014-10-22 20:23

0x00009174 <+276>:   ldr   r2, ; 0x950c <main+1196>
   0x00009178 <+280>:   mov   r3, r8
   0x0000917c <+284>:   bl      0xa114 <vgPlain_debugLog>
   0x00009180 <+288>:   add   r5, sp, #16
   0x00009184 <+292>:   sub   r5, r5, #1
   0x00009188 <+296>:   mov   r1, #0

=> 0x0000918c <+300>:   movw    r2, #4097       ; 0x1001         //movw (and movt)not supported without Thumb2

   0x00009190 <+304>:   mov   r0, r5
   0x00009194 <+308>:   bl      0x8944 <memset>
   0x00009198 <+312>:   ldr   r0, ; 0x9510 <main+1200>
   0x0000919c <+316>:   mov   r1, r5
   0x000091a0 <+320>:   mov   r2, #4096       ; 0x1000
   0x000091a4 <+324>:   bl      0x88c0 <readlink>
   0x000091a8 <+328>:   cmn   r0, #1

1 there are"movt, movw" in some many *.S files, we can modify them
2 there are many "movt, movw" in the valgrind's generated code, that 's what we have no way to continue.

页: [1]
查看完整版本: how to run valgrind at android with ARMv6