This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFA] backtrace in mixed language applications (take 2)


[with the patch, this time]

> >  		  common_val_print (val, stb->stream, 0, 0, 2,
> > -				    Val_no_prettyprint);
> > +				    Val_no_prettyprint,
> > +				    language_def (SYMBOL_LANGUAGE (sym)));
> >  		  ui_out_field_stream (uiout, "value", stb);
> >  	        }
> >  	      else
> 
> The patch looks sane to me, except for this, which ignores "set
> language" - compare to the code in select_frame.  Do you think we
> ought to honor it here if it's been set?

Good catch.  I don't have any clear reason why we should change
the previous behavior in this case, so I've tweaked the previous
patch to honor "set language". I also added a test in the new
testcase to verify this. The rest of the patch should be identical.

2008-02-04  Joel Brobecker  <brobecker@adacore.com>

        * valprint.c (val_print): Add new language parameter and use it
        instead of using the current_language. Update calls to val_print
        throughout.
        (common_val_print): Add new langauge parameter and pass it to
        val_print.
        * value.h (struct language_defn): Add opaque declaration.
        (val_print, common_val_print): Update declarations.
        * stack.c (print_frame_args): Update call to common_val_print
        using the appropriate language.
        * mi/mi-cmd-stack.c (list_args_or_locals): Likewise.
        * c-valprint, f-valprint.c, m2-valprint.c, mt-tdep.c, infcmd.c,
        mi/mi-main.c, jv-valprint.c, ada-valprint.c, varobj.c, p-valprint.c,
        scm-valprint.c, cp-valprint.c, sh64-tdep.c, printcmd.c:
        #include "language.h" if necessary.
        Update calls to val_print and common_val_print.
        * Makefile.in (mt-tdep.o, sh64-tdep.o, mi-cmds.o, mi-main.o):
        Update dependencies.

2008-02-04  Jerome Guitton  <guitton@adacore.com>
            Joel Brobecker  <brobecker@adacore.com>

        * gdb.ada/lang_switch: New test program.
        * gdb.ada/lang_switch.exp: New testcase.

Tested on x86-linux. No regression.
OK to apply?

Thanks,
-- 
Joel

Attachment: lang_switch.diff
Description: Text document

Attachment: lang_switch-tc.diff
Description: Text document


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