Skip to content

Merge branch 'master' into '6.0/stage' #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ License

.. start-license

Copyright 2018-2020 Omar Sandoval
Copyright (c) Facebook, Inc. and its affiliates.

drgn is licensed under the `GPLv3
<https://www.gnu.org/licenses/gpl-3.0.en.html>`_ or later.
Expand Down
12 changes: 6 additions & 6 deletions _drgn.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down Expand Up @@ -611,14 +611,14 @@ class Object:
language. For example, adding two objects from a program written in C
results in an object with a type and value according to the rules of C:

>>> Object(prog, 'unsigned long', value=2**64 - 1) + Object(prog, 'int', value=1)
>>> Object(prog, 'unsigned long', 2**64 - 1) + Object(prog, 'int', 1)
Object(prog, 'unsigned long', value=0)

If only one operand to a binary operator is an object, the other operand
will be converted to an object according to the language's rules for
literals:

>>> Object(prog, 'char', value=0) - 1
>>> Object(prog, 'char', 0) - 1
Object(prog, 'int', value=-1)

The standard :class:`int() <int>`, :class:`float() <float>`, and
Expand All @@ -640,9 +640,9 @@ class Object:
:param prog: The program to create this object in.
:param type: The type of the object. If omitted, this is deduced from
*value* according to the language's rules for literals.
:param value: The value of this object. See :meth:`value_()`.
:param address: The address of this object in the program. Either this or
*value* must be given, but not both.
:param value: The value of this object. See :meth:`value_()`.
:param byteorder: Byte order of the object. This should be ``'little'`` or
``'big'``. The default is ``None``, which indicates the program byte
order. This must be ``None`` for primitive values.
Expand All @@ -657,9 +657,9 @@ class Object:
self,
prog: Program,
type: Union[str, Type, None] = None,
value: Any = None,
*,
address: Optional[int] = None,
value: Any = None,
byteorder: Optional[str] = None,
bit_offset: Optional[int] = None,
bit_field_size: Optional[int] = None,
Expand Down Expand Up @@ -935,7 +935,7 @@ def NULL(prog: Program, type: Union[str, Type]) -> Object:
"""
Get an object representing ``NULL`` casted to the given type.

This is equivalent to ``Object(prog, type, value=0)``.
This is equivalent to ``Object(prog, type, 0)``.

:param prog: The program.
:param type: The type.
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/docstrings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

import argparse
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/ext.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

import ast
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/namespace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

import itertools
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/parse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

import ast
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/visitor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

import ast
Expand Down
2 changes: 1 addition & 1 deletion drgn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/block.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/bpf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/cgroup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/cpumask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/device.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/fs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/idr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/kconfig.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/kernfs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/list_nulls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/mm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/net.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/percpu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/pid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/radixtree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/rbtree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/sched.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
1 change: 1 addition & 0 deletions drgn/helpers/linux/tcp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/internal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/internal/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""drgn command line interface"""
Expand Down
2 changes: 1 addition & 1 deletion drgn/internal/rlcompleter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2019 - Omar Sandoval
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""Improved readline completer"""
Expand Down
3 changes: 3 additions & 0 deletions examples/linux/cgroup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""List the paths of all descendants of a cgroup v2"""

import os
Expand Down
3 changes: 3 additions & 0 deletions examples/linux/fs_inodes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""List the paths of all inodes cached in a given filesystem"""

from drgn.helpers.linux.fs import for_each_mount, inode_path
Expand Down
3 changes: 3 additions & 0 deletions examples/linux/lsmod.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""An implementation of lsmod(8) using drgn"""

from drgn.helpers.linux.list import list_for_each_entry
Expand Down
3 changes: 3 additions & 0 deletions examples/linux/ps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""A simplified implementation of ps(1) using drgn"""

from drgn.helpers.linux.pid import for_each_task
Expand Down
3 changes: 3 additions & 0 deletions examples/linux/tcp_sock.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

"""List all TCP sockets and their cgroup v2 paths"""

import ipaddress
Expand Down
3 changes: 3 additions & 0 deletions libdrgn/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = elfutils include
Expand Down
Loading