1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-16 13:18:12 +01:00

Add _UCD_get_pid and _UCD_get_cursig

These let you get the pid and the current signal from the coredump.

This isn't strictly unwind related, but these are trivial to implement
as we have the info, and you almost always want these when you're
printing a backtrace from a core file.
This commit is contained in:
Alexander Larsson 2012-03-23 21:00:28 +01:00 committed by Arun Sharma
parent adbeb79155
commit b9ff650a22
2 changed files with 12 additions and 0 deletions

View file

@ -40,6 +40,8 @@ struct UCD_info;
extern struct UCD_info *_UCD_create(const char *filename); extern struct UCD_info *_UCD_create(const char *filename);
extern void _UCD_destroy(struct UCD_info *); extern void _UCD_destroy(struct UCD_info *);
extern pid_t _UCD_get_pid(struct UCD_info *);
extern int _UCD_get_cursig(struct UCD_info *);
extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename); extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename);
extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *, extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *,
unsigned long vaddr, unsigned long vaddr,

View file

@ -276,6 +276,16 @@ _UCD_create(const char *filename)
return NULL; return NULL;
} }
pid_t _UCD_get_pid(struct UCD_info *ui)
{
return ui->prstatus->pr_pid;
}
int _UCD_get_cursig(struct UCD_info *ui)
{
return ui->prstatus->pr_cursig;
}
int _UCD_add_backing_file_at_segment(struct UCD_info *ui, int phdr_no, const char *filename) int _UCD_add_backing_file_at_segment(struct UCD_info *ui, int phdr_no, const char *filename)
{ {
if ((unsigned)phdr_no >= ui->phdrs_count) if ((unsigned)phdr_no >= ui->phdrs_count)