Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
81053a1
libdrgn: dwarf_index: support DWARF 5
osandov Jun 15, 2021
215f7d7
libdrgn: debug_info: implement DW_OP_{addr,const}x
osandov Jul 6, 2021
2600173
libdrgn: debug_info: support DWARF 5 location lists
osandov Jul 1, 2021
a863f1e
libdrgn: dwarf_index: print unknown forms in hexadecimal
osandov Jul 9, 2021
cbe1f9e
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Jul 10, 2021
aa76e0f
TOOL-11725 drgn: fix python build dependencies (#28)
pzakha Jul 13, 2021
a747168
libdrgn: fix comment typo in serialize.h
osandov Jul 22, 2021
7811d33
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Jul 23, 2021
ee0b8ef
helpers: use correct size for for_each_cpu()
osandov Jul 26, 2021
9c00552
libdrgn: python: add Object.from_bytes_()
osandov Jul 22, 2021
7335df1
libdrgn: python: add Object.to_bytes_()
osandov Jul 22, 2021
f9606e5
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Jul 27, 2021
50e3cf9
vmtest: add CONFIG_NUMA=y
osandov Jul 30, 2021
df8da55
helpers: update task_state_to_char() for v5.14
osandov Jul 30, 2021
dc0c0e0
setup.py: add 5.14 to vmtest kernels
osandov Jul 30, 2021
2f97cb4
helpers: add kernel nodemask helpers
Jul 15, 2021
f8e4bf3
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Jul 31, 2021
39b76e8
docs: update repr(drgn.Type) and type constructors in documentation
osandov Aug 2, 2021
7382856
docs: improve quick start documentation
osandov Jul 31, 2021
d6a47f8
docs: improve stack trace documentation in user guide
osandov Aug 2, 2021
3db7c8b
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 3, 2021
1213eb8
helpers: add bit operation helpers
osandov Aug 3, 2021
51f63bb
helpers: add node_state() to nodemask helpers
osandov Aug 4, 2021
eebb281
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 4, 2021
e991588
helpers: Add netdev_get_by_index()
peilin-ye Aug 11, 2021
65b65b2
helpers: fix drgn.helpers.linux.user.find_user() documented return type
osandov Aug 11, 2021
5541fad
Fix some flake8 errors
osandov Aug 11, 2021
980d1c6
helpers: fix annotation for type of entry helpers
osandov Aug 12, 2021
557b815
helpers: Add netdev_get_by_name()
peilin-ye Aug 11, 2021
62a34af
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 12, 2021
861c61e
Update elfutils in manylinux wheels
osandov Aug 12, 2021
ec3cb15
drgn 0.0.14
osandov Aug 12, 2021
ad2119a
Tell pytest not to match classes/functions starting with "test"
osandov Aug 12, 2021
86e85fc
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 13, 2021
611e4d9
libdrgn: debug_info: support DWARF 3 forms for loclistptr
osandov Aug 14, 2021
2152d39
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 14, 2021
8b4532c
libdrgn: debug_info: improve handling of DW_AT_data_member_location
osandov Aug 16, 2021
333652d
vmtest: fix deprecated QEMU option warnings
osandov Aug 16, 2021
5977dcc
vmtest: use larger msize for 9pfs mounts
osandov Aug 16, 2021
cf06be1
helpers: Add for_each_net()
peilin-ye Aug 16, 2021
ee27089
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 17, 2021
c9cb28b
docs: set required Sphinx version for Read the Docs
osandov Aug 17, 2021
c46da9e
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 18, 2021
242d148
helpers: Add get_net_ns_by_{inode,fd}()
peilin-ye Aug 19, 2021
27906d0
libdrgn: python: cast enums when wrapping with Python call
osandov Aug 20, 2021
8d383fb
libdrgn: fix alphabetization in gen_constants.py
osandov Aug 20, 2021
3d8db22
libdrgn: Add kind and binding fields to drgn_symbol
brenns10 Aug 19, 2021
1744d8d
libdrgn: python: Add binding, kind to drgn.Symbol
brenns10 Aug 19, 2021
207ca0e
tests: Add Symbol test
brenns10 Aug 20, 2021
b5bfb21
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 21, 2021
84f6142
libdrgn: dwarf_index: remove any_name functionality from dwarf_index_…
osandov Aug 23, 2021
4755cfa
libdrgn: dwarf_index: increment correct variable when rolling back
osandov Aug 23, 2021
fba5947
libdrgn: add array_for_each()
osandov Aug 24, 2021
110a98b
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Aug 24, 2021
77b9d3a
tests: change LinuxHelperTestCase.setUp to setUpClass
osandov Sep 1, 2021
6ee7ba4
vmtest: add some Traffic Control config options
osandov Sep 1, 2021
3c68b25
CI: install pyroute2
osandov Sep 1, 2021
2112077
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Sep 2, 2021
ce845ad
vmtest: add virtio-rng and cgroup Kconfig options
osandov Sep 2, 2021
62efd2a
vmtest: use virtio-rng
osandov Sep 2, 2021
a011314
helpers: Add netdev_for_each_tx_queue()
peilin-ye Aug 23, 2021
f822737
helpers: Add qdisc_lookup()
peilin-ye Aug 25, 2021
801f9d6
tests: improve cgroup helper tests
osandov Sep 2, 2021
57aaa1e
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Sep 4, 2021
c64d87e
setup.py: add 5.15 to vmtest kernels
osandov Sep 13, 2021
11a7697
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Sep 14, 2021
2baee6f
dwarf_index.c: Shrink abbrev tables before saving them in CUs
jgkamat Sep 24, 2021
b0ae286
splay_tree.c: Rename splay_tree to avoid conflicts with splay-tree.h
JakeHillion Aug 24, 2021
b4a82c3
Add GitHub action to check for DCO sign-off on pull requests
osandov Sep 28, 2021
734cbe5
libdrgn: dwarf_index: free pending DIEs after indexing namespace
osandov Aug 24, 2021
469507a
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Sep 29, 2021
1d4dbc2
libdrgn: python: remove unused declaration
osandov Oct 13, 2021
196bfdc
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Oct 14, 2021
c1e16ae
libdrgn: fold drgn_program_get_dbinfo() into only caller
osandov Oct 23, 2021
802d6cc
libdrgn: rename drgn_program::_dbinfo to dbinfo
osandov Oct 23, 2021
1339dc6
libdrgn: hash_table: move entry_to_key to DEFINE_HASH_TABLE_FUNCTIONS()
osandov Oct 11, 2021
7e28ed7
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Oct 24, 2021
8bf26fa
dwarf_index.c: lazily allocate shards to save memory on unused ns
jgkamat Oct 12, 2021
3c52b18
tests: skip PID memory read test if /proc/$pid/mem doesn't work
osandov Oct 28, 2021
7e60827
Add initial Packit config
davide125 Oct 22, 2021
6150935
Fix some cosmetic nits in Packit config and .gitignore
osandov Oct 29, 2021
198499e
libdrgn: debug_info: optimize drgn_find_die_ancestors()
osandov Oct 29, 2021
568f4f9
libdrgn: debug_info: remove dies and length out parameters to drgn_dw…
osandov Aug 24, 2021
9c54083
libdrgn: pp: make PP_CAT not variadic
osandov Aug 24, 2021
8358c31
docs: document how to get debugging symbols
osandov Nov 3, 2021
bc2d533
README: update link to crash
osandov Nov 3, 2021
e502195
docs: disable sphinx.ext.viewcode
osandov Nov 3, 2021
d9192b7
docs: remove outdated comment about helper types
osandov Nov 3, 2021
1b7bada
docs: expand and reorganize installation instructions
osandov Nov 3, 2021
d36b12c
CI: add Python 3.10
osandov Nov 4, 2021
5cd3a90
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Nov 4, 2021
a5845e6
tests: fix race condition in stack trace tests
osandov Nov 4, 2021
bc85c2d
libdrgn: kdump: fix kdump_vmcoreinfo_raw() memory leak
osandov Nov 4, 2021
794ffc2
libdrgn: kdump: fix leak in leak fix
osandov Nov 4, 2021
4c84929
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Nov 6, 2021
d174575
Fix some include-what-you-use warnings
osandov Nov 10, 2021
d4634b7
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Nov 11, 2021
abc3ee4
libdrgn: dwarf_index: clean up index_die()
osandov Nov 17, 2021
4b3eec4
libdrgn: dwarf_index: fix hash table insertion error check
osandov Nov 17, 2021
64c4afa
libdrgn: type: fix hash table insertion error check
osandov Nov 17, 2021
40357b9
libdrgn: debug_info: don't use strlen() in drgn_debug_info_find_object()
osandov Nov 17, 2021
12ddb87
libdrgn: dwarf_info: simplify DWARF index iterator code
osandov Nov 18, 2021
2642f85
libdrgn: dwarf_index: avoid OpenMP when accessing indexed namespace
osandov Nov 18, 2021
a90ffdf
libdrgn: dwarf_index: actually index namespaces in parallel
osandov Nov 18, 2021
3700bb7
libdrgn: Follow typedefs in enum backing type lookup
jgkamat Feb 11, 2021
c6b2bc4
libdrgn: debug_info: split ORC support into its own file
osandov Nov 8, 2021
5591d19
libdrgn: debug_info: split DWARF support into its own file
osandov Nov 9, 2021
c3f31e2
libdrgn: reorganize and move DWARF index into dwarf_info.c
osandov Nov 12, 2021
35e682a
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Nov 19, 2021
4808ef7
libdrgn: debug_info: get address range of reported ET_EXEC files
osandov Nov 19, 2021
681d845
tests: elfwriter: set e_phoff to zero if there are no segments
osandov Nov 19, 2021
cb8bf33
tests: elfwriter: don't add sections if there aren't any
osandov Nov 19, 2021
c84d7e8
tests: generate ELF constants from elf.h
osandov Nov 20, 2021
07d00b7
tests: add tests for ELF symbols
osandov Nov 20, 2021
ff40f65
libdrgn: allow symbol name lookup to get local symbols
osandov Nov 20, 2021
cdee38a
tests: use different symbol for kernel module debug info test
osandov Nov 21, 2021
93dc02a
setup.py: add 5.16 to vmtest kernels
osandov Nov 21, 2021
c0d8709
Update copyright headers to Meta
osandov Nov 21, 2021
d18be05
README: mention Meta
osandov Nov 22, 2021
71619c6
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Nov 23, 2021
3914bb8
libdrgn: fix type names referring to anonymous types
osandov Nov 23, 2021
69a99f8
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Nov 27, 2021
36f7e8b
README: add libtool to build dependencies for Debian and Arch
osandov Dec 2, 2021
0315ade
tests: handle CONFIG_KALLSYMS=n and CONFIG_KALLSYMS_ALL=n
osandov Dec 2, 2021
631754b
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 3, 2021
0e31875
libdrgn: don't swallow errors in relocate_elf_file()
osandov Nov 30, 2021
91f6d03
libdrgn: fix note name matching
osandov Dec 3, 2021
2c6e368
Remove some include-what-you-use workarounds
osandov Dec 6, 2021
10c66d4
libdrgn: get correct error when dwelf_elf_gnu_build_id() fails
osandov Dec 6, 2021
aef144c
libdrgn: debug_info: improve elf_address_range()
osandov Dec 6, 2021
35c82ae
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 7, 2021
844d828
libdrgn: add partial support for .gnu_debugaltlink
osandov Dec 7, 2021
02912ca
libdrgn: fix handling of p_filesz < p_memsz in core dumps
osandov Dec 8, 2021
e6abfea
libdrgn: debug_info: report userspace core dump debug info ourselves
osandov Dec 8, 2021
f09fd13
libdrgn: helpers: add missing error check in linux_helper_pid_task()
osandov Dec 8, 2021
8a41adc
libdrgn: language_c: add missing error check in c_parse_abstract_decl…
osandov Dec 8, 2021
8b2bf85
libdrgn: dwarf_info: fix garbage return from drgn_array_type_from_dwa…
osandov Dec 8, 2021
8ebdcb7
libdrgn: memory_reader: remove unnecessary include
osandov Dec 8, 2021
ad23378
Update elfutils and libkdumpfile in manylinux wheels
osandov Dec 8, 2021
08e634c
drgn 0.0.15
osandov Dec 8, 2021
ffcce8a
Add a few files to source distributions
osandov Dec 9, 2021
5065c08
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 9, 2021
0610941
libdrgn: debug_info: serialize initial calls to dwfl_module_getdwarf
osandov Dec 9, 2021
a70e5d7
cli: print debuginfod client progress
osandov Dec 9, 2021
3a9ef1b
cli: print download progress in script mode, too
osandov Dec 9, 2021
1b54a25
drgn 0.0.16
osandov Dec 9, 2021
45dacc1
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 10, 2021
609b4cc
CONTRIBUTING: document some libdrgn coding conventions
osandov Dec 13, 2021
6fb304e
Skip DCO check for draft pull requests
osandov Dec 13, 2021
1ab6d4a
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 14, 2021
c4fbf7e
libdrgn: fix for compilation error
alakesh Dec 14, 2021
78f7aa4
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 15, 2021
f1cc883
Silence mypy warnings
brenns10 Dec 16, 2021
f7aeb2b
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 17, 2021
9add952
Ensure compile_commands.json contains -Wall
Svetlitski Dec 17, 2021
0f68cd4
vmtest: mount /dev/shm in VM
osandov Dec 17, 2021
2b47583
Rewrite linux helper iterators in C
Svetlitski Nov 19, 2021
6732148
tests: use NOBITS section for ELF symbols
osandov Dec 17, 2021
7f7b5cb
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 18, 2021
92f25e2
vmtest: enable logging when running vmtest.vm CLI
osandov Dec 21, 2021
b916e69
libdrgn: linux: translate per_cpu_ptr() helper to C
osandov Dec 21, 2021
adfb045
libdrgn: linux: add idle_thread() helper
osandov Dec 21, 2021
bc95749
tests: Rename "sock" to "skt" in test_sk_fullsock()
peilin-ye Dec 21, 2021
ed7f864
helpers: Add SOCKET_I() and SOCK_INODE()
peilin-ye Dec 21, 2021
d72a904
libdrgn: linux: replace idle_thread() with idle_task()
osandov Dec 22, 2021
b341c21
tests: fix black error
osandov Dec 22, 2021
2ff58a4
libdrgn: linux: make per_cpu_ptr() support !SMP kernels
osandov Dec 22, 2021
ba93fd5
vmtest: add kdump kernel config options
osandov Dec 22, 2021
ce9b202
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 22, 2021
2a0b4c8
vmtest: also add kexec_file_load() syscall config options
osandov Dec 22, 2021
451717e
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Dec 25, 2021
2ce41c2
CONTRIBUTING: mention that _destroy functions should allow NULL
osandov Jan 7, 2022
69c069b
libdrgn: allow NULL argument to drgn_stack_trace_destroy()
osandov Jan 7, 2022
d994637
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Jan 7, 2022
ac2cada
Add framework for testing in kdump
Svetlitski Jan 7, 2022
ab78094
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Jan 8, 2022
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.8, 3.7, 3.6]
python-version: ['3.10', '3.9', '3.8', '3.7', '3.6']
cc: [gcc, clang]
fail-fast: false
env:
Expand All @@ -23,11 +23,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install busybox-static libelf-dev libdw-dev qemu-kvm zstd ${{ matrix.cc == 'clang' && 'libomp-$(clang --version | sed -rn "s/.*clang version ([0-9]+).*/\\1/p")-dev' || '' }}
pip install mypy
pip install mypy pyroute2
- name: Generate version.py
run: python setup.py --version
- name: Check with mypy
run: mypy --strict --no-warn-return-any drgn _drgn.pyi
run: mypy --strict --no-warn-return-any --no-warn-unused-ignores drgn _drgn.pyi
- name: Build and test with ${{ matrix.cc }}
run: python setup.py test -K

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dco-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: DCO Check

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
check:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Checkout commit logs
run: |
git init
git fetch --filter=blob:none "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF" "$GITHUB_REF"
- name: Check for DCO sign-offs
run: |
no_sign_off="$(git log --no-merges --grep=Signed-off-by --invert-grep "FETCH_HEAD..$GITHUB_SHA")"
if [ -z "$no_sign_off" ]; then
echo "All commits have a Developer Certificate of Origin sign-off"
else
echo "The following commits are missing a Developer Certificate of Origin sign-off;"
echo "see https://github.com/osandov/drgn/blob/main/CONTRIBUTING.rst#signing-off"
echo
echo "$no_sign_off"
exit 1
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
/cscope.*
/dist
/docs/_build
/drgn-*.tar.gz
/drgn.egg-info
/drgn/internal/version.py
/htmlcov
/python-drgn-*.src.rpm
/python-drgn.spec
__pycache__
42 changes: 42 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/

