X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Fprobe.h;h=b4ff0a6b93ba1a53bcd1a6d67be272680403e3d3;hb=50c8a5160c5292ec7fbf1817960d58b15cb6fc5f;hp=a3a604904dbfc3093ac3c231576e48e5e4f1be98;hpb=ecd75fc8eed3bde86036141228074a20e55dcfc9;p=platform%2Fupstream%2Fbinutils.git diff --git a/gdb/probe.h b/gdb/probe.h index a3a6049..b4ff0a6 100644 --- a/gdb/probe.h +++ b/gdb/probe.h @@ -64,10 +64,11 @@ struct probe_ops void (*get_probes) (VEC (probe_p) **probes, struct objfile *objfile); - /* Function used to relocate addresses from PROBE according to some DELTA - provided. */ + /* Compute the probe's relocated address. OBJFILE is the objfile + in which the probe originated. */ - void (*relocate) (struct probe *probe, CORE_ADDR delta); + CORE_ADDR (*get_probe_address) (struct probe *probe, + struct objfile *objfile); /* Return the number of arguments of PROBE. */ @@ -97,13 +98,15 @@ struct probe_ops sense if the probe has a concept of semaphore associated to a probe. */ - void (*set_semaphore) (struct probe *probe, struct gdbarch *gdbarch); + void (*set_semaphore) (struct probe *probe, struct objfile *objfile, + struct gdbarch *gdbarch); /* Clear the semaphore associated with the PROBE. This function only makes sense if the probe has a concept of semaphore associated to a probe. */ - void (*clear_semaphore) (struct probe *probe, struct gdbarch *gdbarch); + void (*clear_semaphore) (struct probe *probe, struct objfile *objfile, + struct gdbarch *gdbarch); /* Function called to destroy PROBE's specific data. This function shall not free PROBE itself. */ @@ -166,10 +169,8 @@ struct probe /* The operations associated with this probe. */ const struct probe_ops *pops; - /* The objfile which contains this probe. Even if the probe is also - present in a separate debug objfile, this variable always points to - the non-separate debug objfile. */ - struct objfile *objfile; + /* The probe's architecture. */ + struct gdbarch *arch; /* The name of the probe. */ const char *name; @@ -178,13 +179,29 @@ struct probe the objfile which contains the probe. */ const char *provider; - /* The address where the probe is inserted. */ + /* The address where the probe is inserted, relative to + SECT_OFF_TEXT. */ CORE_ADDR address; }; +/* A bound probe holds a pointer to a probe and a pointer to the + probe's defining objfile. This is needed because probes are + independent of the program space and thus require relocation at + their point of use. */ + +struct bound_probe + { + /* The probe. */ + + struct probe *probe; + + /* The objfile in which the probe originated. */ + + struct objfile *objfile; + }; + /* A helper for linespec that decodes a probe specification. It returns a - symtabs_and_lines object and updates *ARGPTR or throws an error. The - argument PTYPE specifies the type of the probe(s) to be parsed. */ + symtabs_and_lines object and updates *ARGPTR or throws an error. */ extern struct symtabs_and_lines parse_probes (char **argptr, struct linespec_result *canon); @@ -194,14 +211,15 @@ extern struct symtabs_and_lines parse_probes (char **argptr, extern void register_probe_ops (struct probe *probe); -/* Given a PC, find an associated probe with type PTYPE. If a probe is - found, return it. If no probe is found, return NULL. */ +/* Given a PC, find an associated probe. If a probe is found, return + it. If no probe is found, return a bound probe whose fields are + both NULL. */ -extern struct probe *find_probe_by_pc (CORE_ADDR pc); +extern struct bound_probe find_probe_by_pc (CORE_ADDR pc); -/* Search OBJFILE for a probe with the given PROVIDER, NAME and PTYPE. - Return a VEC of all probes that were found. If no matching probe - is found, return NULL. The caller must free the VEC. */ +/* Search OBJFILE for a probe with the given PROVIDER, NAME. Return a + VEC of all probes that were found. If no matching probe is found, + return NULL. The caller must free the VEC. */ extern VEC (probe_p) *find_probes_in_objfile (struct objfile *objfile, const char *provider, @@ -212,7 +230,7 @@ extern VEC (probe_p) *find_probes_in_objfile (struct objfile *objfile, function that can be used by the probe backends to print their `info probe TYPE'. */ -extern void info_probes_for_ops (char *arg, int from_tty, +extern void info_probes_for_ops (const char *arg, int from_tty, const struct probe_ops *pops); /* Return the `cmd_list_element' associated with the `info probes' command, @@ -222,6 +240,12 @@ extern void info_probes_for_ops (char *arg, int from_tty, extern struct cmd_list_element **info_probes_cmdlist_get (void); +/* Compute the probe's relocated address. OBJFILE is the objfile in + which the probe originated. */ + +extern CORE_ADDR get_probe_address (struct probe *probe, + struct objfile *objfile); + /* Return the argument count of the specified probe. */ extern unsigned get_probe_argument_count (struct probe *probe,