From: Keith Seitz <keiths@redhat.com>
To: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [RFA 1/2] Linespec rewrite (update 2)
Date: Mon, 23 Jul 2012 17:57:00 -0000 [thread overview]
Message-ID: <500D9065.3000805@redhat.com> (raw)
In-Reply-To: <m2394jsiaj.fsf@igel.home>
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
On 07/22/2012 12:32 PM, Andreas Schwab wrote:
> Keith Seitz <keiths@redhat.com> writes:
>
>> + for (i = 0; VEC_iterate (symbolp, ls->labels.label_symbols, i, sym); ++i)
>> + {
>> + symbol_to_sal (&sal, state->funfirstline, sym);
>> + add_sal_to_sals (state, &sals, &sal,
>> + SYMBOL_NATURAL_NAME (sym));
>
> If symbol_to_sal returns 0 then sal is uninitialized.
>
Nice catch, Andreas.
I propose the attached patch.
I guess this should be considered for inclusion on 7.5. [What say ye?]
Keith
ChangeLog
2012-07-23 Keith Seitz <keiths@redhat.com>
* linespec.c (convert_linespec_to_sal): Don't add
any symbols to the result vector if symbol_to_sal
returns zero.
[-- Attachment #2: uninitialized_sal-from-symbol_to_sal.patch --]
[-- Type: text/x-patch, Size: 1271 bytes --]
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.162
diff -u -p -r1.162 linespec.c
--- linespec.c 18 Jul 2012 20:38:18 -0000 1.162
+++ linespec.c 23 Jul 2012 17:54:48 -0000
@@ -1860,9 +1860,9 @@ convert_linespec_to_sals (struct linespe
for (i = 0; VEC_iterate (symbolp, ls->labels.label_symbols, i, sym); ++i)
{
- symbol_to_sal (&sal, state->funfirstline, sym);
- add_sal_to_sals (state, &sals, &sal,
- SYMBOL_NATURAL_NAME (sym), 0);
+ if (symbol_to_sal (&sal, state->funfirstline, sym))
+ add_sal_to_sals (state, &sals, &sal,
+ SYMBOL_NATURAL_NAME (sym), 0);
}
}
else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
@@ -1886,8 +1886,8 @@ convert_linespec_to_sals (struct linespe
{
pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym));
set_current_program_space (pspace);
- symbol_to_sal (&sal, state->funfirstline, sym);
- if (maybe_add_address (state->addr_set, pspace, sal.pc))
+ if (symbol_to_sal (&sal, state->funfirstline, sym)
+ && maybe_add_address (state->addr_set, pspace, sal.pc))
add_sal_to_sals (state, &sals, &sal,
SYMBOL_NATURAL_NAME (sym), 0);
}
next prev parent reply other threads:[~2012-07-23 17:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 23:18 Keith Seitz
2012-03-27 1:45 ` asmwarrior
2012-03-28 18:55 ` Tom Tromey
2012-03-27 13:56 ` Joel Brobecker
2012-03-27 14:31 ` Keith Seitz
2012-03-27 14:54 ` Joel Brobecker
2012-03-27 15:05 ` Joel Brobecker
2012-03-27 18:08 ` Keith Seitz
2012-03-28 20:46 ` Tom Tromey
2012-03-29 19:18 ` Keith Seitz
2012-03-30 15:34 ` Tom Tromey
2012-03-30 15:59 ` Keith Seitz
2012-03-30 16:37 ` Tom Tromey
2012-03-30 17:09 ` Joel Brobecker
2012-03-30 17:56 ` Tom Tromey
2012-03-30 18:05 ` Keith Seitz
2012-04-03 23:22 ` Keith Seitz
2012-04-05 15:22 ` Tom Tromey
2012-04-05 15:55 ` Doug Evans
2012-04-05 19:01 ` Keith Seitz
2012-07-22 19:33 ` Andreas Schwab
2012-07-23 17:57 ` Keith Seitz [this message]
2012-07-23 18:55 ` Tom Tromey
2012-07-23 21:13 ` Keith Seitz
2012-04-03 21:19 ` Doug Evans
2012-04-03 23:14 ` Keith Seitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=500D9065.3000805@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox