public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-ambiguous-linespec: copy the addr_string in decode_dollar
@ 2011-10-14 18:25 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2011-10-14 18:25 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-ambiguous-linespec has been updated
       via  2274ca2b042e74d7abd34d7ecc48f24c4f33513b (commit)
       via  b7d99da4a4cfd4beca97d08c639af158f3f1ad61 (commit)
      from  2ec7ee24e31dd3f09b4e2f575c97cf6590d6dc70 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 2274ca2b042e74d7abd34d7ecc48f24c4f33513b
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Oct 14 12:24:45 2011 -0600

    copy the addr_string in decode_dollar

commit b7d99da4a4cfd4beca97d08c639af158f3f1ad61
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Oct 14 12:21:43 2011 -0600

    handle NULL addr_string in create_breakpoints_sal
    this is needed to handle the no-argument "break" case

-----------------------------------------------------------------------

Summary of changes:
 gdb/breakpoint.c |    6 +++++-
 gdb/linespec.c   |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index eb325a8..06071a8 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7383,7 +7383,11 @@ create_breakpoints_sal (struct gdbarch *gdbarch,
 
   for (i = 0; VEC_iterate (linespec_sals, canonical->sals, i, lsal); ++i)
     {
-      char *addr_string = xstrdup (canonical->addr_string);
+      /* Note that 'addr_string' can be NULL in the case of a plain
+	 'break', without arguments.  */
+      char *addr_string = (canonical->addr_string
+			   ? xstrdup (canonical->addr_string)
+			   : NULL);
       char *filter_string = lsal->canonical ? xstrdup (lsal->canonical) : NULL;
       struct cleanup *inner = make_cleanup (xfree, addr_string);
 
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 179e9b7..2332938 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2426,7 +2426,7 @@ decode_dollar (struct linespec_state *self, char *copy)
 	self->canonical->addr_string = xstrprintf ("%s:%s",
 						   self->user_filename, copy);
       else
-	self->canonical->addr_string = copy;
+	self->canonical->addr_string = xstrdup (copy);
     }
 
   return values;


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-14 18:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14 18:25 [SCM] archer-tromey-ambiguous-linespec: copy the addr_string in decode_dollar tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).