specfile_path: python-drgn.spec
synced_files:
- python-drgn.spec
- .packit.yaml

upstream_package_name: drgn
downstream_package_name: python-drgn
actions:
get-current-version: "python3 setup.py --version"
# Fetch the specfile from Rawhide and drop any patches
post-upstream-clone: "bash -c \"curl -s https://src.fedoraproject.org/rpms/python-drgn/raw/main/f/python-drgn.spec | sed '/^Patch[0-9]/d' > python-drgn.spec\""

jobs:
- job: copr_build
trigger: commit
metadata:
targets:
- fedora-all-aarch64
- fedora-all-armhfp
- fedora-all-i386
- fedora-all-ppc64le
- fedora-all-s390x
- fedora-all-x86_64
- epel-8-aarch64
- epel-8-ppc64le
- epel-8-x86_64
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-all-aarch64
- fedora-all-armhfp
- fedora-all-i386
- fedora-all-ppc64le
- fedora-all-s390x
- fedora-all-x86_64
- epel-8-aarch64
- epel-8-ppc64le
- epel-8-x86_64
3 changes: 3 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
version: 2
sphinx:
configuration: docs/conf.py
python:
install:
- requirements: docs/requirements.txt
53 changes: 41 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,25 @@ submit changes for drgn.
Building
--------

