This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: language setting issue

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]