Re: How to get function declaration source file/line from definition?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Interesting stuff. You provided a good place to start. Obtaining the
latest gcc, building, and breaking gets me in the ballpark at
'duplicate_decls' in 'cp/decl.c', although more work is required to
understand what happens to the function declaration data after the
merge. Your advice about submitting a patch request is a nice option.
I'm still figuring out what to do.

Thank you for your help. Jerry.

On 01/22/2016 11:53 AM, Manuel López-Ibáñez [via gcc] wrote:
> On 22/01/16 03:00, crasypantz wrote:
> > My understanding is with a gcc plugin, by the time I get to analyze
> the AST
> > the entire source file has been parsed. Therefore, I don't
> understand how I
> > could access the old declaration before the merge (maybe that was
> your final
> > answer). Also, the example you show has a different signature between
> > declaration and definition where the former returns 'void' and the
> latter
> > returns 'int'. Or when you say 'set a breakpoint', are you using the
> > different return value to effectively accomplish this? Sorry if you are
> > speaking high level and I'm not keeping up- please bear with me :)
>
> What I mean is that if you debug gcc while running that testcase and
> put a
> breakpoint at the point of gcc's code where that error is given, you
> can find
> out when the merging occurs and what happens to the old tree node.
>
> https://gcc.gnu.org/wiki/DebuggingGCC
>
> Not sure if plugins can at the moment access that info, but you can
> always
> propose patches to enable that. The plugin API is driven by its users,
> there is
> no grand design.
>
> https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01536.html
>
> Cheers,
>
> Manuel.
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://gcc.1065356.n5.nabble.com/How-to-get-function-declaration-source-file-line-from-definition-tp1228358p1228626.html
>
> To unsubscribe from How to get function declaration source file/line
> from definition?, click here
> <http://gcc.1065356.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1228358&code=aWhhdmVjcmF6eXBhbnRzQGhvdG1haWwuY29tfDEyMjgzNTh8LTEwMTEyODIzNTk=>.
> NAML
> <http://gcc.1065356.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://gcc.1065356.n5.nabble.com/How-to-get-function-declaration-source-file-line-from-definition-tp1228358p1230093.html
Sent from the gcc - Help mailing list archive at Nabble.com.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux