From: Venkatesh P. R. <vra...@co...> - 2003-01-28 16:34:19
|
On Tue, 2003-01-28 at 09:26, Livio Baldini Soares wrote: > Hello Venkatesh! >=20 > Venkatesh Prasad Ranganath writes: > > Hi, > >=20 > > I am using UML 2.4.19-48um and trying to debug modules. The uml file > > system is RH7.2. The problem is that I am using umlgdb and everything > > works fine till the expect magic kicks in on inserting a module. The > > dump of *module_list for some reason has init and cleanup members of > > module_list are 0. However, the examples on the web have some non-zero > > values for the these variables. It is the same even after adding the > > symbols. However, on continuing and checking again (after insmod > > completes) init and cleanup members of module_list are non-zero. Also, > > notice that the name_user is garbage. What may be going wrong? =20 >=20 > What GCC version are you using? With GCC 2.95 things work normally > (as described on the web pages), but I'm currently working with GCC > 3.2 and the same "problems" you describe happen here too. >=20 > The workaround is to let the kernel load the module and only stop it > afterwards: >=20 > Venkatesh Prasad Ranganath writes: > > (gdb) c > > Continuing. > >=20 > > *** Module =F8=EA=FF\237\025=C7\004\b\210=F9\005\b loaded ***=20 > > Breakpoint 1, sys_init_module (name_user=3D0x9fffccd8 > > "=F8=EA=FF\237\025=C7\004\b\210=F9\005\b", mod_user=3D0x80a6500) > > at module.c:349 > > 349 char *name, *n_name, *name_tmp =3D NULL; > > (gdb) finish > > "finish" not meaningful in the outermost frame. > =20 > I don't know why this happens, probably GCC 3.2 inlined some > functions which were not in GCC 2.95.=20 >=20 > Forget about it and `c`ontinue the kernel, let the module load, and > Ctrl-C GDB to stop it. Like this: >=20 > | Breakpoint 4, sys_init_module (name_user=3D0xa1097c6c "\214|\t=A1B=F3\r= ,<# ",=20 > | mod_user=3D0x80c08d0) > | at /home/livio/kernel/versions/linux-2.4.20.kfs/include/linux/sched.= h:745 > | 745 if (cap_raised(current->cap_effective, cap)) > | (gdb) finish > | "finish" not meaningful in the outermost frame. > | (gdb) c > | Continuing. >=20 > | Program received signal SIGINT, Interrupt. > | 0xa018e341 in nanosleep () > | (gdb) >=20 > And then do as you would normally do (print the module_list, add the > module symbols, etc). Works For Me ;-) >=20 > Venkatesh Prasad Ranganath writes: > > print *module_list > > $2 =3D {size_of_struct =3D 96, next =3D 0xa01f4540, name =3D 0xa4820060 > > "ip_tables", size =3D 15424, uc =3D {usecount =3D { > ^^^^^^^^^ >=20 > The name of the module has been correcly set. But since you haven't > let sys_init_module() finish executing, the other members haven't been > filled in. They will be correctly filled out if you execute the > procedure I have described. Thanks for the reply. I figured out the same. =20 Just FYI: I also fixed umlgdb to take this into account. --=20 Venkatesh Prasad Ranganath, Dept. Computing and Information Science, Kansas State University, US. web: http://www.cis.ksu.edu/~rvprasad |