This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: obvious set_cu_language patch
>>>>> "Daniel" == Daniel Berlin <dan@cgsoftware.com> writes:
Daniel> Could you please point me to where i can find out what java
Daniel> arrays *are*, so i can make a type structure for them (the new
Daniel> typesystem is a hierarchy of structs, rather than a single
Daniel> type struct. This means whatever java arrays *are*, can
Daniel> easily be represented and handled, with no fuss or muss).
Java arrays are structures. You can see the definition in
gcc/libjava/gcj/array.h. I've appended the relevant bits for your
perusal.
Most instantiations of JArray are actually created at runtime. Only
primitive arrays are created statically.
Tom
class __JArray : public java::lang::Object
{
protected:
// This is just a hack to work around a warning emitted by the C++
// compiler. We initialize `length' evilly, but it doesn't know
// that.
__JArray () : length (0)
{
}
public:
const jsize length;
friend jsize JvGetArrayLength (__JArray*);
};
template<class T>
class JArray : public __JArray
{
T data[0];
public:
friend T* elements<>(JArray<T>& x);
friend T* elements<>(JArray<T>* x);
// T* getData() { return data; }
// T& operator[](jint i) { return data[i]; }
};