[Mono-devel-list] (AMD64) Compiler Warnings (2)

Willibald Krenn Willibald.Krenn at gmx.at
Tue Dec 7 14:25:52 EST 2004


Martin Baulig schrieb:
> On Mon, 2004-12-06 at 17:50 +0100, Willibald Krenn wrote:
> 
>>>>struct MonoDebugLineNumberEntry {
>>>>	guint32 offset;
>>>>-	guint32 address;
>>>>+	uintptr_t address;
> 
> 
>>Ok, so I'll revert that to guint32 and add a *big* FIXME.
>>But this can break the code on 64 bit architectures as long as the debug 
>>code uses this field as real address?!
> 
> 
> Changing this to something which is not guaranteed to be a 32 bit
> unsigned integer _will_ break the debugger.  The structure is read from
> the symbol file - and the symbol file contains two 32 bit unsigned
> integers on all platforms (so you can copy a symbol file from one
> machine to another, just like an assembly).

When looking at this code (the uintptr_t was my mistake, 'cause I 
thought address would mean 64-bits-real-address) I found that the offset 
sometimes is used as unsigned int and sometimes as signed int.
So I guess offset should be changed to gint32...

> 
> The only change I saw in that file was that additional #include - or do
> I miss something ?

The change I referred to is in

Index: mono/metadata/mono-debug-debugger.h
===================================================================
--- mono/metadata/mono-debug-debugger.h	(revision 37311)
+++ mono/metadata/mono-debug-debugger.h	(working copy)

-extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, 
gpointer data, guint32 arg);
+extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, 
gpointer data, uintptr_t arg);

-void            mono_debugger_event 
(MonoDebuggerEvent event, gpointer data, guint32 arg);
+void            mono_debugger_event 
(MonoDebuggerEvent event, gpointer data, uintptr_t arg);


Willi




More information about the Mono-devel-list mailing list