summaryrefslogtreecommitdiff
path: root/gdb/inf-child.c
diff options
context:
space:
mode:
authorqiyao <qiyao>2012-03-03 09:51:27 +0000
committerqiyao <qiyao>2012-03-03 09:51:27 +0000
commitc76cc4b780865d52a7925fdde987d16e2579ae17 (patch)
treea6b12f769005efc2b0328bd37e01960562f0feed /gdb/inf-child.c
parentfba7de0579dc79a7ffc7b3b902d111ce9acb3ab0 (diff)
downloadgdb-c76cc4b780865d52a7925fdde987d16e2579ae17.tar.gz
gdb:
* common/agent.c (agent_look_up_symbols): Add one parameter 'arg'. * common/agent.h: Update declaration. * inf-child.c (inf_child_use_agent): New. (inf_child_can_use_agent): New. (inf_child_target): Initialize fields `to_use_agent' and `to_can_use_agent'. * agent.c (agent_new_objfile): New. (_initialize_agent): Add agent_new_objfile to new_objfile observer. * linux-nat.c (linux_child_static_tracepoint_markers_by_strid): New. (linux_target_install_ops): Initialize field `to_static_tracepoint_markers_by_strid'. * remote.c (free_current_marker): Move it to ... * tracepoint.c (free_current_marker): ... here. New. (cleanup_target_stop): New. * tracepoint.h: Declare free_current_marker. * NEWS: Add one entry about `info static-tracepoint-marker'. gdb/gdbserver: * tracepoint.c (tracepoint_look_up_symbols): Update call to agent_look_up_symbols. gdb/testsuite: * gdb.trace/strace.exp: run strace_info_marker in linux native gdb.
Diffstat (limited to 'gdb/inf-child.c')
-rw-r--r--gdb/inf-child.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 96c11579f8e..5531102314b 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -29,6 +29,7 @@
#include "gdb_stat.h"
#include "inf-child.h"
#include "gdb/fileio.h"
+#include "agent.h"
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> /* for MAXPATHLEN */
@@ -332,6 +333,23 @@ inf_child_fileio_readlink (const char *filename, int *target_errno)
#endif
}
+static int
+inf_child_use_agent (int use)
+{
+ if (agent_loaded_p ())
+ {
+ use_agent = use;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+static int
+inf_child_can_use_agent (void)
+{
+ return agent_loaded_p ();
+}
struct target_ops *
inf_child_target (void)
@@ -371,5 +389,7 @@ inf_child_target (void)
t->to_fileio_unlink = inf_child_fileio_unlink;
t->to_fileio_readlink = inf_child_fileio_readlink;
t->to_magic = OPS_MAGIC;
+ t->to_use_agent = inf_child_use_agent;
+ t->to_can_use_agent = inf_child_can_use_agent;
return t;
}