mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-01 00:58:39 +02:00 
			
		
		
		
	scripts/gdb: use mem instead of core_layout to get the module address
commitac3b432839("module: replace module_layout with module_memory") changed the struct module data structure from module_layout to module_memory. The core_layout member which is used while loading modules are not available anymore leading to the following error while running gdb: (gdb) lx-symbols loading vmlinux Python Exception <class 'gdb.error'>: There is no member named core_layout. Error occurred in Python: There is no member named core_layout. Replace core_layout with its new counterpart mem[MOD_TEXT]. Fixes:ac3b432839("module: replace module_layout with module_memory") Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
		
							parent
							
								
									560db7ccf9
								
							
						
					
					
						commit
						b4aff7513d
					
				
					 3 changed files with 7 additions and 4 deletions
				
			
		|  | @ -54,6 +54,9 @@ LX_VALUE(SB_NODIRATIME) | ||||||
| /* linux/htimer.h */ | /* linux/htimer.h */ | ||||||
| LX_GDBPARSED(hrtimer_resolution) | LX_GDBPARSED(hrtimer_resolution) | ||||||
| 
 | 
 | ||||||
|  | /* linux/module.h */ | ||||||
|  | LX_GDBPARSED(MOD_TEXT) | ||||||
|  | 
 | ||||||
| /* linux/mount.h */ | /* linux/mount.h */ | ||||||
| LX_VALUE(MNT_NOSUID) | LX_VALUE(MNT_NOSUID) | ||||||
| LX_VALUE(MNT_NODEV) | LX_VALUE(MNT_NODEV) | ||||||
|  |  | ||||||
|  | @ -13,7 +13,7 @@ | ||||||
| 
 | 
 | ||||||
| import gdb | import gdb | ||||||
| 
 | 
 | ||||||
| from linux import cpus, utils, lists | from linux import cpus, utils, lists, constants | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| module_type = utils.CachedType("struct module") | module_type = utils.CachedType("struct module") | ||||||
|  | @ -73,7 +73,7 @@ class LxLsmod(gdb.Command): | ||||||
|                 "        " if utils.get_long_type().sizeof == 8 else "")) |                 "        " if utils.get_long_type().sizeof == 8 else "")) | ||||||
| 
 | 
 | ||||||
|         for module in module_list(): |         for module in module_list(): | ||||||
|             layout = module['core_layout'] |             layout = module['mem'][constants.LX_MOD_TEXT] | ||||||
|             gdb.write("{address} {name:<19} {size:>8}  {ref}".format( |             gdb.write("{address} {name:<19} {size:>8}  {ref}".format( | ||||||
|                 address=str(layout['base']).split()[0], |                 address=str(layout['base']).split()[0], | ||||||
|                 name=module['name'].string(), |                 name=module['name'].string(), | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ import gdb | ||||||
| import os | import os | ||||||
| import re | import re | ||||||
| 
 | 
 | ||||||
| from linux import modules, utils | from linux import modules, utils, constants | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| if hasattr(gdb, 'Breakpoint'): | if hasattr(gdb, 'Breakpoint'): | ||||||
|  | @ -109,7 +109,7 @@ lx-symbols command.""" | ||||||
| 
 | 
 | ||||||
|     def load_module_symbols(self, module): |     def load_module_symbols(self, module): | ||||||
|         module_name = module['name'].string() |         module_name = module['name'].string() | ||||||
|         module_addr = str(module['core_layout']['base']).split()[0] |         module_addr = str(module['mem'][constants.LX_MOD_TEXT]['base']).split()[0] | ||||||
| 
 | 
 | ||||||
|         module_file = self._get_module_file(module_name) |         module_file = self._get_module_file(module_name) | ||||||
|         if not module_file and not self.module_files_updated: |         if not module_file and not self.module_files_updated: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Pankaj Raghav
						Pankaj Raghav