xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/gcore-elf.h (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
1*6881a400Schristos /* Copyright (C) 2021-2023 Free Software Foundation, Inc.
2*6881a400Schristos 
3*6881a400Schristos    This file is part of GDB.
4*6881a400Schristos 
5*6881a400Schristos    This program is free software; you can redistribute it and/or modify
6*6881a400Schristos    it under the terms of the GNU General Public License as published by
7*6881a400Schristos    the Free Software Foundation; either version 3 of the License, or
8*6881a400Schristos    (at your option) any later version.
9*6881a400Schristos 
10*6881a400Schristos    This program is distributed in the hope that it will be useful,
11*6881a400Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
12*6881a400Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*6881a400Schristos    GNU General Public License for more details.
14*6881a400Schristos 
15*6881a400Schristos    You should have received a copy of the GNU General Public License
16*6881a400Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17*6881a400Schristos 
18*6881a400Schristos /* This file contains generic functions for writing ELF based core files.  */
19*6881a400Schristos 
20*6881a400Schristos #if !defined (GCORE_ELF_H)
21*6881a400Schristos #define GCORE_ELF_H 1
22*6881a400Schristos 
23*6881a400Schristos #include "gdb_bfd.h"
24*6881a400Schristos #include "gdbsupport/gdb_signals.h"
25*6881a400Schristos #include "gcore.h"
26*6881a400Schristos 
27*6881a400Schristos struct gdbarch;
28*6881a400Schristos struct thread_info;
29*6881a400Schristos 
30*6881a400Schristos /* Add content to *NOTE_DATA (and update *NOTE_SIZE) to describe the
31*6881a400Schristos    registers of thread INFO.  Report the thread as having stopped with
32*6881a400Schristos    STOP_SIGNAL.  The core file is being written to OBFD, and GDBARCH is the
33*6881a400Schristos    architecture for which the core file is being generated.  */
34*6881a400Schristos 
35*6881a400Schristos extern void gcore_elf_build_thread_register_notes
36*6881a400Schristos   (struct gdbarch *gdbarch, struct thread_info *info, gdb_signal stop_signal,
37*6881a400Schristos    bfd *obfd, gdb::unique_xmalloc_ptr<char> *note_data, int *note_size);
38*6881a400Schristos 
39*6881a400Schristos /* Add content to *NOTE_DATA (and update *NOTE_SIZE) to include a note
40*6881a400Schristos    containing the current targtet's target description.  The core file is
41*6881a400Schristos    being written to OBFD.  If something goes wrong then *NOTE_DATA can be
42*6881a400Schristos    set to nullptr.  */
43*6881a400Schristos 
44*6881a400Schristos extern void gcore_elf_make_tdesc_note
45*6881a400Schristos   (bfd *obfd, gdb::unique_xmalloc_ptr<char> *note_data, int *note_size);
46*6881a400Schristos 
47*6881a400Schristos #endif /* GCORE_ELF_H */
48