3 cisctrace, risctrace, ciscframe, riscframe, localaddr, symoff,
4 fpformat, beieee80ftos, beieeesftos, beieeedftos, leieee80ftos,
5 leieeesftos, leieeedftos, ieeesftos, ieeedftos \- machine-independent debugger functions
18 int cisctrace(Map *map, ulong pc, ulong sp, ulong link,
24 int risctrace(Map *map, ulong pc, ulong sp, ulong link,
30 ulong ciscframe(Map *map, ulong addr, ulong pc, ulong sp,
36 ulong riscframe(Map *map, ulong addr, ulong pc, ulong sp,
42 int localaddr(Map *map, char *fn, char *var, long *ret,
47 int symoff(char *buf, int n, long addr, int type)
50 int fpformat(Map *map, Reglist *rp, char *buf, int n, int code)
53 int beieee80ftos(char *buf, int n, void *fp)
56 int beieeesftos(char *buf, int n, void *fp)
59 int beieeedftos(char *buf, int n, void *fp)
62 int leieee80ftos(char *buf, int n, void *fp)
65 int leieeesftos(char *buf, int n, void *fp)
68 int leieeedftos(char *buf, int n, void *fp)
71 int ieeesftos(char *buf, int n, ulong f)
74 int ieeedftos(char *buf, int n, ulong high, ulong low)
77 extern Machdata *machdata;
79 These functions provide machine-independent implementations
80 of common debugger functions.
81 Many of the functions assume that global variables
89 data structures describing the target architecture.
90 The former contains machine parameters and a description of
91 the register set; it is usually
96 to interpret the header of an executable.
100 is primarily a jump table specifying
101 functions appropriate for processing an
102 executable image for a given architecture.
103 Each application is responsible for setting
105 to the address of the
107 structure for the target architecture.
108 Many of the functions described here are not
109 called directly; instead, they are invoked
110 indirectly through the
114 These functions must retrieve data and register contents
115 from an executing image. The
120 supports the consistent retrieval of data, but
121 no uniform access mechanism exists for registers.
122 The application passes the address of a register
123 retrieval function as an argument to those functions
124 requiring register values.
125 This function, called an
130 .B "ulong rget(Map *map, char *name);
133 It returns the contents of a register when given
136 associated with an executing image and the name of the register.
141 unwind the stack for up to 40 levels or until the frame for
143 is found. They return the
144 count of the number of levels unwound. These functions
145 process stacks conforming to the generic compiler model for
149 architectures, respectively.
153 data structure associated with the image
154 of an executing process.
159 are starting values for the stack pointer, program counter, and
160 link register from which the unwinding is to take place. Normally, they are
161 the current contents of the appropriate
162 registers but they can be any values defining a legitimate
163 process context, for example, an alternate stack in a
164 multi-threaded process.
166 is the address of an application-supplied function to be called
167 on each iteration as the frame unwinds. The prototype of this
171 .B "void tracer(Map *map, ulong pc, ulong fp, Symbol *s);
186 are the program counter and frame pointer.
190 structure, as defined in
192 containing the symbol table information for the
193 function owning the frame (i.e., the function that
194 caused the frame to be instantiated).
199 calculate the frame pointer associated with
200 a function. They are suitable for
201 programs conforming to the
209 associated with the memory image of an executing
212 is the entry point of the desired function.
217 are the program counter, stack pointer and link register of
218 an execution context. As with the stack trace
219 functions, these can be the current values of the
220 registers or any legitimate execution context.
221 The value of the frame pointer is returned. A return
222 value of zero indicates an error.
228 with the address of a local variable.
232 associated with an executing memory image.
236 are pointers to the names of the function and variable of interest.
238 is the address of a register retrieval function.
243 are non-zero, the frame for function
245 is calculated and the address of the automatic or
248 in that frame is returned.
251 is zero, the address of the
255 In all cases, the frame for the function named
257 must be instantiated somewhere on the current stack.
258 If there are multiple frames for the function (that is, if
259 it is recursive), the most recent frame is used.
260 The search starts from the context defined by the
261 current value of the program counter and stack pointer.
262 If a valid address is found,
264 returns 1. A negative return indicates an error in
265 resolving the address.
268 converts a virtual address to a symbolic reference. The
269 string containing that reference is of
270 the form `name+offset', where `name' is the name of the
271 nearest symbol with an address less than
272 or equal to the target address and `offset' is the hexadecimal offset
273 beyond that symbol. If `offset' is zero, only the name of
274 the symbol is printed. If no symbol is found within 4,096
275 bytes of the address, the address is formatted as a hexadecimal
278 is the address of a buffer of
280 characters to receive the formatted string.
282 is the address to be converted.
284 is the type code of the search space:
290 returns the length of the formatted string contained in
294 converts the contents of a floating point register to a
299 associated with an executing process.
303 data structure describing the desired register.
305 is the address of a buffer of
307 characters to hold the resulting string.
314 or single precision, respectively. If
318 the contents of the specified register and
319 the following register
320 are interpreted as a double precision floating point
322 is only meaningful for architectures that implement
323 double precision floats by combining adjacent
324 single precision registers.
328 the specified register is formatted
329 as a single precision float.
331 returns 1 if the number is successfully converted or \-1
332 in the case of an error.
338 convert big-endian 80-bit extended, 32-bit single precision,
339 and 64-bit double precision floating point values to
345 are the little-endian counterparts.
347 is the address of a buffer of
349 characters to receive the formatted string.
351 is the address of the floating point value to be
352 converted. These functions return the length of
353 the resulting string.
356 converts the 32-bit single precision floating point value
362 bytes. It returns the length of the resulting string.
365 converts a 64-bit double precision floating point value
366 to a character string.
368 is the address of a buffer of
370 characters to hold the resulting string.
374 contain the most and least significant 32 bits of
375 the floating point value, respectively.
377 returns the number of characters in the resulting string.