Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanimir Agovic2017-11-10 15:43:46 -0500
committerSanimir Agovic2017-11-10 18:04:28 -0500
commit3dbf379ca4ace3eeab00a4852364578f69dcdd50 (patch)
tree51b4ff579f0428bc71153c7f5e3e823e15ee57e8
parent7a7ef0ec3801af4dd7a5f5895a9642c731e22574 (diff)
downloadorg.eclipse.tcf.agent-3dbf379ca4ace3eeab00a4852364578f69dcdd50.tar.gz
org.eclipse.tcf.agent-3dbf379ca4ace3eeab00a4852364578f69dcdd50.tar.xz
org.eclipse.tcf.agent-3dbf379ca4ace3eeab00a4852364578f69dcdd50.zip
darwin: fix compile errors and warnings
Change-Id: I2af3bffd781823b88324a17448ae446655945317 Signed-off-by: Sanimir Agovic <sanimir@subpath.org>
-rw-r--r--agent/system/Darwin/tcf/context-darwin.c7
-rw-r--r--agent/tcf/framework/mdep.h2
-rw-r--r--agent/tcf/services/sysmon.c19
3 files changed, 3 insertions, 25 deletions
diff --git a/agent/system/Darwin/tcf/context-darwin.c b/agent/system/Darwin/tcf/context-darwin.c
index 271e89dc..6d791523 100644
--- a/agent/system/Darwin/tcf/context-darwin.c
+++ b/agent/system/Darwin/tcf/context-darwin.c
@@ -99,9 +99,9 @@ int context_attach(pid_t pid, ContextAttachCallBack * done, void * data, int mod
assert(done != NULL);
trace(LOG_CONTEXT, "context: attaching pid %d", pid);
- if ((mode & CONTEXT_ATTACH_SELF) == 0 && ptrace(PT_ATTACH, pid, 0, 0) < 0) {
+ if ((mode & CONTEXT_ATTACH_SELF) == 0 && ptrace(PT_ATTACHEXC, pid, 0, 0) < 0) {
int err = errno;
- trace(LOG_ALWAYS, "error: ptrace(PT_ATTACH) failed: pid %d, error %d %s",
+ trace(LOG_ALWAYS, "error: ptrace(PT_ATTACHEXC) failed: pid %d, error %d %s",
pid, err, errno_to_str(err));
errno = err;
return -1;
@@ -558,9 +558,7 @@ static void event_pid_exited(pid_t pid, int status, int signal) {
static void event_pid_stopped(pid_t pid, int signal, int event, int syscall) {
int stopped_by_exception = 0;
- unsigned long msg = 0;
Context * ctx = NULL;
- Context * ctx2 = NULL;
trace(LOG_EVENTS, "event: pid %d stopped, signal %d", pid, signal);
@@ -609,7 +607,6 @@ static void event_pid_stopped(pid_t pid, int signal, int event, int syscall) {
send_context_changed_event(ctx);
}
else {
- thread_state_t state;
unsigned int state_count;
ContextAddress pc0 = 0;
ContextAddress pc1 = 0;
diff --git a/agent/tcf/framework/mdep.h b/agent/tcf/framework/mdep.h
index 830d63fc..5c89e837 100644
--- a/agent/tcf/framework/mdep.h
+++ b/agent/tcf/framework/mdep.h
@@ -297,7 +297,7 @@ extern char ** environ;
extern char * canonicalize_file_name(const char * path);
#endif /* BSD */
-#if defined(__APPLE__)
+#if defined(__APPLE__) && !defined(CLOCK_REALTIME)
# define CLOCK_REALTIME 1
typedef int clockid_t;
extern int clock_gettime(clockid_t clock_id, struct timespec * tp);
diff --git a/agent/tcf/services/sysmon.c b/agent/tcf/services/sysmon.c
index 36a44827..22d730b9 100644
--- a/agent/tcf/services/sysmon.c
+++ b/agent/tcf/services/sysmon.c
@@ -56,25 +56,6 @@ static const char SYS_MON[] = "SysMonitor";
typedef struct kinfo_proc kinfo_proc;
-static void write_string_array(OutputStream * out, char **ap, int len) {
- int cnt;
-
- write_stream(out, '[');
- for (cnt = 0; cnt < len; cnt++) {
- if (cnt > 0) write_stream(out, ',');
- json_write_string(out, ap[cnt]);
- }
- write_stream(out, ']');
-}
-
-static void free_array(char **ap, int len) {
- int c;
- for (c = 0; c < len; c++) {
- free(*ap++);
- }
- free(ap);
-}
-
/*
* Get kernel process information for all processes.
*/

Back to the top