libdtrace: Don't hard-code the native data model.

MFC after:	1 month
This commit is contained in:
Mark Johnston 2016-07-30 03:09:57 +00:00
parent 4808a67805
commit 907b59d769
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303534
2 changed files with 7 additions and 26 deletions

View File

@ -38,9 +38,7 @@
#include <dt_impl.h>
#include <dt_pid.h>
#if !defined(sun)
#define PR_MODEL_ILP32 1
#define PR_MODEL_LP64 2
#ifdef __FreeBSD__
#include <libproc_compat.h>
#endif

View File

@ -39,9 +39,8 @@
#include <dis_tables.h>
#ifndef illumos
#define PR_MODEL_ILP32 1
#define PR_MODEL_LP64 2
#ifdef __FreeBSD__
#include <libproc.h>
#include <libproc_compat.h>
#endif
@ -93,11 +92,7 @@ dt_pid_has_jump_table(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
#if __i386__
char dmodel = PR_MODEL_ILP32;
#elif __amd64__
char dmodel = PR_MODEL_LP64;
#endif
char dmodel = proc_getmodel(P);
#endif
/*
@ -149,11 +144,7 @@ dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
#if __i386__
char dmodel = PR_MODEL_ILP32;
#elif __amd64__
char dmodel = PR_MODEL_LP64;
#endif
char dmodel = proc_getmodel(P);
#endif
/*
@ -310,11 +301,7 @@ dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
#if __i386__
char dmodel = PR_MODEL_ILP32;
#elif __amd64__
char dmodel = PR_MODEL_LP64;
#endif
char dmodel = proc_getmodel(P);
#endif
if ((text = malloc(symp->st_size)) == NULL) {
@ -393,11 +380,7 @@ dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
#if __i386__
char dmodel = PR_MODEL_ILP32;
#elif __amd64__
char dmodel = PR_MODEL_LP64;
#endif
char dmodel = proc_getmodel(P);
#endif
ftp->ftps_type = DTFTP_OFFSETS;