Skip to content

Commit

Permalink
Add common/freebsdKludges.C
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent c63a77d commit b5b66ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 1 addition & 12 deletions common/src/freebsdKludges.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,8 @@ using std::map;
std::string P_cplus_demangle( const std::string &symbol, bool includeTypes )
{
return symbol_demangle_with_cache(symbol, includeTypes);
} /* end P_cplus_demangle() */

// Process Information Queries //
// No procfs mounted by default -- need to rely on sysctl //
}

/*
* Gets the full path of the executable for the specified process
*
* pid The pid for the process
*
* Returns the full path (caller is responsible for free'ing)
*/
char *sysctl_getExecPathname(pid_t pid) {
int mib[4];
mib[0] = CTL_KERN;
Expand Down Expand Up @@ -215,7 +205,6 @@ lwpid_t sysctl_getInitialLWP(pid_t pid) {
return ret;
}

// returns true if the process is running
bool sysctl_getRunningStates(pid_t pid, map<Dyninst::LWP, bool> &runningStates) {
size_t length;
struct kinfo_proc *procInfo = getProcInfo(pid, length, true);
Expand Down
12 changes: 12 additions & 0 deletions docs/common/developer/freebsdKludges.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ freebsdKludges.h

.. cpp:namespace:: freebsd

**Process Information Queries**

No procfs mounted by default -- need to rely on sysctl

.. cpp:function:: int sysctl_computeAddrWidth(pid_t pid)
.. cpp:function:: char *sysctl_getExecPathname(pid_t pid)

Gets the full path of the executable for the specified process
``pid`` The pid for the process
Returns the full path (caller is responsible for freeing)

.. cpp:function:: bool sysctl_findProcLWPs(pid_t pid, std::vector<pid_t> &lwps)
.. cpp:function:: lwpid_t sysctl_getInitialLWP(pid_t pid)
.. cpp:function:: bool sysctl_getRunningStates(pid_t pid, std::map<Dyninst::LWP, bool> &runningStates)

returns true if the process is running

.. cpp:function:: map_entries *getVMMaps(int pid, unsigned &maps_size)
.. cpp:function:: bool PtraceBulkRead(Dyninst::Address inTraced, unsigned size, void *inSelf, int pid)
.. cpp:function:: bool PtraceBulkWrite(Dyninst::Address inTraced, unsigned size, const void *inSelf, int pid)

0 comments on commit b5b66ad

Please sign in to comment.