Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: Michael Snyder <msnyder@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFC] Unexpected automatic language switch - get_frame_language()
Date: Wed, 10 Dec 2003 01:50:00 -0000	[thread overview]
Message-ID: <20031210015055.GB842@gnat.com> (raw)
In-Reply-To: <3FD12296.8090809@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

> Looked at frame_addr_in_block?

That's (almost) the function I was trying to remember about. Thanks a
lot!  The following patch addresses the problem in a way that I hope
will satisfy MichaelS' concerns.

2003-12-09  J. Brobecker  <brobecker@gnat.com>

        * frame.c (select_frame): Get the current frame PC using
        get_frame_address_in_block() instead of get_frame_pc().
        * stack.c (get_frame_language): Likewise.

Tested on x86-linux, with no regression.

OK to apply?

Thanks,
-- 
Joel

[-- Attachment #2: addr_in_block.diff --]
[-- Type: text/plain, Size: 1180 bytes --]

Index: frame.c
===================================================================
RCS file: /nile.c/cvs/Dev/gdb/gdb-6.0/gdb/frame.c,v
retrieving revision 1.2
diff -u -p -r1.2 frame.c
--- frame.c	6 Oct 2003 05:20:55 -0000	1.2
+++ frame.c	9 Dec 2003 00:19:00 -0000
@@ -985,7 +985,7 @@ select_frame (struct frame_info *fi)
      source language of this frame, and switch to it if desired.  */
   if (fi)
     {
-      s = find_pc_symtab (get_frame_pc (fi));
+      s = find_pc_symtab (get_frame_address_in_block (fi));
       if (s
 	  && s->language != current_language->la_language
 	  && s->language != language_unknown
Index: stack.c
===================================================================
RCS file: /nile.c/cvs/Dev/gdb/gdb-6.0/gdb/stack.c,v
retrieving revision 1.3
diff -u -p -r1.3 stack.c
--- stack.c	13 Nov 2003 11:56:27 -0000	1.3
+++ stack.c	9 Dec 2003 00:20:14 -0000
@@ -2047,7 +2047,7 @@ get_frame_language (void)
 
   if (deprecated_selected_frame)
     {
-      s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
+      s = find_pc_symtab (get_frame_address_in_block (deprecated_selected_frame));
       if (s)
 	flang = s->language;
       else

  reply	other threads:[~2003-12-10  1:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-05 22:48 Joel Brobecker
2003-12-05 23:57 ` Michael Snyder
2003-12-06  0:18   ` Joel Brobecker
2003-12-06  0:28     ` Andrew Cagney
2003-12-10  1:50       ` Joel Brobecker [this message]
2003-12-10 16:14         ` Andrew Cagney
2003-12-10 17:42           ` Joel Brobecker
2003-12-06  0:42     ` Michael Snyder
2003-12-10 17:47 ` Daniel Jacobowitz
2003-12-10 18:10   ` Joel Brobecker
2003-12-10 18:20     ` Daniel Jacobowitz
2003-12-10 19:16       ` Joel Brobecker
2003-12-10 19:18         ` Daniel Jacobowitz
2003-12-10 18:33     ` Ada's throw/catch; Was: " Andrew Cagney
2003-12-10 19:04       ` Joel Brobecker

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=20031210015055.GB842@gnat.com \
    --to=brobecker@gnat.com \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@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