The easiest way to develop drgn is by building and running it locally. See the
`installation documentation
<https://drgn.readthedocs.io/en/latest/installation.html#development>`_.
The easiest way to develop drgn is by building and running it locally. Please
build with warnings enabled. Install the dependencies from the `installation
instructions <README.rst#from-source>`_, then run:

.. code-block:: console

$ git clone https://github.com/osandov/drgn.git
$ cd drgn
$ CFLAGS="-Wall -Werror -g -O2" python3 setup.py build_ext -i
$ python3 -m drgn --help

Testing
-------

.. highlight:: console

Tests should be added for all features and bug fixes.

drgn's test suite can be run with::
drgn's test suite can be run with:

.. code-block:: console

$ python3 setup.py test

Expand All @@ -27,7 +34,9 @@ add ``-K``. See `vmtest <vmtest/README.rst>`_ for more details.

Tests can also be run manually with `unittest
<https://docs.python.org/3/library/unittest.html#command-line-interface>`_
after building locally::
after building locally:

.. code-block:: console

$ python3 -m unittest discover -v

Expand All @@ -49,14 +58,32 @@ C code in drgn mostly follows the `Linux kernel coding style
<https://www.kernel.org/doc/html/latest/process/coding-style.html>`_ except
that drgn requires C11 or newer, so declarations may be mixed with code.

