]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[gdb] Allow CPU architectures to omit support for GDB
authorMichael Brown <mcb30@ipxe.org>
Wed, 4 Sep 2024 12:29:30 +0000 (13:29 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 5 Sep 2024 12:00:39 +0000 (13:00 +0100)
Move the <gdbmach.h> file to <bits/gdbmach.h>, and provide a common
dummy implementation for all architectures that have not yet
implemented support for GDB.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/arm64/include/gdbmach.h [deleted file]
src/arch/i386/include/bits/gdbmach.h [moved from src/arch/i386/include/gdbmach.h with 100% similarity]
src/arch/loong64/include/gdbmach.h [deleted file]
src/arch/x86/core/gdbmach.c
src/arch/x86_64/include/bits/gdbmach.h [moved from src/arch/x86_64/include/gdbmach.h with 100% similarity]
src/core/gdbstub.c
src/include/bits/gdbmach.h [moved from src/arch/arm32/include/gdbmach.h with 76% similarity]
src/include/ipxe/gdbstub.h

diff --git a/src/arch/arm64/include/gdbmach.h b/src/arch/arm64/include/gdbmach.h
deleted file mode 100644 (file)
index cd152ee..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef GDBMACH_H
-#define GDBMACH_H
-
-/** @file
- *
- * GDB architecture specifics
- *
- * This file declares functions for manipulating the machine state and
- * debugging context.
- *
- */
-
-#include <stdint.h>
-
-typedef unsigned long gdbreg_t;
-
-/* Register snapshot */
-enum {
-       /* Not yet implemented */
-       GDBMACH_NREGS,
-};
-
-#define GDBMACH_SIZEOF_REGS ( GDBMACH_NREGS * sizeof ( gdbreg_t ) )
-
-static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
-       /* Not yet implemented */
-       ( void ) regs;
-       ( void ) pc;
-}
-
-static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) {
-       /* Not yet implemented */
-       ( void ) regs;
-       ( void ) step;
-}
-
-static inline void gdbmach_breakpoint ( void ) {
-       /* Not yet implemented */
-}
-
-extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len,
-                                   int enable );
-extern void gdbmach_init ( void );
-
-#endif /* GDBMACH_H */
diff --git a/src/arch/loong64/include/gdbmach.h b/src/arch/loong64/include/gdbmach.h
deleted file mode 100644 (file)
index cd152ee..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef GDBMACH_H
-#define GDBMACH_H
-
-/** @file
- *
- * GDB architecture specifics
- *
- * This file declares functions for manipulating the machine state and
- * debugging context.
- *
- */
-
-#include <stdint.h>
-
-typedef unsigned long gdbreg_t;
-
-/* Register snapshot */
-enum {
-       /* Not yet implemented */
-       GDBMACH_NREGS,
-};
-
-#define GDBMACH_SIZEOF_REGS ( GDBMACH_NREGS * sizeof ( gdbreg_t ) )
-
-static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
-       /* Not yet implemented */
-       ( void ) regs;
-       ( void ) pc;
-}
-
-static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) {
-       /* Not yet implemented */
-       ( void ) regs;
-       ( void ) step;
-}
-
-static inline void gdbmach_breakpoint ( void ) {
-       /* Not yet implemented */
-}
-
-extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len,
-                                   int enable );
-extern void gdbmach_init ( void );
-
-#endif /* GDBMACH_H */
index af6abfedd6c48eb8d0313fa39a3eda4bc3b14649..d4d187e3551fa226d06711e20fa17b6f8d8072c2 100644 (file)
@@ -31,7 +31,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <ipxe/uaccess.h>
 #include <ipxe/gdbstub.h>
 #include <librm.h>
-#include <gdbmach.h>
 
 /** @file
  *
index 8b57ddf5645091a5af3b83e739d095923e72f72e..d668f454aa23b4a7d0366b7aa309290551c8dc8c 100644 (file)
@@ -36,7 +36,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <ctype.h>
 #include <byteswap.h>
 #include <ipxe/gdbstub.h>
-#include "gdbmach.h"
 
 enum {
        POSIX_EINVAL = 0x1c,  /* used to report bad arguments to GDB */
similarity index 76%
rename from src/arch/arm32/include/gdbmach.h
rename to src/include/bits/gdbmach.h
index cd152eedda16ee1177cb0bca5c5f28444c5f9a00..7e349856f2ccc10c309947fdc69e733293137666 100644 (file)
@@ -1,12 +1,12 @@
-#ifndef GDBMACH_H
-#define GDBMACH_H
+#ifndef _BITS_GDBMACH_H
+#define _BITS_GDBMACH_H
 
 /** @file
  *
- * GDB architecture specifics
+ * Dummy GDB architecture specifics
  *
- * This file declares functions for manipulating the machine state and
- * debugging context.
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
  *
  */
 
@@ -42,4 +42,4 @@ extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len,
                                    int enable );
 extern void gdbmach_init ( void );
 
-#endif /* GDBMACH_H */
+#endif /* _BITS_GDBMACH_H */
index 13ca33ddb28211c8dcadaf009f63092a8225ff57..2240cca42d0fb65322c4e34459638e74a84d0d14 100644 (file)
@@ -11,7 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #include <stdint.h>
 #include <ipxe/tables.h>
-#include <gdbmach.h>
+#include <bits/gdbmach.h>
 
 /**
  * A transport mechanism for the GDB protocol