aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMarcin Kościelnicki <koriakin@0x04.net>2016-04-05 15:23:35 +0200
committerMarcin Kościelnicki <koriakin@0x04.net>2016-04-05 18:04:53 +0200
commit4dca19f828e7b3194ea146c8e1172678f0e42f3d (patch)
tree5a74f2ebe4d5ea4d7931a7051c396111a4c6365a /gdb
parent8ddf6b2a1384ca73a16827022da5f4423703154a (diff)
downloadgdb-4dca19f828e7b3194ea146c8e1172678f0e42f3d.zip
gdb-4dca19f828e7b3194ea146c8e1172678f0e42f3d.tar.gz
gdb-4dca19f828e7b3194ea146c8e1172678f0e42f3d.tar.bz2
IPA: Move getauxval out of #ifndef IN_PROCESS_AGENT
The getauxval code was wrongly included in code area only compiled for gdbserver. Move it to a #ifdef IN_PROCESS_AGENT area that already contains lots of IPA-only code. gdb/gdbserver/ChangeLog: * tracepoint.c (getauxval): Move to #ifdef IN_PROCESS_AGENT.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/tracepoint.c56
2 files changed, 32 insertions, 28 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 7b20fdb..a94cf03 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2016-04-05 Marcin Kościelnicki <koriakin@0x04.net>
+
+ * tracepoint.c (getauxval): Move to #ifdef IN_PROCESS_AGENT.
+
2016-04-03 Marcin Kościelnicki <koriakin@0x04.net>
* linux-aarch64-ipa.c: Add <elf.h> include.
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 8f71325..620b94f 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -216,34 +216,6 @@ static struct ipa_sym_addresses ipa_sym_addrs;
static int read_inferior_integer (CORE_ADDR symaddr, int *val);
-#if !defined HAVE_GETAUXVAL && defined IN_PROCESS_AGENT
-/* Retrieve the value of TYPE from the auxiliary vector. If TYPE is not
- found, 0 is returned. This function is provided if glibc is too old. */
-
-unsigned long
-getauxval (unsigned long type)
-{
- unsigned long data[2];
- FILE *f = fopen ("/proc/self/auxv", "r");
- unsigned long value = 0;
-
- if (f == NULL)
- return 0;
-
- while (fread (data, sizeof (data), 1, f) > 0)
- {
- if (data[0] == type)
- {
- value = data[1];
- break;
- }
- }
-
- fclose (f);
- return value;
-}
-#endif
-
/* Returns true if both the in-process agent library and the static
tracepoints libraries are loaded in the inferior, and agent has
capability on static tracepoints. */
@@ -7395,6 +7367,34 @@ initialize_tracepoint_ftlib (void)
gdb_agent_init ();
}
+#ifndef HAVE_GETAUXVAL
+/* Retrieve the value of TYPE from the auxiliary vector. If TYPE is not
+ found, 0 is returned. This function is provided if glibc is too old. */
+
+unsigned long
+getauxval (unsigned long type)
+{
+ unsigned long data[2];
+ FILE *f = fopen ("/proc/self/auxv", "r");
+ unsigned long value = 0;
+
+ if (f == NULL)
+ return 0;
+
+ while (fread (data, sizeof (data), 1, f) > 0)
+ {
+ if (data[0] == type)
+ {
+ value = data[1];
+ break;
+ }
+ }
+
+ fclose (f);
+ return value;
+}
+#endif
+
#endif /* IN_PROCESS_AGENT */
/* Return a timestamp, expressed as microseconds of the usual Unix