diff options
author | Anton Kolesov <Anton.Kolesov@synopsys.com> | 2017-01-30 18:32:10 +0300 |
---|---|---|
committer | Shahab Vahedi <shahab@synopsys.com> | 2020-10-07 18:08:56 +0200 |
commit | cc463201c4bbe5d0708ef4b45b17fb7c3fed6aee (patch) | |
tree | 0c77080c27a27c9b3f02a506734b3709a1ee5859 /gdb/arc-linux-tdep.h | |
parent | 6d2d7c5668f99d1fe9a8da643a43c824b104b337 (diff) | |
download | gdb-cc463201c4bbe5d0708ef4b45b17fb7c3fed6aee.zip gdb-cc463201c4bbe5d0708ef4b45b17fb7c3fed6aee.tar.gz gdb-cc463201c4bbe5d0708ef4b45b17fb7c3fed6aee.tar.bz2 |
arc: Add support for Linux coredump files
With the implemenations in this patch, ARC gdb can handle
coredump related matters. The binutils counter part of
this patch has already been pushed [1].
v2 [2]:
- arc_linux_collect_gregset: Use "reg <= ARC_LAST_REGNUM" instead of
"reg < ARC_LAST_REGNUM" for the condition check of the for-loop.
- arc-linux-tdep.c: Use "ARC_LAST_REGNUM < ARRAY_SIZE (...)" instead of
"ARC_LAST_REGNUM <= ARRAY_SIZE (...)" for the "asserts".
- Use "buf + arc_linux_core_reg_offsets[ARC_ERET_REGNUM]" instead of
"buf + REG_OFF (6)".
- Fix a few typos/indentation.
v3 [3]:
- Use gdb_assert_not_reached(text) instead of gdb_assert (!text).
- Remove unnecessary braces in the for loop.
[1] arc: Add support for ARC HS extra registers in core files
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=2745674244d6aecddcf636475034bdb9c0a6b4a0
[2] First remarks
https://sourceware.org/pipermail/gdb-patches/2020-September/171912.html
[3] Second remarks
https://sourceware.org/pipermail/gdb-patches/2020-October/172302.html
gdb/ChangeLog:
* arc-linux-tdep.h: New file.
* arc-linux-tdep.c (arc_linux_core_reg_offsets,
arc_linux_supply_gregset, arc_linux_supply_v2_regset,
arc_linux_collect_gregset, arc_linux_collect_v2_regset,
arc_linux_gregset, arc_linux_v2_regset,
arc_linux_iterate_over_regset_sections,
arc_linux_core_read_description): Implement.
(arc_linux_init_osabi): Set iterate_over_regset_sections.
* arc-tdep.h (ARC_OFFSET_NO_REGISTER): Declare.
(arc_gdbarch_features_create): Add.
* arc-tdep.c (arc_gdbarch_features_create): Not static anymore.
Diffstat (limited to 'gdb/arc-linux-tdep.h')
-rw-r--r-- | gdb/arc-linux-tdep.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gdb/arc-linux-tdep.h b/gdb/arc-linux-tdep.h new file mode 100644 index 0000000..c26cacd --- /dev/null +++ b/gdb/arc-linux-tdep.h @@ -0,0 +1,52 @@ +/* Target dependent code for GNU/Linux ARC. + + Copyright 2020 Free Software Foundation, Inc. + + 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/>. */ + +#ifndef ARC_LINUX_TDEP_H +#define ARC_LINUX_TDEP_H + +#include "gdbarch.h" +#include "regset.h" + +#define ARC_LINUX_SIZEOF_V2_REGSET (3 * ARC_REGISTER_SIZE) + +/* Reads registers from the NT_PRSTATUS data array into the regcache. */ + +void arc_linux_supply_gregset (const struct regset *regset, + struct regcache *regcache, int regnum, + const void *gregs, size_t size); + +/* Reads regsiters from the NT_ARC_V2 data array into the regcache. */ + +void arc_linux_supply_v2_regset (const struct regset *regset, + struct regcache *regcache, int regnum, + const void *v2_regs, size_t size); + +/* Writes registers from the regcache into the NT_PRSTATUS data array. */ + +void arc_linux_collect_gregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *gregs, size_t size); + +/* Writes registers from the regcache into the NT_ARC_V2 data array. */ + +void arc_linux_collect_v2_regset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *v2_regs, size_t size); + +#endif /* ARC_LINUX_TDEP_H */ |