OLD | NEW |
1 @c \input texinfo | 1 @c \input texinfo |
2 @c %**start of header | 2 @c %**start of header |
3 @c @setfilename agentexpr.info | 3 @c @setfilename agentexpr.info |
4 @c @settitle GDB Agent Expressions | 4 @c @settitle GDB Agent Expressions |
5 @c @setchapternewpage off | 5 @c @setchapternewpage off |
6 @c %**end of header | 6 @c %**end of header |
7 | 7 |
8 @c This file is part of the GDB manual. | 8 @c This file is part of the GDB manual. |
9 @c | 9 @c |
10 @c Copyright (C) 2003-2006, 2009-2012 Free Software Foundation, Inc. | 10 @c Copyright (C) 2003-2006, 2009-2012 Free Software Foundation, Inc. |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 @item @code{tracev} (0x2e) @var{n}: @result{} @var{a} | 487 @item @code{tracev} (0x2e) @var{n}: @result{} @var{a} |
488 Record the value of trace state variable number @var{n} in the trace | 488 Record the value of trace state variable number @var{n} in the trace |
489 buffer. The handling of @var{n} is as described for @code{getv}. | 489 buffer. The handling of @var{n} is as described for @code{getv}. |
490 | 490 |
491 @item @code{tracenz} (0x2f) @var{addr} @var{size} @result{} | 491 @item @code{tracenz} (0x2f) @var{addr} @var{size} @result{} |
492 Record the bytes at @var{addr} in a trace buffer, for later retrieval | 492 Record the bytes at @var{addr} in a trace buffer, for later retrieval |
493 by GDB. Stop at either the first zero byte, or when @var{size} bytes | 493 by GDB. Stop at either the first zero byte, or when @var{size} bytes |
494 have been recorded, whichever occurs first. | 494 have been recorded, whichever occurs first. |
495 | 495 |
| 496 @item @code{printf} (0x34) @var{numargs} @var{string} @result{} |
| 497 Do a formatted print, in the style of the C function @code{printf}). |
| 498 The value of @var{numargs} is the number of arguments to expect on the |
| 499 stack, while @var{string} is the format string, prefixed with a |
| 500 two-byte length. The last byte of the string must be zero, and is |
| 501 included in the length. The format string includes escaped sequences |
| 502 just as it appears in C source, so for instance the format string |
| 503 @code{"\t%d\n"} is six characters long, and the output will consist of |
| 504 a tab character, a decimal number, and a newline. At the top of the |
| 505 stack, above the values to be printed, this bytecode will pop a |
| 506 ``function'' and ``channel''. If the function is nonzero, then the |
| 507 target may treat it as a function and call it, passing the channel as |
| 508 a first argument, as with the C function @code{fprintf}. If the |
| 509 function is zero, then the target may simply call a standard formatted |
| 510 print function of its choice. In all, this bytecode pops 2 + |
| 511 @var{numargs} stack elements, and pushes nothing. |
| 512 |
496 @item @code{end} (0x27): @result{} | 513 @item @code{end} (0x27): @result{} |
497 Stop executing bytecode; the result should be the top element of the | 514 Stop executing bytecode; the result should be the top element of the |
498 stack. If the purpose of the expression was to compute an lvalue or a | 515 stack. If the purpose of the expression was to compute an lvalue or a |
499 range of memory, then the next-to-top of the stack is the lvalue's | 516 range of memory, then the next-to-top of the stack is the lvalue's |
500 address, and the top of the stack is the lvalue's size, in bytes. | 517 address, and the top of the stack is the lvalue's size, in bytes. |
501 | 518 |
502 @end table | 519 @end table |
503 | 520 |
504 | 521 |
505 @node Using Agent Expressions | 522 @node Using Agent Expressions |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 That opcode was added by the customer that contracted Cygnus for the | 758 That opcode was added by the customer that contracted Cygnus for the |
742 data tracing work. I personally think it is unnecessary; objects that | 759 data tracing work. I personally think it is unnecessary; objects that |
743 large will be quite rare, so it is okay to use @code{dup const16 | 760 large will be quite rare, so it is okay to use @code{dup const16 |
744 @var{size} trace} in those cases. | 761 @var{size} trace} in those cases. |
745 | 762 |
746 Whatever we decide to do with @code{trace16}, we should at least leave | 763 Whatever we decide to do with @code{trace16}, we should at least leave |
747 opcode 0x30 reserved, to remain compatible with the customer who added | 764 opcode 0x30 reserved, to remain compatible with the customer who added |
748 it. | 765 it. |
749 | 766 |
750 @end table | 767 @end table |
OLD | NEW |