logo       

[PATCH] fix warnings and bug in kgdb_set_sw_break: msg#00049

linux.kernel.debugging.kgdb.bugs

Subject: [PATCH] fix warnings and bug in kgdb_set_sw_break


This patch addresses two problems. The compiler warnings in kgdb_get_mem and
kgdb_set_mem are fixed. There is random failure of software breakpoint setting
caused by wrong argument being passed to kgdb_get_mem in kgdb_set_sw_break.

bob

Signed-off-by: Bob Picco <bob.picco@xxxxxx>

kernel/kgdb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6.15-kgdb/kernel/kgdb.c
===================================================================
--- linux-2.6.15-kgdb.orig/kernel/kgdb.c 2006-01-08 12:44:40.000000000
-0500
+++ linux-2.6.15-kgdb/kernel/kgdb.c 2006-01-08 14:48:57.000000000 -0500
@@ -743,7 +743,7 @@ int kgdb_get_mem(char *addr, unsigned ch
kgdb_may_fault = 1;
if ((kgdb_fault_setjmp(kgdb_fault_jmp_regs)) != 0) {
kgdb_may_fault = 0;
- return ERR_PTR(-EINVAL);
+ return -EINVAL;
}
while (count) {
if ((unsigned long)addr < TASK_SIZE)
@@ -760,7 +760,7 @@ int kgdb_set_mem(char *addr, unsigned ch
kgdb_may_fault = 1;
if ((kgdb_fault_setjmp(kgdb_fault_jmp_regs)) != 0) {
kgdb_may_fault = 0;
- return ERR_PTR(-EINVAL);
+ return -EINVAL;
}
while (count) {
if ((unsigned long)addr < TASK_SIZE)
@@ -811,8 +811,8 @@ static int kgdb_set_sw_break(unsigned lo
{
int i, breakno = -1;
int error = 0;
- unsigned char *tmp_variable;
- if ((error = kgdb_get_mem((char *)addr,tmp_variable,
+ void *tmp_variable;
+ if ((error = kgdb_get_mem((char *)addr, (char *) &tmp_variable,
BREAK_INSTR_SIZE)) < 0)
return error;
for (i = 0; i < MAX_BREAKPOINTS; i++) {


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise