blob: e51a2e7942e6e42f61a35687e8a77b856edc927b [file] [log] [blame]
Furquan Shaikhf8f77732014-06-20 00:19:31 -07001/*
2 * Copyright 2014 Google Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but without any warranty; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Furquan Shaikhf8f77732014-06-20 00:19:31 -070013 */
14
15#include <exception.h>
16#include <gdb.h>
17#include <libpayload.h>
18
19struct gdb_regs
20{
21 u64 x[32];
22 struct fp_reg
23 {
24 u64 quad[2];
25 } __attribute__((packed)) f[32];
26 u32 fpcr;
27 u32 fpsr;
28 u32 spsr;
29} __attribute__((packed));
30
31static const u8 type_to_signal[] = {
Furquan Shaikh3b1ee032014-08-27 21:43:36 -070032 [EXC_SYNC_SP0] = GDB_SIGTRAP,
33 [EXC_IRQ_SP0] = GDB_SIGSEGV,
34 [EXC_FIQ_SP0] = GDB_SIGSEGV,
35 [EXC_SERROR_SP0] = GDB_SIGSEGV,
36 [EXC_SYNC_SPX] = GDB_SIGTRAP,
37 [EXC_IRQ_SPX] = GDB_SIGSEGV,
38 [EXC_FIQ_SPX] = GDB_SIGSEGV,
39 [EXC_SERROR_SPX] = GDB_SIGSEGV,
40 [EXC_SYNC_ELX_64] = GDB_SIGTRAP,
41 [EXC_IRQ_ELX_64] = GDB_SIGSEGV,
42 [EXC_FIQ_ELX_64] = GDB_SIGSEGV,
43 [EXC_SERROR_ELX_64] = GDB_SIGSEGV,
44 [EXC_SYNC_ELX_32] = GDB_SIGTRAP,
45 [EXC_IRQ_ELX_32] = GDB_SIGSEGV,
46 [EXC_FIQ_ELX_32] = GDB_SIGSEGV,
47 [EXC_SERROR_ELX_32] = GDB_SIGSEGV
Furquan Shaikhf8f77732014-06-20 00:19:31 -070048};
49
50static int gdb_exception_hook(u32 type)
51{
52 return -1;
53}
54
55void gdb_arch_init(void)
56{
57 exception_install_hook(&gdb_exception_hook);
58}
59
60void gdb_arch_enter(void)
61{
62}
63
64int gdb_arch_set_single_step(int on)
65{
66 /* GDB seems to only need this on x86, ARM works fine without it. */
67 return -1;
68}
69
70void gdb_arch_encode_regs(struct gdb_message *message)
71{
72}
73
74void gdb_arch_decode_regs(int offset, struct gdb_message *message)
75{
76}