当前位置:网站首页>Mapping location after kotlin confusion
Mapping location after kotlin confusion
2022-07-02 04:34:00 【Coating process】
author : Yugang said
Talk about this article kotlin Of mapping Location of documents , Take a specific online crash as an example
Online crash log
Caused by: java.lang.IndexOutOfBoundsException: toIndex = 10
at java.util.AbstractList.subListRangeCheck(AbstractList.java:507)
at java.util.ArrayList$SubList.subList(ArrayList.java:1238)
at b.a.a.a.p.y1.i(SearchRecordFragment.kt:12)
at b.a.a.a.p.f0.run(lambda:6)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:264)
at android.app.ActivityThread.main(ActivityThread.java:8306)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
Through the crash log above , The specific crash code can be found here
at java.util.ArrayList$SubList.subList(ArrayList.java:1238)
at b.a.a.a.p.y1.i(SearchRecordFragment.kt:12)
here b.a.a.a.p.y1
Represents a class , final i
Represents a method , Or variables , Here is actually a method , Because there is a call stack before and after , Here we call the sublist Crash caused by method , final kt:12
The number of lines after confusion is 12 That's ok
analysis mapping, Locate the specific code
Next , We turn on mapping file , Search for b.a.a.a.p.y1
This string , give the result as follows
Find the corresponding class mapping Information , The next step is to find i
, You can find many in this class i Statement of , For example, the following , It's not what we're looking for i
// This i It's a Lzay Variable of type
kotlin.Lazy lateSearchRecordAdapter$delegate -> i
// Ahead 3:4 The number of lines is wrong , What we are looking for is 12
3:4:void com.ygp.mro.app.search.adapter.SearchRecordAdapter.setShowExpandView(boolean):50:51 -> i
Keep looking , Found the final matching location , as follows
11:11:java.util.List com.ygp.mro.app.search.adapter.SearchRecordAdapter.getData():22:22 -> i
11:11:void initListShowExpand():185 -> i
12:13:void initListShowExpand():185:186 -> i
14:14:void com.ygp.mro.app.search.adapter.SearchRecordAdapter.setData(java.util.List):0:0 -> i
14:14:void initListShowExpand():186 -> i
The middle line above , It's what we want 12:13:void initListShowExpand():185:186 -> i
, After confusion 12:13 The corresponding real number of rows is 185:186, So the actual collapse is 185 That's ok
Look at the corresponding source code
The source code here also calls sublist Method , Consistent with the method called by the crash , So it was determined that it was here that caused the crash
Further verify
Through the source code with mapping, You can find , The way to collapse is initListShowExpand
, Where is this method called ? We did this by looking at , There are two places to call
When the concrete collapse , Where was it called , Look at the collapse log
at b.a.a.a.p.y1.i(SearchRecordFragment.kt:12)
at b.a.a.a.p.f0.run(lambda:6)
at android.os.Handler.handleCallback(Handler.java:938)
It's here b.a.a.a.p.f0
Of run Method , and run The way is handler Callback , Keep going mapping File search b.a.a.a.p.f0
Found a lot of run Call to , And there is this behind the method lambda:6
, Let's find the corresponding 6 This place , eureka
6:6:void com.ygp.mro.app.search.SearchRecordFragment$initListener$2.onGlobalLayout$lambda-1(com.ygp.mro.app.search.SearchRecordFragment):151:151 -> run
6:6:void com.ygp.mro.app.search.SearchRecordFragment$initListener$2.lambda$EpImLmOa5i7W3KU8Q9jIBuQ78Gk(com.ygp.mro.app.search.SearchRecordFragment):0 -> run
6:6:void run():0 -> run
Corresponding to the source code 151 That's ok , View source code , Found the calling code
So the result is 151 Line call initListShowExpand
Method , Then inside the method 185 The line crashed
边栏推荐
- MySQL advanced SQL statement 2
- Use a mask to restrict the input of the qlineedit control
- MySQL table insert Chinese change? Solution to the problem of No
- LeetCode-对链表进行插入排序
- geotrust ov多域名ssl證書一年兩千一百元包含幾個域名?
- Pytorch---使用Pytorch进行鸟类的预测
- Flag bits in assembly language: CF, PF, AF, ZF, SF, TF, if, DF, of
- 10 minutes to understand CMS garbage collector in JVM
- Arbre binaire pour résoudre le problème (2)
- Its appearance makes competitors tremble. Interpretation of Sony vision-s 02 products
猜你喜欢
Gin framework learning code
Yolov5 network modification tutorial (modify the backbone to efficientnet, mobilenet3, regnet, etc.)
One click generation and conversion of markdown directory to word format
Mysql表insert中文变?号的问题解决办法
Realize the function of data uploading
Mysql database learning
FAQ | FAQ for building applications for large screen devices
Research on the security of ognl and El expressions and memory horse
Learn what definitelytyped is through the typescript development environment of SAP ui5
MySQL advanced SQL statement 2
随机推荐
Pytorch---使用Pytorch进行鸟类的预测
Homework of the 16th week
[C language] basic learning notes
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
Wechat applet calculates the distance between the two places
Pit encountered in win11 pytorch GPU installation
Today's plan: February 15, 2022
office_ Delete the last page of word (the seemingly blank page)
Bitmap principle code record
Flag bits in assembly language: CF, PF, AF, ZF, SF, TF, if, DF, of
geotrust ov多域名ssl證書一年兩千一百元包含幾個域名?
千亿市场规模医疗美容行业的水究竟有多浑?
C language practice - binary search (half search)
Alibaba cloud polkit pkexec local rights lifting vulnerability
Exposure X8标准版图片后期滤镜PS、LR等软件的插件
Exposure X8 Standard Version picture post filter PS, LR and other software plug-ins
Read "the way to clean code" - function names should express their behavior
Websites that it people often visit
LxC limits the number of CPUs
阿里云polkit pkexec 本地提权漏洞