} // until here, the gert and genv content still correct.
so I set a global genv to save the pointer.
Breakpoint 4, emacs_module_init (ert=0xbfb904f0) at mymodule.c:411
411 return 0;
(gdb) p *gert
$4 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
412 } ########### out of emacs_module_init() #######################
(gdb) s
0x081680b1 in Fmodule_load ()
(gdb) p *gert
$5 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function Fmodule_load,
which has no line number information.
0x08164610 in Fload ()
(gdb) p *gert
$6 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function Fload,
which has no line number information.
0x0814ee38 in Frequire ()
(gdb) p *gert
$7 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function Frequire,
which has no line number information.
0x08141530 in unbind_to ()
(gdb) p *gert
$8 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function unbind_to,
which has no line number information.
0x08141d8b in eval_sub ()
(gdb) p *gert
$9 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function eval_sub,
which has no line number information.
0x08143fa8 in Feval ()
(gdb) p *gert
$10 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function Feval,
which has no line number information.
0x08141530 in unbind_to ()
(gdb) p *gert
$11 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function unbind_to,
which has no line number information.
0x081427fd in Ffuncall ()
(gdb) p *gert
$12 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function Ffuncall,
which has no line number information.
0x081770bf in exec_byte_code ()
(gdb) p *gert
$13 = {size = 12, private_members = 0xbfb904fc, get_environment = 0x8165910 <module_get_environment>}
(gdb) s
Single stepping until exit from function exec_byte_code,
which has no line number information.
0x08142355 in funcall_lambda ()
(gdb) p *gert
$14 = {size = 138896016, private_members = 0x0, get_environment = 0x4c38}
(gdb) q
A debugging session is active.