<feed xmlns='http://www.w3.org/2005/Atom'>
<title>replicant/core/libunwindstack/Memory.cpp, branch replicant-9</title>
<subtitle>Patches not merged yet, used for building and testing them
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/'/>
<entry>
<title>Add a MemoryOfflineBuffer object.</title>
<updated>2018-04-04T19:29:25+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-04-03T23:03:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=f4e3ff6619f34c1b9f1f71fb4050e6bea9f65ead'/>
<id>f4e3ff6619f34c1b9f1f71fb4050e6bea9f65ead</id>
<content type='text'>
Use this for offline stack data so that it's not necessary to
copy any data around.

Add unit tests for the new object.

Bug: 77258731
Bug: 74354410

Test: Ran libunwindstack/libbacktrace unit tests.
Change-Id: I9b0f25d9520c96e64aedef5f295423c60ddb3488
(cherry picked from commit 6633b0ca090dd3da45b8936d587a1316401e46ba)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use this for offline stack data so that it's not necessary to
copy any data around.

Add unit tests for the new object.

Bug: 77258731
Bug: 74354410

Test: Ran libunwindstack/libbacktrace unit tests.
Change-Id: I9b0f25d9520c96e64aedef5f295423c60ddb3488
(cherry picked from commit 6633b0ca090dd3da45b8936d587a1316401e46ba)
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ability to read jit gdb data.</title>
<updated>2018-01-12T19:18:42+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-21T02:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=150db124f3f3c0f8e1c341fd33c6c64310e0ac39'/>
<id>150db124f3f3c0f8e1c341fd33c6c64310e0ac39</id>
<content type='text'>
Changes:
- New JitDebug class to handle all of the jit gdb interface.
- Add unit tests for all, along with new offline test using debug data.
- Add new Memory type called MemoryOfflineParts that has multiple
  MemoryOffline objects to support the offline test.
- Update the tools to use the JitDebug object.
- Modify libbacktrace to use the JitDebug, but only looking in libart.so
  and libartd.so.
- Change the Format32Bits to Is32Bit since it's more accurate and I use
  it in a different context where original name didn't make sense.
- Add a new function to find global variables in an elf file
  (GetGlobalVariable).
- Add a new function to determine if a pc is valid for this elf (IsValidPc).

Bug: 68396769

Test: Ran new unit tests. Added new offline test that uses jit debug data.
Test: Ran art test that generates jit data and verified a crash unwinds
Test: through the jit data.
Change-Id: I6e7ee2f5bab2242028a06feece156dff21c0a974
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changes:
- New JitDebug class to handle all of the jit gdb interface.
- Add unit tests for all, along with new offline test using debug data.
- Add new Memory type called MemoryOfflineParts that has multiple
  MemoryOffline objects to support the offline test.
- Update the tools to use the JitDebug object.
- Modify libbacktrace to use the JitDebug, but only looking in libart.so
  and libartd.so.
- Change the Format32Bits to Is32Bit since it's more accurate and I use
  it in a different context where original name didn't make sense.
- Add a new function to find global variables in an elf file
  (GetGlobalVariable).
- Add a new function to determine if a pc is valid for this elf (IsValidPc).

Bug: 68396769

Test: Ran new unit tests. Added new offline test that uses jit debug data.
Test: Ran art test that generates jit data and verified a crash unwinds
Test: through the jit data.
Change-Id: I6e7ee2f5bab2242028a06feece156dff21c0a974
</pre>
</div>
</content>
</entry>
<entry>
<title>Add tool to save information from a process.</title>
<updated>2017-12-20T20:57:01+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-16T04:00:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=3dfd2aea7a28faa5240cb308b9cdcca8b4025f83'/>
<id>3dfd2aea7a28faa5240cb308b9cdcca8b4025f83</id>
<content type='text'>
Also, modify the ProcessVmRead function to allow arbitrarily large
reads and add a test for it.

Test: Run tool and verify the output can be used to do an offline
Test: unwind.
Test: Ran unit tests.
Change-Id: I0974ddca4f5cf72b4c9fa29b597a0a669e223828
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also, modify the ProcessVmRead function to allow arbitrarily large
reads and add a test for it.

Test: Run tool and verify the output can be used to do an offline
Test: unwind.
Test: Ran unit tests.
Change-Id: I0974ddca4f5cf72b4c9fa29b597a0a669e223828
</pre>
</div>
</content>
</entry>
<entry>
<title>Add method to detect remote read function to use.</title>
<updated>2017-12-08T03:00:00+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-08T01:41:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=e328673a305a5c9f4acf73a7a2826eb61390632c'/>
<id>e328673a305a5c9f4acf73a7a2826eb61390632c</id>
<content type='text'>
The process_vm_read function is much faster than ptrace, but sometimes
that will not work on a remote process. Modify the libunwindstack
MemoryRemote object to figure out which one it can use.

