diff options
author | Sebastien Hertz <shertz@google.com> | 2014-03-11 15:26:35 +0100 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2014-03-17 09:15:31 +0100 |
commit | cb19ebf7609f74b223bd86c94f721498795f9bba (patch) | |
tree | 0db31e4f83046b3d8159d4ba28d9298ff94e06c3 /runtime/dex_file.cc | |
parent | f17ce4c5e3b6882aa8849d1ed82df4238c436da2 (diff) | |
download | android_art-cb19ebf7609f74b223bd86c94f721498795f9bba.tar.gz android_art-cb19ebf7609f74b223bd86c94f721498795f9bba.tar.bz2 android_art-cb19ebf7609f74b223bd86c94f721498795f9bba.zip |
Fix debugger crash in native method frames.
The main crash happens when we try to read (StackFrame::GetValues) or write
(StackFrame::SetValues) values in native frames. We use the method's vmap to
know where Dalvik registers live but native methods don't have vmap. The fix
is to reply with the OPAQUE_FRAME error which indicates local values are not
accessible in the frame.
We prevent from dereferencing null code item which causes some crashes too.
This happens when we compute the line table (Method::LineTable) and variable
table (Method::VariableTable) of methods without code: native, proxy and
abstract methods. We do not expect to encounter abstract methods though. We
take care of these kinds of method when mangling/demangling local value slots.
We also fix the location's pc of native and proxy frames where it must be -1
(as 8-byte value). We'll use this property to detect such frames in the JDWP
tests.
Bug: 13366758
Change-Id: I78e3263fbf2681b5573571c846390d52b9193849
Diffstat (limited to 'runtime/dex_file.cc')
-rw-r--r-- | runtime/dex_file.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc index a3415d3f70..e5bc19c0cc 100644 --- a/runtime/dex_file.cc +++ b/runtime/dex_file.cc @@ -837,6 +837,7 @@ void DexFile::DecodeDebugInfo0(const CodeItem* code_item, bool is_static, uint32 void DexFile::DecodeDebugInfo(const CodeItem* code_item, bool is_static, uint32_t method_idx, DexDebugNewPositionCb position_cb, DexDebugNewLocalCb local_cb, void* context) const { + DCHECK(code_item != nullptr); const byte* stream = GetDebugInfoStream(code_item); UniquePtr<LocalInfo[]> local_in_reg(local_cb != NULL ? new LocalInfo[code_item->registers_size_] : |