From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
Subject: Re: Regression: Re: [3/3] RFC: `function:label' linespecs
Date: Fri, 25 Mar 2011 19:29:00 -0000 [thread overview]
Message-ID: <m3zkojunsf.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3bp0zw4tr.fsf@fleche.redhat.com> (Tom Tromey's message of "Fri, 25 Mar 2011 10:19:28 -0600")
Tom> Sorry about that. I am working on a fix.
Here is what I am checking in.
This restores some old code that was exercised by this particular test
case.
Built and regtested on x86-64 (compile farm).
I also ran the failing case locally by hand.
Tom
2011-03-25 Tom Tromey <tromey@redhat.com>
* linespec.c (symbol_found): Restore line-based result for
non-LOC_LABEL symbols.
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.116
diff -u -r1.116 linespec.c
--- linespec.c 24 Mar 2011 20:25:14 -0000 1.116
+++ linespec.c 25 Mar 2011 17:11:20 -0000
@@ -2174,9 +2174,7 @@
}
else
{
- if (funfirstline && SYMBOL_CLASS (sym) != LOC_LABEL)
- error (_("\"%s\" is not a function"), copy);
- else if (SYMBOL_VALUE_ADDRESS (sym) != 0)
+ if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
{
/* We know its line number. */
values.sals = (struct symtab_and_line *)
@@ -2201,6 +2199,20 @@
return values;
}
+ else if (funfirstline)
+ error (_("\"%s\" is not a function"), copy);
+ else if (SYMBOL_LINE (sym) != 0)
+ {
+ /* We know its line number. */
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+ values.nelts = 1;
+ memset (&values.sals[0], 0, sizeof (values.sals[0]));
+ values.sals[0].symtab = SYMBOL_SYMTAB (sym);
+ values.sals[0].line = SYMBOL_LINE (sym);
+ values.sals[0].pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym));
+ return values;
+ }
else
/* This can happen if it is compiled with a compiler which doesn't
put out line numbers for variables. */
prev parent reply other threads:[~2011-03-25 17:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 18:56 Tom Tromey
2011-03-18 23:01 ` Eli Zaretskii
2011-03-24 20:34 ` Tom Tromey
2011-03-25 10:10 ` Regression: " Jan Kratochvil
2011-03-25 16:25 ` Tom Tromey
2011-03-25 19:29 ` Tom Tromey [this message]
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=m3zkojunsf.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/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