Wrote new unit test to verify this checking behavior.

Modify libbacktrace so that the read from libunwind is used instead of
using the default ptrace calls.

Add some benchmarks to libbacktrace to compare the two different methods.

Test: Ran unit tests libbacktrace/libunwindstack/debuggerd.
Test: Ran debuggerd -b &lt;SYSTEM_SERVER_PID&gt;
Test: Ran debuggerd -b &lt;MEDIACODEC PID&gt;
Test: Ran debuggerd -b &lt;RANDOM_PID&gt;
Test: Used crasher to create tombstones and verified stack data is
Test: dumped properly.
Change-Id: If75ca238289532dd8e1de430d569cabb2523380a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The process_vm_read function is much faster than ptrace, but sometimes
that will not work on a remote process. Modify the libunwindstack
MemoryRemote object to figure out which one it can use.

Wrote new unit test to verify this checking behavior.

Modify libbacktrace so that the read from libunwind is used instead of
using the default ptrace calls.

Add some benchmarks to libbacktrace to compare the two different methods.

Test: Ran unit tests libbacktrace/libunwindstack/debuggerd.
Test: Ran debuggerd -b &lt;SYSTEM_SERVER_PID&gt;
Test: Ran debuggerd -b &lt;MEDIACODEC PID&gt;
Test: Ran debuggerd -b &lt;RANDOM_PID&gt;
Test: Used crasher to create tombstones and verified stack data is
Test: dumped properly.
Change-Id: If75ca238289532dd8e1de430d569cabb2523380a
</pre>
</div>
</content>
</entry>
<entry>
<title>Switch MemoryRemote to use ptrace.</title>
<updated>2017-12-04T22:27:34+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-04T22:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=e714ed27747a433938a02a766b8c8047a5c3b6ce'/>
<id>e714ed27747a433938a02a766b8c8047a5c3b6ce</id>
<content type='text'>
Some processes will fail to read when using process_vm_read, so switch
back to ptrace for now. For example, the system_server process only
gets two frames without this fix.

Fix up some of the remote memory read unit tests to allow passing
even when using ptrace.

Bug: 70160908

Test: All unit tests pass, debuggerd -b &lt;system_server pid&gt; works.
Change-Id: I37c67bf9c480d7268c9fe32dad6a8d78a4020b85
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some processes will fail to read when using process_vm_read, so switch
back to ptrace for now. For example, the system_server process only
gets two frames without this fix.

Fix up some of the remote memory read unit tests to allow passing
even when using ptrace.

Bug: 70160908

Test: All unit tests pass, debuggerd -b &lt;system_server pid&gt; works.
Change-Id: I37c67bf9c480d7268c9fe32dad6a8d78a4020b85
</pre>
</div>
</content>
</entry>
<entry>
<title>unwindstack: rename Memory::ReadPartially to Read.</title>
<updated>2017-11-15T23:38:13+00:00</updated>
<author>
<name>Josh Gao</name>
<email>jmgao@google.com</email>
</author>
<published>2017-10-18T18:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=b837763b494e59f8532e98d2b57a5f28ed15c5a7'/>
<id>b837763b494e59f8532e98d2b57a5f28ed15c5a7</id>
<content type='text'>
Test: mma
Test: treehugger
Change-Id: I53c2c5600fb44620b629c01db85a67789594595f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Test: mma
Test: treehugger
Change-Id: I53c2c5600fb44620b629c01db85a67789594595f
</pre>
</div>
</content>
</entry>
<entry>
<title>unwindstack: rename Memory::Read to ReadFully.</title>
<updated>2017-11-15T23:38:13+00:00</updated>
<author>
<name>Josh Gao</name>
<email>jmgao@google.com</email>
</author>
<published>2017-10-18T18:44:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=ef35aa5d40b6404baf702a58527f1cd3a9f42f19'/>
<id>ef35aa5d40b6404baf702a58527f1cd3a9f42f19</id>
<content type='text'>
Rename Memory::Read to ReadFully to match its semantics with that of
android::base. ReadPartially will be renamed to Read in a follow up
commit, kept intentionally separate so that there aren't any callers
accidentally switched from ReadFully to Read.

