summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2007-06-30 23:43:31 +0200
committerMichael Brown2007-06-30 23:43:31 +0200
commit8f6a4e81406c384cb3e8bdd0e9386581d6d2f11e (patch)
treebd7b2cde7f1c89124a9207177ba4f42e455acd22 /src/arch
parentPlace the actual version string in .data16, rather than just the (diff)
downloadipxe-8f6a4e81406c384cb3e8bdd0e9386581d6d2f11e.tar.gz
ipxe-8f6a4e81406c384cb3e8bdd0e9386581d6d2f11e.tar.xz
ipxe-8f6a4e81406c384cb3e8bdd0e9386581d6d2f11e.zip
Add gdbsym.c object to help with running gdb-to-qemu
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/i386/core/gdbsym.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/arch/i386/core/gdbsym.c b/src/arch/i386/core/gdbsym.c
new file mode 100644
index 000000000..51f48edfb
--- /dev/null
+++ b/src/arch/i386/core/gdbsym.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <gpxe/init.h>
+#include <console.h>
+#include <realmode.h>
+
+extern char __text[];
+extern char __rodata[];
+extern char __data[];
+extern char __bss[];
+extern char __text16[];
+extern char __data16[];
+
+
+static void gdb_symbol_line ( void ) {
+ printf ( "Commands to start up gdb:\n\n" );
+ printf ( "gdb\n" );
+ printf ( "target remote localhost:1234\n" );
+ printf ( "add-symbol-file symbols %#lx", virt_to_phys ( __text ) );
+ printf ( " -s .rodata %#lx", virt_to_phys ( __rodata ) );
+ printf ( " -s .data %#lx", virt_to_phys ( __data ) );
+ printf ( " -s .bss %#lx", virt_to_phys ( __bss ) );
+ printf ( " -s .text16 %#x", ( ( rm_cs << 4 ) + (int)__text16 ) );
+ printf ( " -s .data16 %#x", ( ( rm_ds << 4 ) + (int)__data16 ) );
+ printf ( "\n" );
+ getkey();
+}
+
+INIT_FN ( INIT_GDBSYM, gdb_symbol_line, NULL, NULL );