probes. */
char *addr_string;
#define EL_LINESPEC(PTR) ((PTR)->u.addr_string)
+
+ /* An address in the inferior. */
+ CORE_ADDR address;
+#define EL_ADDRESS(PTR) (PTR)->u.address
} u;
/* Cached string representation of this location. This is used, e.g., to
/* See description in location.h. */
+struct event_location *
+new_address_location (CORE_ADDR addr)
+{
+ struct event_location *location;
+
+ location = XCNEW (struct event_location);
+ EL_TYPE (location) = ADDRESS_LOCATION;
+ EL_ADDRESS (location) = addr;
+ return location;
+}
+
+/* See description in location.h. */
+
+CORE_ADDR
+get_address_location (const struct event_location *location)
+{
+ gdb_assert (EL_TYPE (location) == ADDRESS_LOCATION);
+ return EL_ADDRESS (location);
+}
+
+/* See description in location.h. */
+
struct event_location *
copy_event_location (const struct event_location *src)
{
EL_LINESPEC (dst) = xstrdup (EL_LINESPEC (src));
break;
+ case ADDRESS_LOCATION:
+ EL_ADDRESS (dst) = EL_ADDRESS (src);
+ break;
+
default:
gdb_assert_not_reached ("unknown event location type");
}
xfree (EL_LINESPEC (location));
break;
+ case ADDRESS_LOCATION:
+ /* Nothing to do. */
+ break;
+
default:
gdb_assert_not_reached ("unknown event location type");
}
EL_STRING (location) = xstrdup (EL_LINESPEC (location));
break;
+ case ADDRESS_LOCATION:
+ EL_STRING (location)
+ = xstrprintf ("*%s",
+ core_addr_to_string (EL_ADDRESS (location)));
+ break;
+
default:
gdb_assert_not_reached ("unknown event location type");
}
{
struct event_location *location;
- location = new_linespec_location (stringp);
+ /* First, check if the string is an address location. */
+ if (*stringp != NULL && **stringp == '*')
+ {
+ const char *arg, *orig;
+ CORE_ADDR addr;
+
+ orig = arg = *stringp;
+ addr = linespec_expression_to_pc (&arg);
+ location = new_address_location (addr);
+ *stringp += arg - orig;
+ }
+ else
+ {
+ /* Everything else is a linespec. */
+ location = new_linespec_location (stringp);
+ }
+
return location;
}
/* Linespecs are never "empty." (NULL is a valid linespec) */
return 0;
+ case ADDRESS_LOCATION:
+ return 0;
+
default:
gdb_assert_not_reached ("unknown event location type");
}