public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "xdje42 at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/17559] confusion on what the result of find_pc_symtab is
Date: Thu, 06 Nov 2014 07:12:00 -0000	[thread overview]
Message-ID: <bug-17559-4717-YYdFuFjnyc@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17559-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=17559

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
Data point:
If (hypothetically) we fix find_pc_symtab to work the way gdb_disassembly
expects it to, I suspect we'll break this usage here in frame.c:

      /* We retrieve the frame's symtab by using the frame PC.                  
         However we cannot use the frame PC as-is, because it usually           
         points to the instruction following the "call", which is               
         sometimes the first instruction of another function.  So we            
         rely on get_frame_address_in_block() which provides us with a          
         PC which is guaranteed to be inside the frame's code                   
         block.  */
      if (get_frame_address_in_block_if_available (fi, &pc))
        {
          struct symtab *s = find_pc_symtab (pc); //xyzdje                      

          if (s
              && s->language != current_language->la_language
              && s->language != language_unknown
              && language_mode == language_mode_auto)
            set_language (s->language);
        }

For example, if we stop in a .h file included by a c++ file,
will this set the language to C (instead of the right answer of C++)?

An open question I have is: Is the language of non-primary symtabs (e.g.,
headers) ever useful (except as is currently used in the heuristics to try to
compute the language of the primary symtab) ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  reply	other threads:[~2014-11-06  7:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  7:02 [Bug symtab/17559] New: " xdje42 at gmail dot com
2014-11-06  7:12 ` xdje42 at gmail dot com [this message]
2014-11-06  7:16 ` [Bug symtab/17559] " xdje42 at gmail dot com
2014-11-06  7:20 ` xdje42 at gmail dot com
2014-11-06  7:36 ` xdje42 at gmail dot com
2014-11-06 18:57 ` xdje42 at gmail dot com
2014-11-10  0:18 ` xdje42 at gmail dot com
2014-11-15 18:12 ` cvs-commit at gcc dot gnu.org
2014-11-15 18:15 ` xdje42 at gmail dot com
2014-12-25  0:45 ` cvs-commit at gcc dot gnu.org

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=bug-17559-4717-YYdFuFjnyc@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).