Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-11

Unit initialization not called in arm-wince DLLs?

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

TOndrej

Hi all,

it seems that unit initialization is not called in arm-wince DLLs. The debugger shows:
(gdb) display $INTERFACEBASE_WIDGETSET
2: $INTERFACEBASE_WIDGETSET = void

whereas the InterfaceBase.WidgetSet global variable should have been assigned in the initialization section of Interfaces unit in \lcl\wince\interfaces.pp.

I'm using FPC svn 5389 with Lazarus/LCL svn 10204. Can anyone please confirm this?

I'm only starting with FreePascal... I'd be extremely thankful for a fix or a workaround. Any suggestion on how to call initialization of all linked units in code?

Thanks a lot in advance,

TOndrej

Reply by email

Jonas Maebe
to TOndrej
TOndrej wrote
it seems that unit initialization is not called in arm-wince DLLs. The debugger shows: (gdb) display $INTERFACEBASE_WIDGETSET 2: $INTERFACEBASE_WIDGETSET = void
Try

p INTERFACEBASE_WIDGETSET

(i.e., without the "$").

And if doesn't want to print that, try

x/x @INTERFACEBASE_WIDGETSET

The "void" indicates a type, not a value.

Jonas

Reply by email

TOndrej
to Jonas Maebe
Jonas Maebe wrote
p INTERFACEBASE_WIDGETSET

Thanks for your reply!

(gdb) p INTERFACEBASE_WIDGETSET
No symbol "INTERFACEBASE_WIDGETSET" in current context.

x/x @INTERFACEBASE_WIDGETSET

(gdb) x/x @INTERFACEBASE_WIDGETSET
Unknown address space specifier: "INTERFACEBASE_WIDGETSET"

But:

(gdb) p WIDGETSET
$2 = (TWIDGETSET) 0x949960

(gdb) x/x WIDGETSET
0x949960: 0x00175568

So, is this the global variable I'm looking for, ie. InterfaceBase.WidgetSet? What happens if I have another global variable of the same name in another unit?
Sorry about the confusion, I should probably read the FPC documentation more carefully.
Is the symbol naming convention documented somewhere?

Thanks for your help, I appreciate it a lot!

TOndrej

Reply by email

Jonas Maebe
to TOndrej
TOndrej wrote 9 lines
(gdb) p WIDGETSET $2 = (TWIDGETSET) 0x949960 (gdb) x/x WIDGETSET 0x949960: 0x00175568 So, is this the global variable I'm looking for, ie. InterfaceBase.WidgetSet? What happens if I have another global variable of the same name in another unit?

It depends on the current execution context. The unit-specific names are U_<UNITNAME>_<VARIABLENAME>.

Sorry about the confusion, I should probably read the FPC documentation more carefully. Is the symbol naming convention documented somewhere?

Not that I know.

Jonas

Reply by email

TOndrej
to Jonas Maebe
Jonas Maebe wrote
It depends on the current execution context. The unit-specific names are U_<UNITNAME>_<VARIABLENAME>.

I see. Off to experiment some more ;-)
Thanks much again Jonas for your help.

TOndrej

Reply by email