merge in ics-release history after reset to master
Merge "logcat: add sanity check"
liblog: do better checks of log messages.

Testing:

The following test cases all passed and generated log entries:

 # echo -n '\03foo\0bar\0' > /dev/log/main
 # echo -n '\03\0bar\0' > /dev/log/main
 # echo -n '\03\0a\0' > /dev/log/main

The following entries were successfully processed by
logcat but produced no log entries:

 # echo -n '\03\0\0' > /dev/log/main
 # echo -n '\03a\0\0' > /dev/log/main
 # echo -n '\03b\0\0' > /dev/log/main

Also tested the pathological error condition:

 cat /dev/urandom > /dev/log/main

which produced many "+++ LOG: malformed log entry" errors.

Bug: 5478600
Change-Id: I53bc79507242dcfc14445746c29edf47be0a90b4
Enhance debuggerd memory dumps

This makes two changes:

(1) Display ASCII values next to the memory dumps.  For example:

I DEBUG: 00008ac4 706f6f4c 20676e69 74206425 73656d69  Looping %d times
I DEBUG: 00008ad4 7453000a 6e69726f 6f742067 0a702520  ..Storing to %p.
I DEBUG: 00008ae4 65642f00 657a2f76 55006f72 6c62616e  ./dev/zero.Unabl

(The hex values are still displayed as little-endian word values, while
the ASCII part is byte oriented.)

(2) Optionally display memory dumps for all registers, not just LR
and PC, for the crashing thread.  This is meant for situations where
we crash dereferencing foo->bar and want to see what the memory near
"foo" looks like -- could be handy if it got stomped by MUTF-16 text
or something recognizable.

Change #2 is currently disabled, via a compile-time setting.

Bug 5471955

Change-Id: Iacfd01c314055bad81db2f43b7d239f10086fcfb
Merge "Enhance debuggerd memory dumps"
Add log summary to tombstones

When the tombstones are uploaded to APR, they're truncated at 64KB.
This causes the log data, which is at the end, to be lost if the
process has more than about 12 threads (which many do).

This change adds the last few lines of the log right below the
report for the crashing thread, where we should be guaranteed to
keep it.

Also, clean up trailing newlines on log messages (which end up in
the tombstone), and don't print a "------- log" banner if there
aren't any messages in that log file (e.g. slog).

Also also, don't try to show_nearby_maps unless this is the crashing
thread.

Bug 5471955

Change-Id: Iaa4fd2fafbaeda2f20bb95f202177d7744a91f9d
merge in ics-release history after reset to master
Merge "liblog: do better checks of log messages."
Merge "Add log summary to tombstones"
Enable verbose register memory dumps

Dump some memory at addresses for all registers that look like they
might have valid addresses.  Previously this was only done for PC
and LR.

(This is expected to be disabled before ship.)

Bug 5484924

Change-Id: I9802eaa396783e1286ae0c53eaf2473892c38a02
merge in ics-release history after reset to master
Fix the class_reset command

The class_reset command used to reset services that had been set to
"disabled" in the init.rc file to a non-disabled state.  Now, if the
service was originally set to "disabled", have the reset command set
it back to disabled.  Otherwise, set it to the "reset" state as it
currently does.

Change-Id: I0c10582e46a8e443d4748d9d893ae762b19b653a
Gracefully handle truncated log messages.

Bug: 5522726
Change-Id: I8637c7da854ec1ecb321632c45ee9bc2edc94a67
am a286480f: Fix the class_reset command

* commit 'a286480f56012abdb4ef4ddab1c19a5c2316b7b8':
  Fix the class_reset command
merge in ics-mr1-release history after reset to ics-mr1
Fix build

Change-Id: Icbe57024e6018600d47a68132f53f15d7602dc92
Reconcile with AOSP master

Change-Id: I12bbc98729a54df0e3d355f3bb2b943964202235
am 604f52e3: Reconcile with AOSP master

* commit '604f52e31357a774ad49290e323976b1db5b9f38':
  Fix build
Merge "Gracefully handle truncated log messages." into ics-mr1
Remove log spam

Bug: 5533986
Change-Id: I3d8108e2f65ce6513ac8b2d14541eaa5e4fc5da1