blob: 542dda545f533c6c1f093ed524529ba7e5e8dd69 [file] [log] [blame]
Petr Machatae99af272012-10-26 00:29:52 +02001/*
2 * This file is part of ltrace.
Petr Machata4392d962012-12-14 14:17:12 +01003 * Copyright (C) 2012 Petr Machata, Red Hat Inc.
Petr Machatae99af272012-10-26 00:29:52 +02004 * Copyright (C) 2003,2009 Juan Cespedes
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */
21
Arnaud Patardca233082010-01-08 08:40:00 -050022#ifndef _DEBUG_H
23#define _DEBUG_H
24
Petr Machata4392d962012-12-14 14:17:12 +010025#include "backend.h"
26#include "forward.h"
27
Juan Cespedescd8976d2009-05-14 13:47:58 +020028/* debug levels:
29 */
30enum {
Juan Cespedesc5c744a2009-07-23 18:22:58 +020031 DEBUG_EVENT = 010,
32 DEBUG_PROCESS = 020,
33 DEBUG_FUNCTION = 040
Juan Cespedescd8976d2009-05-14 13:47:58 +020034};
35
36void debug_(int level, const char *file, int line,
37 const char *fmt, ...) __attribute__((format(printf,4,5)));
Ian Wienand9a2ad352006-02-20 22:44:45 +010038
Petr Machata4392d962012-12-14 14:17:12 +010039/* Dump LENGTH bytes of memory starting on address ADDR of inferior
40 * PID. */
Petr Machata929bd572012-12-17 03:20:34 +010041int xinfdump(struct process *proc, arch_addr_t addr, size_t length);
Ian Wienand9a2ad352006-02-20 22:44:45 +010042
Petr Machata4392d962012-12-14 14:17:12 +010043#define debug(level, expr...) debug_(level, __FILE__, __LINE__, expr)
Juan Cespedescac15c32003-01-31 18:58:58 +010044
Arnaud Patardca233082010-01-08 08:40:00 -050045#endif