This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] SEGV trying to complete "catch exception" command


A small unexpected consequence of making the various catch [...]
commands proper prefixed sub-commands.  We initialize the without
any completer, but the command-line handler still tries to call them.
For now, I just added a guard against calling NULL completers.
Ideally, I'd like to implement a proper completer but it's very low
on my list...

Tested on x86_64-linux. Checked in.

-- 
Joel
gdb/
            * completer.c (complete_line_internal): Make sure the command
            completer is not NULL before calling it.

---
 gdb/completer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/completer.c b/gdb/completer.c
index 02e9511..b14edaf 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -676,7 +676,7 @@ complete_line_internal (const char *text, char *line_buffer, int point,
 			   p--)
 			;
 		    }
-		  if (reason != handle_brkchars)
+		  if (reason != handle_brkchars && c->completer != NULL)
 		    list = (*c->completer) (c, p, word);
 		}
 	    }
@@ -747,7 +747,7 @@ complete_line_internal (const char *text, char *line_buffer, int point,
 		       p--)
 		    ;
 		}
-	      if (reason != handle_brkchars)
+	      if (reason != handle_brkchars && c->completer != NULL)
 		list = (*c->completer) (c, p, word);
 	    }
 	}
-- 
1.6.0.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]