From: "Dr. Rolf Jansen" <rolf.anroni@gmail.com>
To: gdb-patches@sourceware.org
Subject: Two minor issues
Date: Wed, 27 Aug 2008 11:56:00 -0000 [thread overview]
Message-ID: <16C866B7-F5D2-4D95-922F-9D19ABC54D45@gmail.com> (raw)
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
next reply other threads:[~2008-08-27 11:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 11:56 Dr. Rolf Jansen [this message]
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
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=16C866B7-F5D2-4D95-922F-9D19ABC54D45@gmail.com \
--to=rolf.anroni@gmail.com \
--cc=gdb-patches@sourceware.org \
/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