History log of /dalvik/libdex/DexFile.h
Revision Date Author Comments
03a41e081d63f1dec236a0b0521d8c2300a622e0 10-Apr-2017 Orion Hodson <oth@google.com> Fix missing receiver type information in invoke-custom

Bug: 36957105
Test: manual using the dex file generated by dx/tests/135-invoke-custom
Change-Id: I28db8c013a63cebce8a6202dc3241bb494153b80
fa5e510d770070f8e7f47d126f5be138aa55cb84 14-Feb-2017 Orion Hodson <oth@google.com> Add support invoke-custom to dexdump

o Update bytecode.txt with codepoints for invoke-custom
instructions and run opcode-gen/regen-all.

o Update dexdump to support invoke-custom with output equivalent to
dexdump2.

Bug: 30550796,33191717,33231751
Test: manually tested with DEX files generated from ART run-tests.
Change-Id: If2cedea21875e93525c4850005d335901897484a
03a551d00833eafe1474e7675173c51efa845730 11-Apr-2016 Aart Bik <ajcbik@google.com> Bug fix for segfault on reading bytecode with dexdump.

Rationale:
An incorrect type (signed vs. unsigned) compare did not guard
subsequent access of memory correctly.

BUG=28038148

Change-Id: I7aa97ad252614e3d045297cce314b5a4b96a60b2
796fe5399a161f870d94dd7fadf3c6100b1d1640 24-Mar-2016 Alex Light <allight@google.com> Add support for dex version 37 in libdex.

Bug: 27538761
Bug: 27809626

(cherry picked from commit 5c391cc69978326b08f303e37951b6924038520c)

Change-Id: I79b2bdfc8194dc210bc1299b0544f82b2af735b0
5c391cc69978326b08f303e37951b6924038520c 24-Mar-2016 Alex Light <allight@google.com> Add support for dex version 37 in libdex.

Bug: 27538761
Bug: 27809626
Change-Id: I79b2bdfc8194dc210bc1299b0544f82b2af735b0
1a65052468068a4e9a859d185860510aa1d8cfd4 08-Jul-2015 Aart Bik <ajcbik@google.com> Revert "Remove libdex (including dexdump/list)."

This reverts commit 48a66c5d261c333fc3d672e910b26cd6b1a05083.


