2 * Copyright (C) 2012 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CUTILS_DEBUGGER_H
18 #define __CUTILS_DEBUGGER_H
20 #include <sys/types.h>
26 #define DEBUGGER_SOCKET_NAME "android:debuggerd"
30 DEBUGGER_ACTION_CRASH
,
31 // dump a tombstone file
32 DEBUGGER_ACTION_DUMP_TOMBSTONE
,
33 // dump a backtrace only back to the socket
34 DEBUGGER_ACTION_DUMP_BACKTRACE
,
37 /* message sent over the socket */
39 debugger_action_t action
;
43 /* Dumps a process backtrace, registers, and stack to a tombstone file (requires root).
44 * Stores the tombstone path in the provided buffer.
45 * Returns 0 on success, -1 on error.
47 int dump_tombstone(pid_t tid
, char* pathbuf
, size_t pathlen
);
49 /* Dumps a process backtrace only to the specified file (requires root).
50 * Returns 0 on success, -1 on error.
52 int dump_backtrace_to_file(pid_t tid
, int fd
);
58 #endif /* __CUTILS_DEBUGGER_H */