Load all the commands and functions defined by GEF into GDB.
(self)
| 9473 | context.layout_mapping[corrected_settings_name] = (display_pane_function, pane_title_function, condition) |
| 9474 | |
| 9475 | def load(self) -> None: |
| 9476 | """Load all the commands and functions defined by GEF into GDB.""" |
| 9477 | current_commands = set( self.commands.keys() ) |
| 9478 | new_commands = set( [x._cmdline_ for x in __registered_commands__] ) - current_commands |
| 9479 | current_functions = set( self.functions.keys() ) |
| 9480 | new_functions = set([x._function_ for x in __registered_functions__]) - current_functions |
| 9481 | self.missing.clear() |
| 9482 | self.__load_time_ms = time.time()* 1000 |
| 9483 | |
| 9484 | # load all new functions |
| 9485 | for name in sorted(new_functions): |
| 9486 | for function_cls in __registered_functions__: |
| 9487 | if function_cls._function_ == name: |
| 9488 | self.functions[name] = function_cls() |
| 9489 | break |
| 9490 | |
| 9491 | # load all new commands |
| 9492 | for name in sorted(new_commands): |
| 9493 | try: |
| 9494 | for command_cls in __registered_commands__: |
| 9495 | if command_cls._cmdline_ == name: |
| 9496 | command_instance = command_cls() |
| 9497 | |
| 9498 | # create the aliases if any |
| 9499 | if hasattr(command_instance, "_aliases_"): |
| 9500 | aliases = getattr(command_instance, "_aliases_") |
| 9501 | for alias in aliases: |
| 9502 | GefAlias(alias, name) |
| 9503 | |
| 9504 | self.commands[name] = command_instance |
| 9505 | break |
| 9506 | |
| 9507 | except Exception as reason: |
| 9508 | self.missing[name] = reason |
| 9509 | |
| 9510 | self.__load_time_ms = (time.time()* 1000) - self.__load_time_ms |
| 9511 | return |
| 9512 | |
| 9513 | |
| 9514 | def show_banner(self) -> None: |
no test coverage detected