Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Two minor issues
@ 2008-08-27 11:56 Dr. Rolf Jansen
  2008-08-27 13:28 ` [commit] Add missing include (Re: Two minor issues) Ulrich Weigand
  2008-08-27 13:48 ` Two minor issues Thiago Jung Bauermann
  0 siblings, 2 replies; 6+ messages in thread
From: Dr. Rolf Jansen @ 2008-08-27 11:56 UTC (permalink / raw)
  To: gdb-patches

6.8.50.20080826-cvs
This GDB was configured as "--host=powerpc-apple-darwin9.4.0 -- 
target=i386-mingw32msvc"

   1.   remote.c does not compile because the new function  
remote_bfd_iovec_stat() makes a reference to the stat structure and  
that is not defined by default on MaC OS X. In order to fix this I  
added "#include <sys/stat.h>" somewhere at the top of the file.


   2.   quite at the top of objc-lang.c the Class structure is declared:

    struct objc_class {
      CORE_ADDR isa;
      CORE_ADDR super_class;
      CORE_ADDR name;
      long version;
      long info;
      long instance_size;
      CORE_ADDR ivars;
      CORE_ADDR methods;
      CORE_ADDR cache;
      CORE_ADDR protocols;
    };

In read_objc_class() a variable of that struct type is filled with the  
contents at a CORE_ADDR:

    static void
    read_objc_class (CORE_ADDR addr, struct objc_class *class)
    {
      class->isa = read_memory_unsigned_integer (addr, 4);
      class->super_class = read_memory_unsigned_integer (addr + 4, 4);
      class->name = read_memory_unsigned_integer (addr + 8, 4);
      class->version = read_memory_unsigned_integer (addr + 12, 4);
      class->info = read_memory_unsigned_integer (addr + 16, 4);
      class->instance_size = read_memory_unsigned_integer (addr + 18,  
4);
      class->ivars = read_memory_unsigned_integer (addr + 24, 4);
      class->methods = read_memory_unsigned_integer (addr + 28, 4);
      class->cache = read_memory_unsigned_integer (addr + 32, 4);
      class->protocols = read_memory_unsigned_integer (addr + 36, 4);
    }

As a matter of fact, this code works only for targets with a pointer- 
size and long-size of 4-bytes, but even with this, the offset to class- 
 >instance_size shall be 20 and not 18.

Is there a global way to find out at compile-time at the build or host  
system the ptr-size and the long-size of the configured target  
machine, something like size_attarget_of()?

Best regards

Rolf


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-27 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-27 11:56 Two minor issues Dr. Rolf Jansen
2008-08-27 13:28 ` [commit] Add missing include (Re: Two minor issues) Ulrich Weigand
2008-08-27 13:58   ` Dr. Rolf Jansen
2008-08-27 13:48 ` Two minor issues Thiago Jung Bauermann
2008-08-27 13:56   ` Daniel Jacobowitz
2008-08-27 17:46     ` Dr. Rolf Jansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox