aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2013-05-07 17:04:29 +0000
committerSergio Durigan Junior <sergiodj@redhat.com>2013-05-07 17:04:29 +0000
commit58ce7251e876ad5b6569e3ee72dfe6c4c5697ca8 (patch)
tree96388c083cc474be232d0866a550c687f7371920 /gdb/breakpoint.c
parent7b70956dc8e3886e5fa483d72847f68a5008346c (diff)
downloadgdb-58ce7251e876ad5b6569e3ee72dfe6c4c5697ca8.zip
gdb-58ce7251e876ad5b6569e3ee72dfe6c4c5697ca8.tar.gz
gdb-58ce7251e876ad5b6569e3ee72dfe6c4c5697ca8.tar.bz2
gdb/
2013-05-07 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/15413: * breakpoint.c (condition_completer): Simplify the code to disconsider multiple locations of breakpoints when completing the "condition" command. gdb/testsuite/ 2013-05-07 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/15413: * gdb.base/pending.exp: Add test for completion of the "condition" command for pending breakpoints. * gdb.linespec/linespec.ex: Add test for completion of the "condition" command when dealing with multiple locations.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index ef9c23c..f4f9325 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1012,27 +1012,14 @@ condition_completer (struct cmd_list_element *cmd,
len = strlen (text);
ALL_BREAKPOINTS (b)
- {
- int single = b->loc->next == NULL;
- struct bp_location *loc;
- int count = 1;
-
- for (loc = b->loc; loc; loc = loc->next)
- {
- char location[50];
-
- if (single)
- xsnprintf (location, sizeof (location), "%d", b->number);
- else
- xsnprintf (location, sizeof (location), "%d.%d", b->number,
- count);
+ {
+ char number[50];
- if (strncmp (location, text, len) == 0)
- VEC_safe_push (char_ptr, result, xstrdup (location));
+ xsnprintf (number, sizeof (number), "%d", b->number);
- ++count;
- }
- }
+ if (strncmp (number, text, len) == 0)
+ VEC_safe_push (char_ptr, result, xstrdup (number));
+ }
return result;
}