aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-03-03 04:04:35 +0000
committerYao Qi <yao@codesourcery.com>2012-03-03 04:04:35 +0000
commit8ffcbaaf40fd5eac75e04570c6b8989a70276578 (patch)
treefda03da2196ed461094030c7fbe76aa482f71a8c /gdb/gdbserver
parentd1feda864e0b17c5757197ba1b421e25dac6afd1 (diff)
downloadgdb-8ffcbaaf40fd5eac75e04570c6b8989a70276578.zip
gdb-8ffcbaaf40fd5eac75e04570c6b8989a70276578.tar.gz
gdb-8ffcbaaf40fd5eac75e04570c6b8989a70276578.tar.bz2
gdb:
* common/agent.c (struct ipa_sym_addresses) <addr_capability>: New. (agent_capability_check, agent_capability_invalidate): New. (symbol_list): New array element. * common/agent.h (enum agent_capa): New. * target.c (target_pre_inferior): Call agent_capability_invalidate. gdb/gdbserver: * tracepoint.c (gdb_agent_capability): New global. (in_process_agent_loaded_ust): Renamed to `in_process_agent_supports_ust'. Update callers. (in_process_agent_supports_ust): Call agent_capability_check. (clear_installed_tracepoints): Assert that agent supports agent.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog10
-rw-r--r--gdb/gdbserver/tracepoint.c29
2 files changed, 30 insertions, 9 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index b115b23..b96cd7b 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,15 @@
2012-03-03 Yao Qi <yao@codesourcery.com>
+ * tracepoint.c (gdb_agent_capability): New global.
+ (in_process_agent_loaded_ust): Renamed to
+ `in_process_agent_supports_ust'.
+ Update callers.
+ (in_process_agent_supports_ust): Call agent_capability_check.
+ (clear_installed_tracepoints): Assert that agent supports
+ agent.
+
+2012-03-03 Yao Qi <yao@codesourcery.com>
+
* linux-low.c (linux_supports_agent): New.
(linux_target_ops): Initialize field `supports_agent' with
linux_supports_agent.
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index f5f506a..bef28a3 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -232,10 +232,11 @@ in_process_agent_loaded (void)
static int read_inferior_integer (CORE_ADDR symaddr, int *val);
/* Returns true if both the in-process agent library and the static
- tracepoints libraries are loaded in the inferior. */
+ tracepoints libraries are loaded in the inferior, and agent has
+ capability on static tracepoints. */
static int
-in_process_agent_loaded_ust (void)
+in_process_agent_supports_ust (void)
{
int loaded = 0;
@@ -245,13 +246,20 @@ in_process_agent_loaded_ust (void)
return 0;
}
- if (read_inferior_integer (ipa_sym_addrs.addr_ust_loaded, &loaded))
+ if (agent_capability_check (AGENT_CAPA_STATIC_TRACE))
{
- warning ("Error reading ust_loaded in lib");
- return 0;
- }
+ /* Agent understands static tracepoint, then check whether UST is in
+ fact loaded in the inferior. */
+ if (read_inferior_integer (ipa_sym_addrs.addr_ust_loaded, &loaded))
+ {
+ warning ("Error reading ust_loaded in lib");
+ return 0;
+ }
- return loaded;
+ return loaded;
+ }
+ else
+ return 0;
}
static void
@@ -303,7 +311,7 @@ maybe_write_ipa_ust_not_loaded (char *buffer)
write_e_ipa_not_loaded (buffer);
return 1;
}
- else if (!in_process_agent_loaded_ust ())
+ else if (!in_process_agent_supports_ust ())
{
write_e_ust_not_loaded (buffer);
return 1;
@@ -2907,7 +2915,8 @@ install_tracepoint (struct tracepoint *tpoint, char *own_buf)
write_e_ipa_not_loaded (own_buf);
return;
}
- if (tpoint->type == static_tracepoint && !in_process_agent_loaded_ust ())
+ if (tpoint->type == static_tracepoint
+ && !in_process_agent_supports_ust ())
{
trace_debug ("Requested a static tracepoint, but static "
"tracepoints are not supported.");
@@ -6826,6 +6835,8 @@ gdb_agent_helper_thread (void *arg)
#include <signal.h>
#include <pthread.h>
+IP_AGENT_EXPORT int gdb_agent_capability = AGENT_CAPA_STATIC_TRACE;
+
static void
gdb_agent_init (void)
{