SeeFlowerX / stackplz

基于eBPF的堆栈追踪工具
Apache License 2.0
927 stars 179 forks source link

硬件断点只能打印一行堆栈 #61

Open hgy413 opened 2 months ago

hgy413 commented 2 months ago

使用的是google store的包,它的so是通过split.apk加载,并没有独立的so map,下硬件断点:

  oriole:/data/local/tmp #  ./stackplz --pid `pidof com.xxx.yyy` --brk 0x77be764e38:w --stack
[*] save maps to maps_13251.txt
set breakpoint at kernel:false, addr:0x77be764e38, type:2
start 1 modules
[13251|13524] event_addr:0x77be764e38 hit_count:1, Backtrace:
  #00 pc 0000000000002b78  /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk (offset 0x2e5b000)

0000000000002b78 和 0x2e5b000都不正确,而且只会显示一行#00,请教如何修正让它显示正确的调用栈

hgy413 commented 2 months ago

so基地址是split_config.arm64_v8a.apk的maps中的其中一行起始地址,但不是split_config.arm64_v8a.apk的第一行起始地址,所以我猜是这个原因引起的,可否提供接口指定so的基地址 oriole:/ # cat /proc/17573/maps | grep split_config.arm64_v8a.apk 74cfe13000-74cfee1000 r-xp 018dd000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 74cfee1000-74cfeea000 r--p 019aa000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 74cfeea000-74cfeeb000 rw-p 019b2000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 752cb61000-752dcbf000 r-xp 01bbf000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 752dcbf000-752dccd000 r-xp 02d1d000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 752dccd000-752ddeb000 r-xp 02d2b000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 752ddeb000-752dded000 rwxp 02e49000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 752dded000-752ddfb000 r-xp 02e4b000 fe:32 91263 /data/app/~~926ixHhmVAU1kB7XGWGvpA==/com.xxx.yyy-4tckUQtv6xQS-rPSusMYiQ==/split_config.arm64_v8a.apk 0x752cb61000 是so的基地址,