Test: treehugger
Change-Id: I7d845ac5244c3025d92c8512e960e5d0d1da05af
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename Memory::Read to ReadFully to match its semantics with that of
android::base. ReadPartially will be renamed to Read in a follow up
commit, kept intentionally separate so that there aren't any callers
accidentally switched from ReadFully to Read.

Test: treehugger
Change-Id: I7d845ac5244c3025d92c8512e960e5d0d1da05af
</pre>
</div>
</content>
</entry>
<entry>
<title>unwindstack: add Memory::ReadPartially.</title>
<updated>2017-11-15T23:38:13+00:00</updated>
<author>
<name>Josh Gao</name>
<email>jmgao@google.com</email>
</author>
<published>2017-09-26T21:11:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=29c5378e91720b7befabc91fbab0f25d59a23bf1'/>
<id>29c5378e91720b7befabc91fbab0f25d59a23bf1</id>
<content type='text'>
Add a way to read while allowing for partial reads.

Test: new tests added to libunwindstack_test, ran 32/64 on hikey960, sailfish
Test: ran unwind on hikey960/sailfish
Change-Id: I8b11d9230fcd3122148ef3f980863ac1404ad70a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a way to read while allowing for partial reads.

Test: new tests added to libunwindstack_test, ran 32/64 on hikey960, sailfish
Test: ran unwind on hikey960/sailfish
Change-Id: I8b11d9230fcd3122148ef3f980863ac1404ad70a
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a method to share the process memory object.</title>
<updated>2017-09-05T21:30:22+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-09-01T18:17:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=5f118519fd323a0c71b54de9279e8a9ea6a56271'/>
<id>5f118519fd323a0c71b54de9279e8a9ea6a56271</id>
<content type='text'>
New function to create the process memory object. This allows for
a future where different remote process memory objects could be created
depending on the way remote memory can be created. Even different local
memory objects that access memory without doing any checks.

It also allows MemoryRange objects to share one single process memory object
and could help if the process memory object caches data.

Small changes to MapInfo::CreateMemory to when some errors are detected.
- Always check if the map is a device map, instead of only if the name
  is not empty.
- Check if a memory map is readable before creating the memory from process
  memory.

Bug: 23762183

Test: Ran unit tests, unwound on device using the new code.
Change-Id: I12a93c2dc19639689a528ec41c67bfac74d431b3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
New function to create the process memory object. This allows for
a future where different remote process memory objects could be created
depending on the way remote memory can be created. Even different local
memory objects that access memory without doing any checks.

It also allows MemoryRange objects to share one single process memory object
and could help if the process memory object caches data.

Small changes to MapInfo::CreateMemory to when some errors are detected.
- Always check if the map is a device map, instead of only if the name
  is not empty.
- Check if a memory map is readable before creating the memory from process
  memory.

Bug: 23762183

Test: Ran unit tests, unwound on device using the new code.
Change-Id: I12a93c2dc19639689a528ec41c67bfac74d431b3
</pre>
</div>
</content>
</entry>
<entry>
<title>Make the library usable as a library.</title>
<updated>2017-07-14T19:20:23+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-07-14T17:37:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=d226a5140989f509a0ed3e2723f05d5fc93ce8df'/>
<id>d226a5140989f509a0ed3e2723f05d5fc93ce8df</id>
<content type='text'>
- Add namespace unwindstack everywhere so that it's easier for other
  code to use the library.
- Move some of the header files into include/unwindstack so that they
  can be exposed.
- Modify the headers so that only a limited number need to be exposed.
- Update the tools to use the new headers.
- Add a GetLoadBias() call on the Elf object. This prevents the need
  to get the interface object out of the Elf object.
- Move the GetRelPc() call out of the Reg class, to the Elf class. It's
  not always the case that a Reg object will be around when you want to
  get a relative pc. The tests for this moved to ElfTest.cpp.

Bug: 23762183

Test: Unit tests pass.
Change-Id: Iac609dac1dd90ed83d1a1e24ff2579c96c023bc3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add namespace unwindstack everywhere so that it's easier for other
  code to use the library.
- Move some of the header files into include/unwindstack so that they
  can be exposed.
- Modify the headers so that only a limited number need to be exposed.
- Update the tools to use the new headers.
- Add a GetLoadBias() call on the Elf object. This prevents the need
  to get the interface object out of the Elf object.
- Move the GetRelPc() call out of the Reg class, to the Elf class. It's
  not always the case that a Reg object will be around when you want to
  get a relative pc. The tests for this moved to ElfTest.cpp.

Bug: 23762183

Test: Unit tests pass.
Change-Id: Iac609dac1dd90ed83d1a1e24ff2579c96c023bc3
</pre>
</div>
</content>
</entry>
</feed>
