|
@@ -0,0 +1,28 @@
|
|
1
|
+#include <stdio.h>
|
|
2
|
+#include <gpxe/init.h>
|
|
3
|
+#include <console.h>
|
|
4
|
+#include <realmode.h>
|
|
5
|
+
|
|
6
|
+extern char __text[];
|
|
7
|
+extern char __rodata[];
|
|
8
|
+extern char __data[];
|
|
9
|
+extern char __bss[];
|
|
10
|
+extern char __text16[];
|
|
11
|
+extern char __data16[];
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+static void gdb_symbol_line ( void ) {
|
|
15
|
+ printf ( "Commands to start up gdb:\n\n" );
|
|
16
|
+ printf ( "gdb\n" );
|
|
17
|
+ printf ( "target remote localhost:1234\n" );
|
|
18
|
+ printf ( "add-symbol-file symbols %#lx", virt_to_phys ( __text ) );
|
|
19
|
+ printf ( " -s .rodata %#lx", virt_to_phys ( __rodata ) );
|
|
20
|
+ printf ( " -s .data %#lx", virt_to_phys ( __data ) );
|
|
21
|
+ printf ( " -s .bss %#lx", virt_to_phys ( __bss ) );
|
|
22
|
+ printf ( " -s .text16 %#x", ( ( rm_cs << 4 ) + (int)__text16 ) );
|
|
23
|
+ printf ( " -s .data16 %#x", ( ( rm_ds << 4 ) + (int)__data16 ) );
|
|
24
|
+ printf ( "\n" );
|
|
25
|
+ getkey();
|
|
26
|
+}
|
|
27
|
+
|
|
28
|
+INIT_FN ( INIT_GDBSYM, gdb_symbol_line, NULL, NULL );
|