summaryrefslogtreecommitdiff
path: root/gdb/arc-elf32-tdep.h
blob: eb7d3e9497b3b4f98267a16e4a2c66e2c4c847ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* Target dependent code for ARC processor family, for GDB, the GNU debugger.

   Copyright 2008, 2009 Free Software Foundation, Inc.

   Contributed by ARC International (www.arc.com)

   Authors:
      Richard Stuckey <richard.stuckey@arc.com>

   This file is part of GDB.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/******************************************************************************/
/*                                                                            */
/* Outline:                                                                   */
/*     This header file defines an initialization function for the arc_elf32  */
/*     architecture, and various operations which are useful for the various  */
/*     arc-elf32 targets supported.                                           */
/*                                                                            */
/******************************************************************************/

#ifndef ARC_ELF32_TDEP_H
#define ARC_ELF32_TDEP_H

/* gdb header files */
#include "defs.h"
#include "gdbarch.h"
#include "target.h"
#include "breakpoint.h"

/* ARC header files */
#include "arc-registers.h"
#include "arc-architecture.h"


/* Complete the structure definition here.  */
struct arc_variant_info
{
    ARC_ProcessorVersion processor_version;
    ARC_RegisterInfo     registers;
};


typedef enum
{
    REGISTER_IS_READ_ONLY,
    ERROR_ON_READING_REGISTER,
    ERROR_ON_WRITING_REGISTER
} RegisterError;


typedef void (*ProcessorControlFunction)(void);


struct gdbarch* arc_elf32_initialize (struct gdbarch      *gdbarch,
                                      struct gdbarch_list *arches);

void arc_check_pc_defined (struct gdbarch *gdbarch);

void arc_elf32_find_register_numbers (void);

void arc_elf32_load_program (char *filename, int from_tty);

void arc_elf32_create_inferior (char              *exec_file,
                                char              *args,
                                char             **env,
                                struct target_ops *target_ops);

void arc_elf32_execute (struct target_waitstatus *status,
                        ProcessorControlFunction  run_processor,
                        ProcessorControlFunction  start_processor,
                        ProcessorControlFunction  stop_processor);

void arc_elf32_close (Boolean resume);

void arc_elf32_fetch_registers (struct regcache *regcache, int gdb_regno);
void arc_elf32_store_registers (struct regcache *regcache, int gdb_regno);

int arc_elf32_insert_breakpoint (struct bp_target_info *bpt);
int arc_elf32_remove_breakpoint (struct bp_target_info *bpt);

LONGEST arc_elf32_xfer_partial (struct target_ops *ops,
                                enum target_object object,
                                const char        *annex,
                                gdb_byte          *readbuf,
                                const gdb_byte    *writebuf,
                                ULONGEST           offset,
                                LONGEST            len);

void arc_elf32_core_warning (RegisterError      error,
                             ARC_RegisterNumber hw_regno);

void arc_elf32_aux_warning (RegisterError      error,
                            ARC_RegisterNumber hw_regno);


extern ARC_RegisterNumber arc_debug_regnum;
extern ARC_RegisterNumber arc_pc_regnum;
extern ARC_RegisterNumber arc_status32_regnum;

extern Boolean arc_program_is_loaded;
extern Boolean arc_target_is_connected;


#endif /* ARC_ELF32_TDEP_H */
/******************************************************************************/