A few other guidelines:
A few other guidelines/conventions:

* Constants should be defined as enums or ``static const`` variables rather
than macros.
* Functions that can fail should return a ``struct drgn_error *`` (and return
their result via an out parameter if necessary).
* Out parameters should be named ``ret`` (or suffixed with ``_ret`` if there
are multiple).
* Constants should be defined as enums or ``static const`` variables rather
than macros.
are multiple) and be the last parameter(s) of the function.
* Functions that initialize an already allocated structure should be suffixed
with ``_init`` and take the structure to initialize as the first argument,
e.g., ``struct drgn_error *foo_init(struct foo *foo, int foo_flags)``.
* The matching function to deinitialize a structure should be suffixed with
``_deinit``, e.g., ``void foo_deinit(struct foo *foo)``. If possible, the
definition should be placed directly after the definition of ``_init`` so
that it is easier to visually verify that everything is cleaned up.
* Functions that allocate and initialize a structure should be suffixed with
``_create`` and either return the structure as an out parameter (e.g.,
``struct drgn_error *foo_create(int foo_flags, struct foo **ret)``) or as the
return value if they can only fail with an out-of-memory error (e.g.,
``struct foo *foo_create(int foo_flags)``).
* The matching function to free an allocated structure should be suffixed with
``_destroy``, e.g., ``void foo_destroy(struct foo *foo)``. If possible, the
definition should be placed directly after the definition of ``_create``.
``_destroy`` should usually allow a ``NULL`` argument, just like ``free()``.
* Functions that return a result in a ``struct drgn_object *`` parameter should
only modify the object if the function succeeds.

drgn assumes some `implementation-defined behavior
<https://gcc.gnu.org/onlinedocs/gcc/C-Implementation.html>`_ for sanity:
Expand All @@ -74,7 +101,9 @@ Python
Python code in drgn should be compatible with Python 3.6 and newer.

Python code should be formatted with `black <https://github.com/psf/black>`_
and `isort <https://github.com/timothycrosley/isort>`_::
and `isort <https://github.com/timothycrosley/isort>`_:

.. code-block:: console

$ isort . && black .

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ recursive-include examples *.py
recursive-include tests *.py
recursive-include tools *.py
recursive-include vmtest *.c *.py *.rst
include COPYING util.py vmtest/config
include CONTRIBUTING.rst COPYING pytest.ini util.py vmtest/config
Loading