当前位置:网站首页>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
边栏推荐
- Record the bug of unity 2020.3.31f1 once
- Thinkphp6 limit interface access frequency
- [JS event -- event flow]
- What are the rules and trading hours of agricultural futures contracts? How much is the handling fee deposit?
- geotrust ov多域名ssl證書一年兩千一百元包含幾個域名?
- Major domestic quantitative trading platforms
- One click generation and conversion of markdown directory to word format
- MySQL advanced SQL statement 2
- Keil compilation code of CY7C68013A
- Alibaba cloud polkit pkexec local rights lifting vulnerability
猜你喜欢
[C language] Dynamic Planning --- from entry to standing up
Pit encountered in win11 pytorch GPU installation
CorelDRAW Graphics Suite2022免费图形设计软件
Federal learning: dividing non IID samples according to Dirichlet distribution
PIP installation of third-party libraries
Leetcode merge sort linked list
Use a mask to restrict the input of the qlineedit control
Pytoch --- use pytoch for image positioning
Force buckle 540 A single element in an ordered array
Deep understanding of lambda expressions
随机推荐
汇编语言中的标志位:CF、PF、AF、ZF、SF、TF、IF、DF、OF
C - derived classes and constructors
How much is the tuition fee of SCM training class? How long is the study time?
Deeply understand the concepts of synchronization and asynchrony, blocking and non blocking, parallel and serial
C language guessing numbers game
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
Thinkphp内核工单系统源码商业开源版 多用户+多客服+短信+邮件通知
Alibaba cloud polkit pkexec local rights lifting vulnerability
powershell_ View PowerShell function source code (environment variable / alias) / take function as parameter
What is 5g industrial wireless gateway? What functions can 5g industrial wireless gateway achieve?
ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
阿里云polkit pkexec 本地提权漏洞
Federal learning: dividing non IID samples according to Dirichlet distribution
One step implementation of yolox helmet detection (combined with oak intelligent depth camera)
Read "the way to clean code" - function names should express their behavior
Yyds dry inventory compiler and compiler tools
Okcc why is cloud call center better than traditional call center?
My first experience of shadowless cloud computer
cookie、session、tooken