summaryrefslogtreecommitdiffstats
path: root/debuggerd/x86/machine.c
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-06-08 15:27:01 -0700
committerJeff Brown <jeffbrown@google.com>2012-06-08 15:27:01 -0700
commit536b81afed42ba6be1f824cf90d9a1e17a913c9c (patch)
treeae87781b25cacf61c784d1881e421c9ed8c007b2 /debuggerd/x86/machine.c
parentd96544ff69601fe2990245e10e054480f0bd341f (diff)
parent053b865412d1982ad1dc0e840898d82527deeb99 (diff)
downloadsystem_core-536b81afed42ba6be1f824cf90d9a1e17a913c9c.zip
system_core-536b81afed42ba6be1f824cf90d9a1e17a913c9c.tar.gz
system_core-536b81afed42ba6be1f824cf90d9a1e17a913c9c.tar.bz2
resolved conflicts for merge of 053b8654 to jb-dev-plus-aosp
Change-Id: Idfef8c26b7a9e1a1a202e21dc5d34022bbaa92cc
Diffstat (limited to 'debuggerd/x86/machine.c')
-rw-r--r--debuggerd/x86/machine.c49
1 files changed, 17 insertions, 32 deletions
diff --git a/debuggerd/x86/machine.c b/debuggerd/x86/machine.c
index 2729c7e..01da5fe 100644
--- a/debuggerd/x86/machine.c
+++ b/debuggerd/x86/machine.c
@@ -15,59 +15,44 @@
** limitations under the License.
*/
+#include <stddef.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
#include <stdio.h>
#include <errno.h>
-#include <signal.h>
-#include <pthread.h>
-#include <fcntl.h>
#include <sys/types.h>
-#include <dirent.h>
-
#include <sys/ptrace.h>
-#include <sys/wait.h>
-#include <sys/exec_elf.h>
-#include <sys/stat.h>
-
-#include <cutils/sockets.h>
-#include <cutils/properties.h>
-#include <corkscrew/backtrace.h>
#include <corkscrew/ptrace.h>
-#include <linux/input.h>
+#include <linux/user.h>
-#include "../machine.h"
#include "../utility.h"
+#include "../machine.h"
+
+void dump_memory_and_code(const ptrace_context_t* context __attribute((unused)),
+ log_t* log, pid_t tid, bool at_fault) {
+}
-static void dump_registers(const ptrace_context_t* context __attribute((unused)),
- int tfd, pid_t tid, bool at_fault) {
+void dump_registers(const ptrace_context_t* context __attribute((unused)),
+ log_t* log, pid_t tid, bool at_fault) {
struct pt_regs_x86 r;
bool only_in_tombstone = !at_fault;
if(ptrace(PTRACE_GETREGS, tid, 0, &r)) {
- _LOG(tfd, only_in_tombstone, "cannot get registers: %s\n", strerror(errno));
+ _LOG(log, only_in_tombstone, "cannot get registers: %s\n", strerror(errno));
return;
}
//if there is no stack, no print just like arm
if(!r.ebp)
return;
- _LOG(tfd, only_in_tombstone, " eax %08x ebx %08x ecx %08x edx %08x\n",
+ _LOG(log, only_in_tombstone, " eax %08x ebx %08x ecx %08x edx %08x\n",
r.eax, r.ebx, r.ecx, r.edx);
- _LOG(tfd, only_in_tombstone, " esi %08x edi %08x\n",
+ _LOG(log, only_in_tombstone, " esi %08x edi %08x\n",
r.esi, r.edi);
- _LOG(tfd, only_in_tombstone, " xcs %08x xds %08x xes %08x xfs %08x xss %08x\n",
+ _LOG(log, only_in_tombstone, " xcs %08x xds %08x xes %08x xfs %08x xss %08x\n",
r.xcs, r.xds, r.xes, r.xfs, r.xss);
- _LOG(tfd, only_in_tombstone, " eip %08x ebp %08x esp %08x flags %08x\n",
+ _LOG(log, only_in_tombstone, " eip %08x ebp %08x esp %08x flags %08x\n",
r.eip, r.ebp, r.esp, r.eflags);
}
-
-void dump_thread(const ptrace_context_t* context, int tfd, pid_t tid, bool at_fault) {
- dump_registers(context, tfd, tid, at_fault);
-
- dump_backtrace_and_stack(context, tfd, tid, at_fault);
-
- if (at_fault) {
- dump_nearby_maps(context, tfd, tid);
- }
-}
-