REASON:
win_sdk is not happy with my migration :-(

Change-Id: Ib5d25b65ffef8bebc42fc586d2c65add04aa2b54
48a66c5d261c333fc3d672e910b26cd6b1a05083 08-Jul-2015 Aart Bik <ajcbik@google.com> Remove libdex (including dexdump/list).

Rationale:
Utilities dexdump and dexlist are now provided by Art.
This CL removes the utilities and supporting libdex.

Bug: 22322814
Change-Id: I032d6e4021a2c75b530e6116bca03c6a8dead2c3
50e2a5861bf6310427bb043956fa7b545da3b044 15-Nov-2014 Elliott Hughes <enh@google.com> Clean up some dead dalvik cruft.

I don't know whether dmtracedump is still useful, so I'm assuming we should
keep it building. But at least now it's more obvious that it's the only user
of Profile.h.

Change-Id: Ieabce07cb278a19af72b566b08193db17d95e66d
0f75403dcede6ef6c1e650921376101686e7ba17 24-May-2014 Ian Rogers <irogers@google.com> Clean-up some compiler warning messages.

Change-Id: I24522a57eaabedd4191856b80e5efe1b845be2fd
4f29f302c71d886db8ced57b6ede2d9cf41b30de 23-Jul-2012 Elliott Hughes <enh@google.com> Fix Method.getParameterAnnotations.

The dex format represents parameter annotations using an
annotation_set_ref_item for each parameter. According to the spec,
the item's annotation_offset can be "0 if there are no annotations for this
element". The Dalvik VM accepts 0 values in the verification step,
but Method#getParameterAnnotations then crashes with a segmentation fault.

Bug: http://code.google.com/p/android/issues/detail?id=35304
Change-Id: I0ac7336d369894520c8e17848ab6a91dbbd905e9
b210a9f9c7ae17e2028a86d9a4e9a3b35472862a 15-Jul-2012 SangWook Han <sangwook.han@gmail.com> Use uintptr_t for cast pointer to integer.

On 64bit host, sizeof pointer is not equal to sizeof int/u4.
Need for host tools.

Change-Id: Id8d9418787e79523226b9c9e3f67277f9ac7c6aa
375fb116bcb817b37509ab579dbd55cdbb765cbf 15-Jun-2011 Carl Shapiro <cshapiro@google.com> Normalize the include guard style.

An leading underscore followed by a capital letter is a reserved
name space in C and C++.

This change also moves any #include directives within the include
guard in some of the compiler/codegen/arm header files.

Change-Id: I9715e2c5301699d31886e61d0fe6e29483555a2a
9fdbd91288a237eb58e18e4de9c729c3c268c318 25-May-2011 Dan Bornstein <danfuzz@android.com> Update dex file magic number.

Even though the dex format was technically resilient with respect to
the addition of new opcodes, consensus is that the errors one sees
when trying to use a new dex file on an old build were sufficiently
inscrutable that it was worth the effort to update the version number
embedded in the dex format magic.

This change updates dx to produce the new version number when extended
opcodes are enabled (which is the default, but may be overridden by
targeting an older API level).

This also updates the vm to recognize and accept both the new current
version number as well as the immediately previous one. Note: It won't
reject an old-version file if it happens to use the new opcodes; that
would just be a gratuitous and pointless failure.

Bug: 4364986
Change-Id: If8febbb0b91c1719df4247bf69c511251362d91f
bfc9799b1a53fd6f6136d07e6278d4538cf70f13 27-Apr-2011 Carl Shapiro <cshapiro@google.com> Make libdex structures tool friendly.

Previously, the struct name and its typedef name were identical. This
confuses emacs and etags. This change eliminates the typedef names and
removes the extern "C" wrapping the libdex header files. To support
this change the transitive C dependencies have been made to compile as
C++ instead.

Change-Id: I7065f32d61d776f9b09c7b461adf2502268d852f
db0c9549818d9f6e508d26e45ff9d886802aa1da 13-Apr-2011 Carl Shapiro <cshapiro@google.com> Convert the internal and in-line natives to C++.

Change-Id: I2ece682bc3b4d3b55ab27c60fd84a0b3243d7ca6
c99fe6df38af0e55821d8d98ccf67664ce35231a 25-Mar-2011 Jesse Wilson <jessewilson@google.com> Optimize annotations.

See libcore change I5912b526dfa87a61a95fbe7b7efc48d0dca3ad38

Change-Id: I89ed0be331eea3d9c0d02bebeaa719b686d532ca
http://code.google.com/p/android/issues/detail?id=7811
1553988115a2ecfce43eedebc488e0a8b8dea847 12-Mar-2011 Dan Bornstein <danfuzz@android.com> Clarify a comment.

Per suggestion during code review of previous patch.

Change-Id: I9bf88d3127f32036c1668ad03ffc491947a4f696
a9c49df6714b3a37b7a7d0522932e622be2b35ac 11-Mar-2011 Dan Bornstein <danfuzz@android.com> Clean up how primitive types are handled.

The PrimitiveType enum got "promoted" to libdex, and I added a
few helper functions there. I also quashed the idea that there
is some sort of canonical ordering of the enumerated values.

In the vm (per se), I made PrimitiveType uses where it had assumed
an ordering instead switch(). This mostly made things much simpler.

I also split out the array of type classes in Globals.h into
individual ClassObject*s. This mostly made things simpler, but the gc
got a tiny bit of extra cruft because of it.

Finally, I made it so that the type classes get created explicitly
during vm startup, instead of happening implicitly the first time
they're accessed. This both simplified the code and, in particular,
made it so that the type classes didn't have to be declared volatile.

There are still a couple of related items that could stand to be
cleaned up, but I think what's here is enough for one patch.

Change-Id: Id14a6dfdb200abce9f30911c330ba32d9c2a4c3f
9ea32b0a0fa0eb4c4bfcd73f0c7fe15ddb0f9ce2 10-Mar-2011 Dan Bornstein <danfuzz@android.com> A bit of libdex spring cleaning.

Give the UTF-8 parsing/validation code and the debug info decoder
their own files in libdex. Also, moved the random utility
dexRoundUpPower2() so it wasn't in the middle of unrelated stuff
(though maybe it doesn't want to stay in DexFile.c at all).

Change-Id: I115447e49904e2440dd538b1df90616ea95707a9
d4bd92bdc81b5eee09db7f752020a0d435683f7b 10-Mar-2011 Dan Bornstein <danfuzz@android.com> Better class name validation.

I made a combined class name / type descriptor validator in
libdex extracted from the original type descriptor validator,
made the original validator use that, and added another public
function to do class name validation.

The two not-quite-validators in CheckJNI.c and InternalNative.c
now do proper checking.

Change-Id: I0f25e3efb439da065d92596197d219792d5a46b1
57fd399d1265ec627d28a15b3d4b98e5f239ac88 04-Mar-2011 Andy McFadden <fadden@android.com> Low-level support for in-memory DEX

We want to be able to load classes from a DEX file in memory,
rather than insisting that they always be loaded from disk. This
provides the underpinnings.

The code was previously using the "are we in dexopt" flag to
decide if it needed to mprotect(RW) DEX data before altering it.
We now have an explicit flag.

Also, scraped off some "opt header flags" checks that never did much.

Bug 1338213

Change-Id: If7128bf246992156662e089a2a87cebf475a6f2a
d394371bd84bacc51e96e2d2eacb8549d9110b1e 09-Sep-2010 Dan Bornstein <danfuzz@android.com> Remove the functionality in ReduceConstants.[ch].

It was a good experiment to try, but it was never made production-ready,
and it doesn't look like it would be a net win at this point. We
metaphorically pour out a beer in its honor.

Change-Id: I7f6ac95f5b7c963df0a3015ed33595fa1a928636
e377ef62a40267ab16c2dd20cc5f4c63af6397cc 01-Sep-2010 Dan Bornstein <danfuzz@android.com> Split out the optimized dex file handling into its own file.

Also, make the optimized dex data area be consistently referred to as
the "opt" section instead of sometimes the "aux" section.

Change-Id: Id5589c13ce4b53d713f8186314ea886cd884c865
de75089fb7216d19e9c22cce4dc62a49513477d3 09-Jun-2010 Carl Shapiro <cshapiro@google.com> Remove trailing whitespace.

Change-Id: I95534bb2b88eaf48f2329282041118cd034c812b
fbdcfb9ea9e2a78f295834424c3f24986ea45dac 29-May-2010 Brian Carlstrom <bdc@google.com> Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master

Change-Id: I0c0edb3ebf0d5e040d6bbbf60269fab0deb70ef9
4b0750e8df91220690bb417f45d7ae8b7851b220 27-May-2010 Dan Bornstein <danfuzz@android.com> Fix two dex file structural verification issues.

First, structural verification failed to check for inconsistencies with
the number of arguments to methods compared to the number of registers
declared by those methods.

Second, neither the dexdump nor dexlist tools would run structural
verification.

As an added bonus, I renamed the function that performs byte swapping
and structural verification to be more descriptive about what it
does.

Bug: 2716693
Change-Id: I58794713967f5bea95010084c85efe1f929ce7d1
7d18e38e260d79df8144908b28033b800d5d7470 04-Dec-2009 Andy McFadden <fadden@android.com> Added additional DEX checksum.

We have a checksum on the base DEX data, but not on the stuff that
dexopt appends. If a flash block goes "funny" we might not be able to
detect the problem. This change adds a checksum field to the
"optimized" header.

The new checksum is verified under the same circumstances as the base
DEX checksum: when you use "dexdump", and when you enable additional
checking with -Xcheckdexsum (or the property dalvik.vm.check-dex-sum
is set to "true").

For bug 2255640.
72e93344b4d1ffc71e9c832ec23de0657e5b04a5 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
b51ea11c70602918c42764bfafe92a997d3b1803 09-May-2009 Andy McFadden <fadden@android.com> Defer reporting of certain verifier failures.

The verifier currently reports all failures immediately. Certain failures,
such as the failure to resolve a method, or the determination that access
to a field is not allowed, are supposed to deferred until the first time
that executing code does something that could cause the resolution.

With this change, several kinds of verification failures are deferred.
This is done by making a writable copy of the bytecode and replacing the
failing instruction with an "always throw" opcode.

Gory details:
- Added throw-verification-error instruction. Implemented in "portable"
and ARM interpreters. x86 uses portable form through stub.
- Added a function that creates a copy of a DexCode area and makes the
bytecodes writable.
- Added code that replaces a single instruction with an "always throw".
- Replaced runtime check for abstract/interface in new-instance with a
check at verification time.
- Added a test to exercise the deferred error mechanism.
- Minor cleanups (replaced tab, bad valgrind command, ...).
99409883d9c4c0ffb49b070ce307bb33a9dfe9f1 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import //branches/master/...@140412
f6c387128427e121477c1b32ad35cdcaa5101ba3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
f72d5de56a522ac3be03873bdde26f23a5eeeb3c 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
5d709784bbf5001012d7f25172927d46f6c1abe1 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
89c1feb0a69a7707b271086e749975b3f7acacf7 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
2ad60cfc28e14ee8f0bb038720836a4696c478ad 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution