This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

RFA: [gdb/gdbarch.c] (set_architecture_from_file) Fix undue warning


When target_architecture_auto is not set (case in which whatever is
the exec file architecture will be used) GDB tests for compatibility
between the file being loaded and the architecture manually set by
the user.

I believe gdb should trust the architecture supplied method and only
issue the warning when compatible returns false (i.e. NULL).

The compatible() function also (theoretically) returns the minimal common
denominator between the file "mach" and the "mach" in the user specified
architecture (assuming "arch" is the same).  This could be used to decide
what architecture to se (between the two).  But here we are only testing
if it is compatible or not, as architecture was set manually.
All we need is a yes/no answer: Is it compatible?

The patch is attached.

P.S.: Command line users are not bothered much by this warning, although it
sounds scary.  The GUI users are really pested by it as Insight memorizes the
user preference for architecture/disassembly-flavor and warnings come in
pop-up windows that has to be dismissed.



-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com



Index: ChangeLog
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/ChangeLog,v
retrieving revision 1.5979.4.26
diff -c -p -r1.5979.4.26 ChangeLog
*** ChangeLog   2000/06/23 00:48:24     1.5979.4.26
--- ChangeLog   2000/06/23 18:28:17
***************
*** 1,3 ****
--- 1,9 ----
+ 2000-06-23  Fernando Nasser  <fnasser@cygnus.com>
+ 
+       * gdbarch.c (set_architecture_from_file): Use the compatible() member
+       of bfd_arch_info to check if the exec file architecture is compatible
+       with what the user has requested (manually).
+ 

Index: gdbarch.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbarch.c,v
retrieving revision 2.71
diff -c -p -r2.71 gdbarch.c
*** gdbarch.c   2000/05/01 04:46:47     2.71
--- gdbarch.c   2000/06/23 18:28:17
*************** set_architecture_from_file (bfd *abfd)
*** 3277,3283 ****
      {
        set_arch (wanted, set_arch_auto);
      }
!   else if (wanted != target_architecture)
      {
        warning ("%s architecture file may be incompatible with %s target.",
               wanted->printable_name,
--- 3277,3283 ----
      {
        set_arch (wanted, set_arch_auto);
      }
!   else if (wanted->compatible (wanted, target_architecture) == NULL)
      {
        warning ("%s architecture file may be incompatible with %s target.",
               wanted->printable_name,

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