public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: sami wagiaalla <swagiaal@redhat.com>
Cc: Project Archer <archer@sourceware.org>
Subject: Re: language setting issue
Date: Wed, 14 Jul 2010 19:10:00 -0000	[thread overview]
Message-ID: <20100714191000.GA24265@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <4C3E0749.2030500@redhat.com>

On Wed, 14 Jul 2010 20:51:53 +0200, sami wagiaalla wrote:
> ./gdb ./testsuite/gdb.cp/cp-relocate.o -ex 'print func<1>(int)' -ex 'q'
> 
> In this scenario if we check current_language->la_language it will
> be set to language_c.

> The problem is that current_language is set by checking the extension of the
> file of the symbol main which in this case does not exist.

It is such only before starting the inferior.  Normally select_frame() always
sets current_language according to the frame chosen right now.

Also in some cases language is passed along structures (such as struct
breakpoint) and functions.


> To solve this we could just pick an arbitrary objfile and check the
> language. This works of we can assume that all files have the same
> language. Otherwise we would have to set the language a per block
> bases.

IMO this problem is only for object files which is mostly just a problem for
hackers.  And for gdb testsuite.  But I agree some better autodetection would
be nice.  But only for the case of single objfile (and possibly single CU) to
make the code simple IMO as it gets never used otherwise anyway.


Regards,
Jan

  parent reply	other threads:[~2010-07-14 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14 18:52 sami wagiaalla
2010-07-14 18:57 ` Roland McGrath
2010-07-14 19:10 ` Jan Kratochvil [this message]
2010-07-14 21:15 ` Tom Tromey

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=20100714191000.GA24265@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=archer@sourceware.org \
    --cc=swagiaal@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).