1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-26 00:57:39 +01:00

Add get_pid in ptrace support

This commit is contained in:
Théophile Bastian 2018-05-31 15:45:07 +02:00
parent 7a747a28b1
commit da7446a21a
2 changed files with 22 additions and 1 deletions

View file

@ -34,5 +34,6 @@ PROTECTED unw_accessors_t _UPT_accessors =
.access_reg = _UPT_access_reg, .access_reg = _UPT_access_reg,
.access_fpreg = _UPT_access_fpreg, .access_fpreg = _UPT_access_fpreg,
.resume = _UPT_resume, .resume = _UPT_resume,
.get_proc_name = _UPT_get_proc_name .get_proc_name = _UPT_get_proc_name,
.get_pid = _UPT_get_pid
}; };

20
src/ptrace/_UPT_get_pid.c Normal file
View file

@ -0,0 +1,20 @@
/********** Libunwind -- eh_elf flavour **********
* This is the eh_elf version of libunwind, made for academic purposes.
*
* Théophile Bastian <theophile.bastian@ens.fr> <contact+github@tobast.fr>
*************************************************
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
************************************************/
#include "_UPT_internal.h"
int _UPT_get_pid(void* arg) {
struct UPT_info *ui = arg;
return ui->pid;
}