Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drgn.helpers.linux.mm: have cmdline() and environ() return None for k…
…ernel tasks Sometimes I need to enumerate all tasks in the system and print their command lines, among other information. This fails for kernel tasks (i.e. tasks without mm): Traceback (most recent call last): File "<console>", line 2, in <module> File "[...]/drgn/helpers/linux/mm.py", line 1276, in cmdline arg_start = mm.arg_start.value_() ^^^^^^^^^^^^^^^^^^^^^ _drgn.FaultError: address is not mapped: 0x140 It seems reasonable for this not to cause an exception but rather to return a value that the caller can conveniently recover from (consider also the behavior of `cat /proc/2/cmdline`). Therefore, change cmdline() to return None for kernel tasks. Do the same for environ() for consistency. Signed-off-by: Peter Collingbourne <[email protected]>
- Loading branch information