File: README.md

package info (click to toggle)
libpulp 0.2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,964 kB
  • sloc: ansic: 11,257; python: 1,110; sh: 881; makefile: 824; cpp: 582; asm: 124
file content (15 lines) | stat: -rw-r--r-- 768 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Example: Live Patching a C++ ordinary class
## About
In this test we have two files: `class.cpp` and `a_livepatch1.cpp`. The first
one contain code in C++ for a test program which print the contents of a
`point` class, where the second one contains a livepatch that modifies the
`Print` method so it prints content differently.

## Live Patching C++ methods
C++ methods can be live patched the same way as C functions. However, for
libpulp to find the symbols in the original target binary, you should write
the mangled name instead of the C++ original name of the method.

So instead of writing `Point3D::Print`, one should write `_ZN7Point3D5PrintEv`.
The original declaration of the class should be copied as well (see
`a_livepatch1.cpp` and `a_livepatch1.dsc`).