Commit 8e1c75c9 authored by Tom Rini's avatar Tom Rini

PPC32: A number of minor KGDB fixes and tweaks.

parent ee49cccc
...@@ -2207,7 +2207,7 @@ static void my_console_write(int idx, const char *s, ...@@ -2207,7 +2207,7 @@ static void my_console_write(int idx, const char *s,
static void serial_console_write(struct console *c, const char *s, static void serial_console_write(struct console *c, const char *s,
unsigned count) unsigned count)
{ {
#if defined(CONFIG_KGDB) && !defined(CONFIG_USE_SERIAL2_KGDB) #if defined(CONFIG_KGDB_CONSOLE) && !defined(CONFIG_USE_SERIAL2_KGDB)
/* Try to let stub handle output. Returns true if it did. */ /* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count)) if (kgdb_output_string(s, count))
return; return;
......
...@@ -1068,7 +1068,7 @@ static int rs_8xx_write(struct tty_struct * tty, int from_user, ...@@ -1068,7 +1068,7 @@ static int rs_8xx_write(struct tty_struct * tty, int from_user,
volatile cbd_t *bdp; volatile cbd_t *bdp;
unsigned char *cp; unsigned char *cp;
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */ /* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(buf, count)) if (kgdb_output_string(buf, count))
return ret; return ret;
...@@ -2271,7 +2271,7 @@ static void my_console_write(int idx, const char *s, ...@@ -2271,7 +2271,7 @@ static void my_console_write(int idx, const char *s,
static void serial_console_write(struct console *c, const char *s, static void serial_console_write(struct console *c, const char *s,
unsigned count) unsigned count)
{ {
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */ /* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count)) if (kgdb_output_string(s, count))
return; return;
......
...@@ -1426,20 +1426,12 @@ config DEBUG_SPINLOCK_SLEEP ...@@ -1426,20 +1426,12 @@ config DEBUG_SPINLOCK_SLEEP
config KGDB config KGDB
bool "Include kgdb kernel debugger" bool "Include kgdb kernel debugger"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
select DEBUG_INFO
help help
Include in-kernel hooks for kgdb, the Linux kernel source level Include in-kernel hooks for kgdb, the Linux kernel source level
debugger. See <http://kgdb.sourceforge.net/> for more information. debugger. See <http://kgdb.sourceforge.net/> for more information.
Unless you are intending to debug the kernel, say N here. Unless you are intending to debug the kernel, say N here.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
choice choice
prompt "Serial Port" prompt "Serial Port"
depends on KGDB depends on KGDB
...@@ -1459,6 +1451,14 @@ config KGDB_TTYS3 ...@@ -1459,6 +1451,14 @@ config KGDB_TTYS3
endchoice endchoice
config KGDB_CONSOLE
bool "Enable serial console thru kgdb port"
depends on KGDB && 8xx || 8260
help
If you enable this, all serial console messages will be sent
over the gdb stub.
If unsure, say N.
config XMON config XMON
bool "Include xmon kernel debugger" bool "Include xmon kernel debugger"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
...@@ -1474,18 +1474,16 @@ config BDI_SWITCH ...@@ -1474,18 +1474,16 @@ config BDI_SWITCH
Unless you are intending to debug the kernel with one of these Unless you are intending to debug the kernel with one of these
machines, say N here. machines, say N here.
config MORE_COMPILE_OPTIONS config DEBUG_INFO
bool "Add any additional compile options" bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL && (KGDB || XMON || BDI_SWITCH) depends on DEBUG_KERNEL
default y if BDI_SWITCH || XMON
help help
If you want to add additional CFLAGS to the kernel build, such as -g If you say Y here the resulting kernel image will include
for KGDB or the BDI2000, enable this option and then enter what you debugging info resulting in a larger kernel image.
would like to add in the next question. Say Y here only if you plan to use some sort of debugger to
debug the kernel.
config COMPILE_OPTIONS If you don't debug the kernel, you can say N.
string "Additional compile arguments"
depends on MORE_COMPILE_OPTIONS
default "-g -ggdb"
config BOOTX_TEXT config BOOTX_TEXT
bool "Support for early boot text console (BootX or OpenFirmware only)" bool "Support for early boot text console (BootX or OpenFirmware only)"
......
...@@ -22,9 +22,6 @@ CPP = $(CC) -E $(CFLAGS) ...@@ -22,9 +22,6 @@ CPP = $(CC) -E $(CFLAGS)
cflags-$(CONFIG_4xx) += -Wa,-m405 cflags-$(CONFIG_4xx) += -Wa,-m405
cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
# Use sed to remove the quotes.
cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
$(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
CFLAGS += $(cflags-y) CFLAGS += $(cflags-y)
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <asm/cacheflush.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/signal.h> #include <asm/signal.h>
#include <asm/kgdb.h> #include <asm/kgdb.h>
...@@ -186,7 +187,7 @@ hex(unsigned char ch) ...@@ -186,7 +187,7 @@ hex(unsigned char ch)
* return 0. * return 0.
*/ */
static unsigned char * static unsigned char *
mem2hex(char *mem, char *buf, int count) mem2hex(const char *mem, char *buf, int count)
{ {
unsigned char ch; unsigned char ch;
unsigned short tmp_s; unsigned short tmp_s;
...@@ -828,11 +829,11 @@ breakpoint(void) ...@@ -828,11 +829,11 @@ breakpoint(void)
return; return;
} }
asm(" .globl breakinst asm(" .globl breakinst \n\
breakinst: .long 0x7d821008 breakinst: .long 0x7d821008");
");
} }
#ifdef CONFIG_KGDB_CONSOLE
/* Output string in GDB O-packet format if GDB has connected. If nothing /* Output string in GDB O-packet format if GDB has connected. If nothing
output, returns 0 (caller must then handle output). */ output, returns 0 (caller must then handle output). */
int int
...@@ -852,3 +853,4 @@ kgdb_output_string (const char* s, unsigned int count) ...@@ -852,3 +853,4 @@ kgdb_output_string (const char* s, unsigned int count)
return 1; return 1;
} }
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment