注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

时间记录器

记录我的Linux、Android学习之路

 
 
 

日志

 
 

dalvik笔记- 2012-5-22  

2012-05-22 15:52:29|  分类: Dalvik |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
1、在文件libdex/InstrUtils.c 中
    -InstructionWidth* dexCreateInstrWidthTable(void)
        创建指令宽度表,只在DexDump.c (dexdump)和DexVerify.c (vm\analysis)中被使用
    -InstructionFlags* dexCreateInstrFlagsTable(void)
        创建指令标识表,决定branch、continue、switch、throw、return、invoke等行为

2、libdex/OpCode.h中的typedef enum OpCode是Dalvik opcode list.

3、defy编译
   $ .  build/envsetup.sh
   $lunch  选120, 120. cyanogen_jordan-eng
   $make

如果只编译dalvik,则cd dalvik;mm

4、编译dalvik的log信息
neo@neo-laptop:~/defy/android-cm7/dalvik$ mm
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.7
TARGET_PRODUCT=cyanogen_jordan
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
No private recovery resources for TARGET_DEVICE jordan
make: Entering directory `/home/neo/defy/android-cm7'
Install: out/target/product/jordan/system/lib/libnativehelper.so
Install: out/target/product/jordan/system/lib/libdvm.so
Install: out/host/linux-x86/lib/libdvm.so
target Non-prelinked: libdvm_assert (out/target/product/jordan/symbols/system/lib/libdvm_assert.so)
Install: out/target/product/jordan/system/lib/libdvm_assert.so
target Non-prelinked: libdvm_sv (out/target/product/jordan/symbols/system/lib/libdvm_sv.so)
Install: out/target/product/jordan/system/lib/libdvm_sv.so   sv=self_verification 自校验,即支持自校验
target Non-prelinked: libdvm_interp (out/target/product/jordan/symbols/system/lib/libdvm_interp.so)
Install: out/target/product/jordan/system/lib/libdvm_interp.so
target Non-prelinked: dalvikvm (out/target/product/jordan/symbols/system/bin/dalvikvm)
Install: out/target/product/jordan/system/bin/dalvikvm
Install: out/host/linux-x86/bin/dalvikvm
Install: out/host/linux-x86/bin/dexlist
target Non-prelinked: dexopt (out/target/product/jordan/symbols/system/bin/dexopt)
Install: out/target/product/jordan/system/bin/dexopt
Install: out/host/linux-x86/bin/dexopt
target Non-prelinked: dexdump (out/target/product/jordan/symbols/system/xbin/dexdump)
Install: out/target/product/jordan/system/xbin/dexdump
Install: out/host/linux-x86/bin/dexdump
target Non-prelinked: dvz (out/target/product/jordan/symbols/system/bin/dvz)
Install: out/target/product/jordan/system/bin/dvz
Install: out/host/linux-x86/framework/dx.jar
Install: out/host/linux-x86/bin/dx
Copy: jasmin.jar (out/host/common/obj/JAVA_LIBRARIES/jasmin.jar_intermediates/jasmin.jar)
Install: out/host/linux-x86/bin/jasmin
Install: out/host/linux-x86/framework/dexdeps.jar
Install: out/host/linux-x86/bin/dexdeps
Install: out/host/linux-x86/bin/dmtracedump
Install: out/host/linux-x86/bin/create_test_dmtrace
target Non-prelinked: gdbjithelper (out/target/product/jordan/symbols/system/bin/gdbjithelper)
Install: out/target/product/jordan/system/bin/gdbjithelper
Install: out/host/linux-x86/bin/hprof-conv
make: Leaving directory `/home/neo/defy/android-cm7'
neo@neo-laptop:~/defy/android-cm7/dalvik$

5、几个常用命令
    adb remount;adb push libdvm.so /system/lib;adb reboot
   重新挂载手机到文件系统;将虚拟机push到对应目录下;重启手机

6、修改过程
1)全局查找OP_UNUSED_3E
CodegenDriver.c (vm\compiler\codegen\arm):    if ((dalvikOpCode >= OP_UNUSED_3E) && (dalvikOpCode <= OP_UNUSED_43)) {
CodeVerify.c (vm\analysis):    case OP_UNUSED_3E:
Dataflow.c (vm\compiler):    // 3E OP_UNUSED_3E
InstrUtils.c (libdex):        case OP_UNUSED_3E:
InstrUtils.c (libdex):        case OP_UNUSED_3E:
InstrUtils.c (libdex):        case OP_UNUSED_3E:
InterpC-allstubs.c (vm\mterp\out):/* File: c/OP_UNUSED_3E.c */
InterpC-allstubs.c (vm\mterp\out):HANDLE_OPCODE(OP_UNUSED_3E)
InterpC-portdbg.c (vm\mterp\out):/* File: c/OP_UNUSED_3E.c */
InterpC-portdbg.c (vm\mterp\out):HANDLE_OPCODE(OP_UNUSED_3E)
InterpC-portstd.c (vm\mterp\out):/* File: c/OP_UNUSED_3E.c */
InterpC-portstd.c (vm\mterp\out):HANDLE_OPCODE(OP_UNUSED_3E)
OpCode.h (libdex):    OP_UNUSED_3E                    = 0x3e,
OpCode.h (libdex):        H(OP_UNUSED_3E),                                                    \
OP_UNUSED_3E.c (vm\mterp\c):HANDLE_OPCODE(OP_UNUSED_3E)
RegisterMap.c (vm\analysis):    case OP_UNUSED_3E:
下面按照这个顺序修改,其中OUT目录下到不用修改
2)将libdex/OpCode.h中到OP_UNUSED_3E修改为OP_ADD_INT_2ADDR_3E,本文件修改两处
3)
  评论这张
 
阅读(981)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017