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,
static void serial_console_write(struct console *c, const char *s,
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. */
if (kgdb_output_string(s, count))
return;
......
......@@ -1068,7 +1068,7 @@ static int rs_8xx_write(struct tty_struct * tty, int from_user,
volatile cbd_t *bdp;
unsigned char *cp;
#ifdef CONFIG_KGDB
#ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(buf, count))
return ret;
......@@ -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,
unsigned count)
{
#ifdef CONFIG_KGDB
#ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count))
return;
......
......@@ -1426,20 +1426,12 @@ config DEBUG_SPINLOCK_SLEEP
config KGDB
bool "Include kgdb kernel debugger"
depends on DEBUG_KERNEL
select DEBUG_INFO
help
Include in-kernel hooks for kgdb, the Linux kernel source level
debugger. See <http://kgdb.sourceforge.net/> for more information.
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
prompt "Serial Port"
depends on KGDB
......@@ -1459,6 +1451,14 @@ config KGDB_TTYS3
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
bool "Include xmon kernel debugger"
depends on DEBUG_KERNEL
......@@ -1474,18 +1474,16 @@ config BDI_SWITCH
Unless you are intending to debug the kernel with one of these
machines, say N here.
config MORE_COMPILE_OPTIONS
bool "Add any additional compile options"
depends on DEBUG_KERNEL && (KGDB || XMON || BDI_SWITCH)
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
default y if BDI_SWITCH || XMON
help
If you want to add additional CFLAGS to the kernel build, such as -g
for KGDB or the BDI2000, enable this option and then enter what you
would like to add in the next question.
config COMPILE_OPTIONS
string "Additional compile arguments"
depends on MORE_COMPILE_OPTIONS
default "-g -ggdb"
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 some sort of debugger to
debug the kernel.
If you don't debug the kernel, you can say N.
config BOOTX_TEXT
bool "Support for early boot text console (BootX or OpenFirmware only)"
......
......@@ -22,9 +22,6 @@ CPP = $(CC) -E $(CFLAGS)
cflags-$(CONFIG_4xx) += -Wa,-m405
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)
......
......@@ -106,6 +106,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/cacheflush.h>
#include <asm/system.h>
#include <asm/signal.h>
#include <asm/kgdb.h>
......@@ -186,7 +187,7 @@ hex(unsigned char ch)
* return 0.
*/
static unsigned char *
mem2hex(char *mem, char *buf, int count)
mem2hex(const char *mem, char *buf, int count)
{
unsigned char ch;
unsigned short tmp_s;
......@@ -828,11 +829,11 @@ breakpoint(void)
return;
}
asm(" .globl breakinst
breakinst: .long 0x7d821008
");
asm(" .globl breakinst \n\
breakinst: .long 0x7d821008");
}
#ifdef CONFIG_KGDB_CONSOLE
/* Output string in GDB O-packet format if GDB has connected. If nothing
output, returns 0 (caller must then handle output). */
int
......@@ -852,3 +853,4 @@ kgdb_output_string (const char* s, unsigned int count)
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