|
Re: [PATCH] fix warnings and bug in kgdb_set_sw_break: msg#00046linux.kernel.debugging.kgdb.bugs
Bob Picco wrote: [Sun Jan 08 2006, 02:51:51PM EST] > > 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 My apologizes. The first posting of this patch is crap and should be ignored. The patch below should be what we want. bob 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. Signed-off-by: Bob Picco <bob.picco@xxxxxx> kernel/kgdb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) Index: linux-2.6.15-kgdb/kernel/kgdb.c =================================================================== --- linux-2.6.15-kgdb.orig/kernel/kgdb.c 2006-01-08 15:41:17.000000000 -0500 +++ linux-2.6.15-kgdb/kernel/kgdb.c 2006-01-08 15:49:13.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,9 @@ 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, + char tmp_variable[BREAK_INSTR_SIZE]; + + if ((error = kgdb_get_mem((char *)addr, 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> |
|---|---|---|
| Previous by Date: | Re: SMP barriers missing?: 00046, Jim Blandy |
|---|---|
| Next by Date: | Re: i386 Hardware watchpoints using kgdb-2-2.6.14.tar.gz: 00046, Bob Picco |
| Previous by Thread: | [PATCH] fix warnings and bug in kgdb_set_sw_breaki: 00046, Bob Picco |
| Next by Thread: | kgdb on arm for 2.6: 00046, Lance Spaulding |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |