diff options
Diffstat (limited to 'gdb/target.h')
| -rw-r--r-- | gdb/target.h | 79 |
1 files changed, 54 insertions, 25 deletions
diff --git a/gdb/target.h b/gdb/target.h index 004494d..bf35227 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -108,7 +108,7 @@ enum thread_control_capabilities /* The structure below stores information about a system call. It is basically used in the "catch syscall" command, and in every function that gives information about a system call. - + It's also good to mention that its fields represent everything that we currently know about a syscall in GDB. */ struct syscall @@ -392,18 +392,18 @@ typedef void async_callback_ftype (enum inferior_event_type event_type, /* These defines are used to mark target_ops methods. The script make-target-delegates scans these and auto-generates the base method implementations. There are four macros that can be used: - + 1. TARGET_DEFAULT_IGNORE. There is no argument. The base method does nothing. This is only valid if the method return type is 'void'. - + 2. TARGET_DEFAULT_NORETURN. The argument is a function call, like 'tcomplain ()'. The base method simply makes this call, which is assumed not to return. - + 3. TARGET_DEFAULT_RETURN. The argument is a C expression. The base method returns this expression's value. - + 4. TARGET_DEFAULT_FUNC. The argument is the name of a function. make-target-delegates does not generate a base method in this case, but instead uses the argument function as the base method. */ @@ -601,8 +601,8 @@ struct target_ops TARGET_DEFAULT_RETURN (false); virtual bool have_steppable_watchpoint () TARGET_DEFAULT_RETURN (false); - virtual bool stopped_data_address (CORE_ADDR *) - TARGET_DEFAULT_RETURN (false); + virtual std::vector<CORE_ADDR> stopped_data_addresses () + TARGET_DEFAULT_RETURN (std::vector<CORE_ADDR> ()); virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); @@ -1016,8 +1016,8 @@ struct target_ops filesystem seen by the debugger (GDB or, for remote targets, the remote stub). Return 0 on success, or -1 if an error occurs (and set *TARGET_ERRNO). */ - virtual int fileio_stat (struct inferior *inf, const char *filename, - struct stat *sb, fileio_error *target_errno); + virtual int fileio_lstat (struct inferior *inf, const char *filename, + struct stat *sb, fileio_error *target_errno); /* Close FD on the target. Return 0, or -1 if an error occurs (and set *TARGET_ERRNO). */ @@ -1236,9 +1236,9 @@ struct target_ops virtual enum record_method record_method (ptid_t ptid) TARGET_DEFAULT_RETURN (RECORD_METHOD_NONE); - /* Stop trace recording. */ - virtual void stop_recording () - TARGET_DEFAULT_IGNORE (); + /* Stop trace recording. Return whether the selected thread moved. */ + virtual bool stop_recording () + TARGET_DEFAULT_RETURN (false); /* Print information about the recording. */ virtual void info_record () @@ -1399,6 +1399,23 @@ struct target_ops virtual void displaced_step_restore_all_in_ptid (inferior *parent_inf, ptid_t child_ptid) TARGET_DEFAULT_FUNC (default_displaced_step_restore_all_in_ptid); + + /* Return true if an instance of this target can appear on multiple + target stacks, or false if an instance of this target can only + appear on a single target stack. + + Returning false doesn't mean that GDB can't create multiple + instances of this target, just that each instance will only be used + by a single inferior. + + The default return value for this function is true indicating + targets can be shared. The only non-shareable targets are some of + the process_stratum_target sub-classes, as such, this default is + changed in process_stratum_target to return false, then those + process_stratum_target sub-classes that are shareable set this to + true. */ + virtual bool is_shareable () + { return true; } }; /* Deleter for std::unique_ptr. See comments in @@ -2169,11 +2186,22 @@ extern int target_remove_hw_breakpoint (gdbarch *gdbarch, extern int target_ranged_break_num_registers (void); -/* Return non-zero if target knows the data address which triggered this - target_stopped_by_watchpoint, in such case place it to *ADDR_P. Only the - INFERIOR_PTID task is being queried. */ -#define target_stopped_data_address(target, addr_p) \ - (target)->stopped_data_address (addr_p) +/* Return a vector containing the data addresses which triggered this + target_stopped_by_watchpoint if the addresses are known. If the + addresses are not known then an empty vector is returned. Only the + INFERIOR_PTID task is being queried. + + Some targets, for example AArch64, have imprecise reporting of + watchpoint event addresses. As a result, many watchpoints could account + for a single watchpoint event. In such a case, this method will return + the address of all possible watchpoints, and it is up to GDB core to + select a suitable watchpoint to display to the user, for example, by + checking the value of write watchpoints. Or GDB core could tell the + user that it is unable to disambiguate between multiple read watchpoints + (though this isn't currently done). */ + +#define target_stopped_data_addresses(target) \ + (target)->stopped_data_addresses () /* Return non-zero if ADDR is within the range of a watchpoint spanning LENGTH bytes beginning at START. */ @@ -2256,8 +2284,8 @@ extern int target_fileio_fstat (int fd, struct stat *sb, filesystem seen by the debugger (GDB or, for remote targets, the remote stub). Return 0 on success, or -1 if an error occurs (and set *TARGET_ERRNO). */ -extern int target_fileio_stat (struct inferior *inf, const char *filename, - struct stat *sb, fileio_error *target_errno); +extern int target_fileio_lstat (struct inferior *inf, const char *filename, + struct stat *sb, fileio_error *target_errno); /* Close FD on the target. Return 0, or -1 if an error occurs (and set *TARGET_ERRNO). */ @@ -2472,8 +2500,14 @@ extern void target_pre_inferior (); extern void target_preopen (int); +/* Using the objfile specified in OBJFILE, find the address for the + current thread's thread-local storage with offset OFFSET. If it's + provided, NAME might be used to indicate the relevant variable + in an error message. */ + extern CORE_ADDR target_translate_tls_address (struct objfile *objfile, - CORE_ADDR offset); + CORE_ADDR offset, + const char *name = nullptr); /* Return the "section" containing the specified address. */ const struct target_section *target_section_by_addr (struct target_ops *target, @@ -2535,11 +2569,6 @@ extern void initialize_targets (void); extern void target_require_runnable (void); -/* Find the target at STRATUM. If no target is at that stratum, - return NULL. */ - -struct target_ops *find_target_at (enum strata stratum); - /* Read OS data object of type TYPE from the target, and return it in XML format. The return value follows the same rules as target_read_stralloc. */ |
