From b383017de01da907f3e6336936e1a9d3d1f029e2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 4 Feb 2004 23:24:43 +0000 Subject: 2004-02-04 Roland McGrath * gdb.texinfo (Auxiliary Vector): New node (section). (Data): Add it to the menu. --- gdb/doc/gdb.texinfo | 425 ++++++++++++++++++++++++++++------------------------ 1 file changed, 226 insertions(+), 199 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 3c8acbf..0e69315 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -861,7 +861,7 @@ equivalent to the @samp{-c}/@samp{-p} option followed by that argument.) If the second argument begins with a decimal digit, @value{GDBN} will first attempt to attach to it as a process, and if that fails, attempt to open it as a corefile. If you have a corefile whose name begins with -a digit, you can prevent @value{GDBN} from treating it as a pid by +a digit, you can prevent @value{GDBN} from treating it as a pid by prefixing it with @file{./}, eg. @file{./12345}. If @value{GDBN} has not been configured to included core file support, @@ -901,7 +901,7 @@ file. @itemx -c @var{file} @cindex @code{--core} @cindex @code{-c} -Use file @var{file} as a core dump to examine. +Use file @var{file} as a core dump to examine. @item -c @var{number} @item -pid @var{number} @@ -1112,7 +1112,7 @@ Run using @var{device} for your program's standard input and output. @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -Activate the Terminal User Interface when starting. +Activate the Terminal User Interface when starting. The Terminal User Interface manages several text windows on the terminal, showing source, assembly, registers and @value{GDBN} command outputs (@pxref{TUI, ,@value{GDBN} Text User Interface}). @@ -3247,7 +3247,7 @@ end @cindex overloading @cindex symbol overloading -Some programming languages (notably C@t{++} and Objective-C) permit a +Some programming languages (notably C@t{++} and Objective-C) permit a single function name to be defined several times, for application in different contexts. This is called @dfn{overloading}. When a function name is overloaded, @@ -3378,7 +3378,7 @@ Such warnings are printed both for user settable and @value{GDBN}'s internal breakpoints. If you see one of these warnings, you should verify that a breakpoint set at the adjusted address will have the desired affect. If not, the breakpoint in question may be removed and -other breakpoints may be set which will have the desired behavior. +other breakpoints may be set which will have the desired behavior. E.g., it may be sufficient to place the breakpoint at a later instruction. A conditional breakpoint may also be useful in some cases to prevent the breakpoint from triggering too often. @@ -4716,6 +4716,7 @@ Table}. * Registers:: Registers * Floating Point Hardware:: Floating point hardware * Vector Unit:: Vector Unit +* Auxiliary Vector:: Auxiliary data provided by operating system * Memory Region Attributes:: Memory region attributes * Dump/Restore Files:: Copy between memory and a file * Character Sets:: Debugging programs that use a different @@ -5896,12 +5897,38 @@ Display information about the vector unit. The exact contents and layout vary depending on the hardware. @end table +@node Auxiliary Vector +@section Operating system auxiliary vector +@cindex auxiliary vector +@cindex vector, auxiliary + +Some operating systems supply an @dfn{auxiliary vector} to programs at +startup. This is akin to the arguments and environment that you +specify for a program, but contains a system-dependent variety of +binary values that tell system libraries important details about the +hardware, operating system, and process. Each value's purpose is +identified by an integer tag; the meanings are well-known but system-specific. +Depending on the configuration and operating system facilities, +@value{GDBN} may be able to show you this information. + +@table @code +@kindex info auxv +@item info auxv +Display the auxiliary vector of the inferior, which can be either a +live process or a core dump file. @{GDBN} prints each tag value +numerically, and also shows names and text descriptions for recognized +tags. Some values in the vector are numbers, some bit masks, and some +pointers to strings or other data. @{GDBN} displays each value in the +most appropriate form for a recognized tag, and in hexadecimal for +an unrecognized tag. +@end table + @node Memory Region Attributes -@section Memory region attributes +@section Memory region attributes @cindex memory region attributes -@dfn{Memory region attributes} allow you to describe special handling -required by regions of your target's memory. @value{GDBN} uses attributes +@dfn{Memory region attributes} allow you to describe special handling +required by regions of your target's memory. @value{GDBN} uses attributes to determine whether to allow certain types of memory accesses; whether to use specific width accesses; and whether to cache target memory. @@ -5911,7 +5938,7 @@ accessing memory in that region. Similarly, if no memory regions have been defined, @value{GDBN} uses the default attributes when accessing all memory. -When a memory region is defined, it is given a number to identify it; +When a memory region is defined, it is given a number to identify it; to enable, disable, or remove a memory region, you specify that number. @table @code @@ -5929,7 +5956,7 @@ Remove memory regions @var{nums}@dots{}. @kindex disable mem @item disable mem @var{nums}@dots{} Disable memory regions @var{nums}@dots{}. -A disabled memory region is not forgotten. +A disabled memory region is not forgotten. It may be enabled again later. @kindex enable mem @@ -5944,7 +5971,7 @@ for each region. @table @emph @item Memory Region Number @item Enabled or Disabled. -Enabled memory regions are marked with @samp{y}. +Enabled memory regions are marked with @samp{y}. Disabled memory regions are marked with @samp{n}. @item Lo Address @@ -5961,7 +5988,7 @@ The list of attributes set for this memory region. @subsection Attributes -@subsubsection Memory Access Mode +@subsubsection Memory Access Mode The access mode attributes set whether @value{GDBN} may make read or write accesses to a memory region. @@ -6002,7 +6029,7 @@ Use 64 bit memory accesses. @c @c @table @code @c @item hwbreak -@c Always use hardware breakpoints +@c Always use hardware breakpoints @c @item swbreak (default) @c @end table @@ -6015,13 +6042,13 @@ registers. @table @code @item cache -Enable @value{GDBN} to cache target memory. +Enable @value{GDBN} to cache target memory. @item nocache Disable @value{GDBN} from caching target memory. This is the default. @end table @c @subsubsection Memory Write Verification -@c The memory write verification attributes set whether @value{GDBN} +@c The memory write verification attributes set whether @value{GDBN} @c will re-reads data after each write to verify the write was successful. @c @c @table @code @@ -6083,7 +6110,7 @@ Restore the contents of file @var{filename} into memory. The file format, except for raw binary. To restore a raw binary file you must specify the optional keyword @code{binary} after the filename. -If @var{bias} is non-zero, its value will be added to the addresses +If @var{bias} is non-zero, its value will be added to the addresses contained in the file. Binary files always start at address zero, so they will be restored at address @var{bias}. Other bfd files have a built-in location; they will be restored at offset @var{bias} @@ -6091,7 +6118,7 @@ from that location. If @var{start} and/or @var{end} are non-zero, then only data between file offset @var{start} and file offset @var{end} will be restored. -These offsets are relative to the addresses in the file, before +These offsets are relative to the addresses in the file, before the @var{bias} argument is applied. @end table @@ -6162,15 +6189,15 @@ for both host and target. @item show charset @kindex show charset -Show the names of the current host and target charsets. +Show the names of the current host and target charsets. @itemx show host-charset @kindex show host-charset -Show the name of the current host charset. +Show the name of the current host charset. @itemx show target-charset @kindex show target-charset -Show the name of the current target charset. +Show the name of the current target charset. @end table @@ -6237,7 +6264,7 @@ $ gdb -nw charset-test GNU gdb 2001-12-19-cvs Copyright 2001 Free Software Foundation, Inc. @dots{} -(gdb) +(gdb) @end smallexample We can use the @code{show charset} command to see what character sets @@ -6247,7 +6274,7 @@ strings: @smallexample (gdb) show charset The current host and target character set is `ISO-8859-1'. -(gdb) +(gdb) @end smallexample For the sake of printing this manual, let's use @sc{ascii} as our @@ -6256,7 +6283,7 @@ initial character set: (gdb) set charset ASCII (gdb) show charset The current host and target character set is `ASCII'. -(gdb) +(gdb) @end smallexample Let's assume that @sc{ascii} is indeed the correct character set for our @@ -6270,7 +6297,7 @@ them properly. Since our current target character set is also $1 = 0x401698 "Hello, world!\n" (gdb) print ascii_hello[0] $2 = 72 'H' -(gdb) +(gdb) @end smallexample @value{GDBN} uses the target character set for character and string @@ -6279,7 +6306,7 @@ literals you use in expressions: @smallexample (gdb) print '+' $3 = 43 '+' -(gdb) +(gdb) @end smallexample The @sc{ascii} character set uses the number 43 to encode the @samp{+} @@ -6294,7 +6321,7 @@ character set is still @sc{ascii}, we get jibberish: $4 = 0x4016a8 "\310\205\223\223\226k@@\246\226\231\223\204Z%" (gdb) print ibm1047_hello[0] $5 = 200 '\310' -(gdb) +(gdb) @end smallexample If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB}, @@ -6302,8 +6329,8 @@ If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB}, @smallexample (gdb) set target-charset -ASCII EBCDIC-US IBM1047 ISO-8859-1 -(gdb) set target-charset +ASCII EBCDIC-US IBM1047 ISO-8859-1 +(gdb) set target-charset @end smallexample We can select @sc{ibm1047} as our target character set, and examine the @@ -6334,7 +6361,7 @@ string literals you use in expressions: @smallexample (gdb) print '+' $10 = 78 '+' -(gdb) +(gdb) @end smallexample The @sc{ibm1047} character set uses the number 78 to encode the @samp{+} @@ -6505,7 +6532,7 @@ Defined at /home/jimb/gdb/macros/play/sample.h:1 expands to: (42 + 1) (gdb) macro expand-once ADD(1) expands to: once (M + 1) -(gdb) +(gdb) @end smallexample In the example above, note that @command{macro expand-once} expands only @@ -6520,11 +6547,11 @@ the source line of the current stack frame: (gdb) break main Breakpoint 1 at 0x8048370: file sample.c, line 10. (gdb) run -Starting program: /home/jimb/gdb/macros/play/sample +Starting program: /home/jimb/gdb/macros/play/sample Breakpoint 1, main () at sample.c:10 10 printf ("Hello, world!\n"); -(gdb) +(gdb) @end smallexample At line 10, the definition of the macro @code{N} at line 9 is in force: @@ -6537,7 +6564,7 @@ Defined at /home/jimb/gdb/macros/play/sample.c:9 expands to: 28 < 42 (gdb) print N Q M $1 = 1 -(gdb) +(gdb) @end smallexample As we step over directives that remove @code{N}'s definition, and then @@ -6561,7 +6588,7 @@ Defined at /home/jimb/gdb/macros/play/sample.c:13 expands to: 1729 < 42 (gdb) print N Q M $2 = 0 -(gdb) +(gdb) @end smallexample @@ -6600,9 +6627,9 @@ tracepoints as of this writing. This chapter describes the tracepoint commands and features. @menu -* Set Tracepoints:: -* Analyze Collected Data:: -* Tracepoint Variables:: +* Set Tracepoints:: +* Analyze Collected Data:: +* Tracepoint Variables:: @end menu @node Set Tracepoints @@ -6627,12 +6654,12 @@ This section describes commands to set tracepoints and associated conditions and actions. @menu -* Create and Delete Tracepoints:: -* Enable and Disable Tracepoints:: -* Tracepoint Passcounts:: -* Tracepoint Actions:: -* Listing Tracepoints:: -* Starting and Stopping Trace Experiment:: +* Create and Delete Tracepoints:: +* Enable and Disable Tracepoints:: +* Tracepoint Passcounts:: +* Tracepoint Actions:: +* Listing Tracepoints:: +* Starting and Stopping Trace Experiment:: @end menu @node Create and Delete Tracepoints @@ -6731,7 +6758,7 @@ user. Examples: @smallexample -(@value{GDBP}) @b{passcount 5 2} // Stop on the 5th execution of +(@value{GDBP}) @b{passcount 5 2} // Stop on the 5th execution of @exdent @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @code{// tracepoint 2} (@value{GDBP}) @b{passcount 12} // Stop on the 12th execution of the @@ -7443,7 +7470,7 @@ name normally: @smallexample (gdb) overlay list -Section .ov.foo.text, loaded at 0x100000 - 0x100034, +Section .ov.foo.text, loaded at 0x100000 - 0x100034, mapped at 0x1016 - 0x104a (gdb) print foo $6 = @{int (int)@} 0x1016 @@ -7526,7 +7553,7 @@ will silently set a breakpoint there. If the overlay manager then calls this function whenever it has changed the overlay table, this will enable @value{GDBN} to accurately keep track of which overlays are in program memory, and update any breakpoints that may be set -in overlays. This will allow breakpoints to work even if the +in overlays. This will allow breakpoints to work even if the overlays are kept in ROM or other non-writable memory while they are not being executed. @@ -7958,7 +7985,7 @@ language reference or tutorial. @menu * C:: C and C@t{++} -* Objective-C:: Objective-C +* Objective-C:: Objective-C * Modula-2:: Modula-2 @end menu @@ -8484,8 +8511,8 @@ This section provides information about some commands and command options that are useful for debugging Objective-C code. @menu -* Method Names in Commands:: -* The Print Command with Objective-C:: +* Method Names in Commands:: +* The Print Command with Objective-C:: @end menu @node Method Names in Commands, The Print Command with Objective-C, Objective-C, Objective-C @@ -9217,8 +9244,8 @@ Print the names and data types of all defined functions whose names contain a match for regular expression @var{regexp}. Thus, @samp{info fun step} finds all functions whose names include @code{step}; @samp{info fun ^step} finds those whose names -start with @code{step}. If a function name contains characters -that conflict with the regular expression language (eg. +start with @code{step}. If a function name contains characters +that conflict with the regular expression language (eg. @samp{operator*()}), they may be quoted with a backslash. @kindex info variables @@ -9349,7 +9376,7 @@ structure in more detail. For example: (@value{GDBP}) maint info psymtabs dwarf2read @{ objfile /home/gnu/build/gdb/gdb ((struct objfile *) 0x82e69d0) - @{ psymtab /home/gnu/src/gdb/dwarf2read.c + @{ psymtab /home/gnu/src/gdb/dwarf2read.c ((struct partial_symtab *) 0x8474b10) readin no fullname (null) @@ -9374,9 +9401,9 @@ read the symtab for the compilation unit containing that function: Breakpoint 1 at 0x814e5da: file /home/gnu/src/gdb/dwarf2read.c, line 1574. (@value{GDBP}) maint info symtabs -@{ objfile /home/gnu/build/gdb/gdb +@{ objfile /home/gnu/build/gdb/gdb ((struct objfile *) 0x82e69d0) - @{ symtab /home/gnu/src/gdb/dwarf2read.c + @{ symtab /home/gnu/src/gdb/dwarf2read.c ((struct symtab *) 0x86c1f38) dirname (null) fullname (null) @@ -9384,7 +9411,7 @@ line 1574. debugformat DWARF 2 @} @} -(@value{GDBP}) +(@value{GDBP}) @end smallexample @end table @@ -11486,10 +11513,10 @@ accepts addresses which may belong to @emph{any} segment. For example, here's how to display the Page Table entry for the page where the variable @code{i} is stored: -@smallexample +@smallexample @exdent @code{(@value{GDBP}) info dos address-pte __djgpp_base_address + (char *)&i} @exdent @code{Page Table entry for address 0x11a00d30:} -@exdent @code{Base=0x02698000 Dirty Acc. Not-Cached Write-Back Usr Read-Write +0xd30} +@exdent @code{Base=0x02698000 Dirty Acc. Not-Cached Write-Back Usr Read-Write +0xd30} @end smallexample @noindent @@ -11558,9 +11585,9 @@ This is a Cygwin specific alias of info shared. This command loads symbols from a dll similarly to add-sym command but without the need to specify a base address. -@kindex set new-console +@kindex set new-console @item set new-console @var{mode} -If @var{mode} is @code{on} the debuggee will +If @var{mode} is @code{on} the debuggee will be started in a new console on next start. If @var{mode} is @code{off}i, the debuggee will be started in the same console as the debugger. @@ -11587,17 +11614,17 @@ This boolean value adds debug output concerning events seen by the debugger. @kindex set debugexec @item set debugexec -This boolean value adds debug output concerning execute events +This boolean value adds debug output concerning execute events seen by the debugger. @kindex set debugexceptions @item set debugexceptions -This boolean value adds debug ouptut concerning exception events +This boolean value adds debug ouptut concerning exception events seen by the debugger. @kindex set debugmemory @item set debugmemory -This boolean value adds debug ouptut concerning memory events +This boolean value adds debug ouptut concerning memory events seen by the debugger. @kindex set shell @@ -13170,7 +13197,7 @@ current ABI. @kindex show osabi One @value{GDBN} configuration can debug binaries for multiple operating -system targets, either via remote debugging or native emulation. +system targets, either via remote debugging or native emulation. @value{GDBN} will autodetect the @dfn{OS ABI} (Operating System ABI) in use, but you can override its conclusion using the @code{set osabi} command. One example where this is useful is in debugging of binaries which use @@ -13564,7 +13591,7 @@ end @end smallexample As a further example, to hook at the begining and end of the @code{echo} -command, and to add extra text to the beginning and end of the message, +command, and to add extra text to the beginning and end of the message, you could define: @smallexample @@ -14075,7 +14102,7 @@ key bindings such as @key{C-p}, @key{C-n}, @key{C-b} and @key{C-f}. The TUI provides a @emph{SingleKey} mode in which it installs a particular key binding in the readline keymaps to connect single keys to -some gdb commands. +some gdb commands. @table @kbd @kindex c @r{(SingleKey TUI key)} @@ -14381,7 +14408,7 @@ the files with these buffers if you wish; but keep in mind that @value{GDBN} communicates with Emacs in terms of line numbers. If you add or delete lines from the text, the line numbers that @value{GDBN} knows cease to correspond properly with the code. - + The description given here is for GNU Emacs version 21.3 and a more detailed description of its interaction with @value{GDBN} is given in the Emacs manual (@pxref{Debuggers,,, Emacs, The @sc{gnu} Emacs Manual}). @@ -16021,17 +16048,17 @@ The corresponding @value{GDBN} command is @samp{cd}. Add directories @var{pathdir} to beginning of search path for source files. If the @samp{-r} option is used, the search path is reset to the default -search path. If directories @var{pathdir} are supplied in addition to the +search path. If directories @var{pathdir} are supplied in addition to the @samp{-r} option, the search path is first reset and then addition occurs as normal. -Multiple directories may be specified, separated by blanks. Specifying +Multiple directories may be specified, separated by blanks. Specifying multiple directories in a single command results in the directories added to the beginning of the search path in the same order they were presented in the command. If blanks are needed as part of a directory name, double-quotes should be used around the name. In the command output, the path will show up separated -by the system directory-separator character. The directory-seperator +by the system directory-separator character. The directory-seperator character must not be used in any directory name. If no directories are specified, the current search path is displayed. @@ -16070,18 +16097,18 @@ The corresponding @value{GDBN} command is @samp{dir}. Add directories @var{pathdir} to beginning of search path for object files. If the @samp{-r} option is used, the search path is reset to the original -search path that existed at gdb start-up. If directories @var{pathdir} are -supplied in addition to the +search path that existed at gdb start-up. If directories @var{pathdir} are +supplied in addition to the @samp{-r} option, the search path is first reset and then addition occurs as normal. -Multiple directories may be specified, separated by blanks. Specifying +Multiple directories may be specified, separated by blanks. Specifying multiple directories in a single command results in the directories added to the beginning of the search path in the same order they were presented in the command. If blanks are needed as part of a directory name, double-quotes should be used around the name. In the command output, the path will show up separated -by the system directory-separator character. The directory-seperator +by the system directory-separator character. The directory-seperator character must not be used in any directory name. If no directories are specified, the current path is displayed. @@ -16095,7 +16122,7 @@ The corresponding @value{GDBN} command is @samp{path}. @smallexample (@value{GDBP}) --environment-path +-environment-path ^done,path="/usr/bin" (@value{GDBP}) -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin @@ -16701,7 +16728,7 @@ N.A. -file-list-exec-source-file @end smallexample -List the line number, the current source file, and the absolute path +List the line number, the current source file, and the absolute path to the current source file for the current executable. @subsubheading @value{GDBN} Command @@ -16914,7 +16941,7 @@ information when you start an interactive session. ~Type "show copying" to see the conditions. ~There is absolutely no warranty for GDB. Type "show warranty" for ~ details. -~This GDB was configured as +~This GDB was configured as "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi". ^done (@value{GDBP}) @@ -18322,7 +18349,7 @@ before the value of a child variable can be evaluated. Assigns the value of @var{expression} to the variable object specified by @var{name}. The object must be @samp{editable}. If the variable's -value is altered by the assign, the variable will show up in any +value is altered by the assign, the variable will show up in any subsequent @code{-var-update} list. @subsubheading Example @@ -18422,12 +18449,12 @@ for details. This GDB was configured as "i386-pc-linux-gnu" ^Z^Zpre-prompt -(gdb) +(gdb) ^Z^Zprompt @kbd{quit} ^Z^Zpost-prompt -$ +$ @end smallexample Here @samp{quit} is input to @value{GDBN}; the rest is output from @@ -18577,13 +18604,13 @@ deleted a breakpoint. @findex starting @findex stopping When the program starts executing due to a @value{GDBN} command such as -@code{step} or @code{continue}, +@code{step} or @code{continue}, @smallexample ^Z^Zstarting @end smallexample -is output. When the program stops, +is output. When the program stops, @smallexample ^Z^Zstopped @@ -19340,7 +19367,7 @@ A problem internal to GDB has been detected. Further debugging may prove unreliable. Quit this debugging session? (y or n) @kbd{n} Create a core file? (y or n) @kbd{n} -(gdb) +(gdb) @end smallexample Takes an optional parameter that is used as the text of the error or @@ -19363,7 +19390,7 @@ The program being debugged stopped while in a function called from GDB. 0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6 top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@} call_lo=0x01014000 call_hi=0x01014001 -(gdb) +(gdb) @end smallexample Takes an optional file parameter. @@ -19395,14 +19422,14 @@ Takes an optional file parameter. @smallexample (gdb) @kbd{maint print reggroups} - Group Type - general user - float user - all user - vector user - system user - save internal - restore internal + Group Type + general user + float user + all user + vector user + system user + save internal + restore internal @end smallexample @kindex maint set profile @@ -19421,7 +19448,7 @@ if you use profiling, @value{GDBN} will overwrite the profiling log file data in a @file{gmon.out} file, be sure to move it to a safe location. Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be -compiled with the @samp{-pg} compiler option. +compiled with the @samp{-pg} compiler option. @end table @@ -19535,8 +19562,8 @@ For any @var{command} not supported by the stub, an empty response protocol. A newer @value{GDBN} can tell if a packet is supported based on that response. -A stub is required to support the @samp{g}, @samp{G}, @samp{m}, @samp{M}, -@samp{c}, and @samp{s} @var{command}s. All other @var{command}s are +A stub is required to support the @samp{g}, @samp{G}, @samp{m}, @samp{M}, +@samp{c}, and @samp{s} @var{command}s. All other @var{command}s are optional. @node Packets @@ -19701,7 +19728,7 @@ for an error Reserved for future use. -@item @code{H}@var{c}@var{t@dots{}} --- set thread +@item @code{H}@var{c}@var{t@dots{}} --- set thread @cindex @code{H} packet Set thread for subsequent operations (@samp{m}, @samp{M}, @samp{g}, @@ -19912,7 +19939,7 @@ Like @samp{C} but step not continue. Reply: @xref{Stop Reply Packets}, for the reply specifications. -@item @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} --- search +@item @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} --- search @cindex @code{t} packet Search backwards starting at address @var{addr} for a match with pattern @@ -20525,20 +20552,20 @@ system are not supported by this protocol. The File-I/O protocol uses the @code{F} packet, as request as well as as reply packet. Since a File-I/O system call can only occur when -@value{GDBN} is waiting for the continuing or stepping target, the +@value{GDBN} is waiting for the continuing or stepping target, the File-I/O request is a reply that @value{GDBN} has to expect as a result of a former @samp{C}, @samp{c}, @samp{S} or @samp{s} packet. This @code{F} packet contains all information needed to allow @value{GDBN} to call the appropriate host system call: @itemize @bullet -@item +@item A unique identifier for the requested system call. @item All parameters to the system call. Pointers are given as addresses in the target memory address space. Pointers to strings are given as -pointer/length pair. Numerical values are given as they are. +pointer/length pair. Numerical values are given as they are. Numerical control values are given in a protocol specific representation. @end itemize @@ -20546,7 +20573,7 @@ Numerical control values are given in a protocol specific representation. At that point @value{GDBN} has to perform the following actions. @itemize @bullet -@item +@item If parameter pointer values are given, which point to data needed as input to a system call, @value{GDBN} requests this data from the target with a standard @code{m} packet request. This additional communication has to be @@ -20608,7 +20635,7 @@ This is just the name of the function. @var{parameter@dots{}} are the parameters to the system call. -@end table +@end table Parameters are hexadecimal integer values, either the real values in case of scalar datatypes, as pointers to target buffer space in case of compound @@ -20675,7 +20702,7 @@ reply packet. In this case the target should behave, as if it had gotten a break message. The meaning for the target is ``system call interupted by @code{SIGINT}''. Consequentially, the target should actually stop (as with a break message) and return to @value{GDBN} with a @code{T02} -packet. In this case, it's important for the target to know, in which +packet. In this case, it's important for the target to know, in which state the system call was interrupted. Since this action is by design not an atomic operation, we have to differ between two cases: @@ -20760,7 +20787,7 @@ in case the user pressed @kbd{Ctrl-C}. Otherwise the return value consists entirely of the exit status of the called command. Due to security concerns, the @code{system} call is refused to be called -by @value{GDBN} by default. The user has to allow this call explicitly by +by @value{GDBN} by default. The user has to allow this call explicitly by entering @table @samp @@ -20809,7 +20836,7 @@ The current setting is shown by typing int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode); -@exdent Request: +@exdent Request: Fopen,pathptr/len,flags,mode @end smallexample @@ -20817,30 +20844,30 @@ Fopen,pathptr/len,flags,mode @code{flags} is the bitwise or of the following values: @table @code -@item O_CREAT +@item O_CREAT If the file does not exist it will be created. The host rules apply as far as file ownership and time stamps are concerned. -@item O_EXCL +@item O_EXCL When used with O_CREAT, if the file already exists it is an error and open() fails. -@item O_TRUNC +@item O_TRUNC If the file already exists and the open mode allows writing (O_RDWR or O_WRONLY is given) it will be truncated to length 0. -@item O_APPEND +@item O_APPEND The file is opened in append mode. -@item O_RDONLY +@item O_RDONLY The file is opened for reading only. -@item O_WRONLY +@item O_WRONLY The file is opened for writing only. -@item O_RDWR +@item O_RDWR The file is opened for reading and writing. @noindent @@ -20852,22 +20879,22 @@ Each other bit is silently ignored. @code{mode} is the bitwise or of the following values: @table @code -@item S_IRUSR +@item S_IRUSR User has read permission. -@item S_IWUSR +@item S_IWUSR User has write permission. -@item S_IRGRP +@item S_IRGRP Group has read permission. -@item S_IWGRP +@item S_IWGRP Group has write permission. -@item S_IROTH +@item S_IROTH Others have read permission. -@item S_IWOTH +@item S_IWOTH Others have write permission. @noindent @@ -20884,42 +20911,42 @@ occured. @end smallexample @table @code -@item EEXIST +@item EEXIST pathname already exists and O_CREAT and O_EXCL were used. -@item EISDIR +@item EISDIR pathname refers to a directory. -@item EACCES +@item EACCES The requested access is not allowed. @item ENAMETOOLONG pathname was too long. -@item ENOENT +@item ENOENT A directory component in pathname does not exist. -@item ENODEV +@item ENODEV pathname refers to a device, pipe, named pipe or socket. -@item EROFS +@item EROFS pathname refers to a file on a read-only filesystem and write access was requested. -@item EFAULT +@item EFAULT pathname is an invalid pointer value. -@item ENOSPC +@item ENOSPC No space on device to create the file. -@item EMFILE +@item EMFILE The process already has the maximum number of files open. -@item ENFILE +@item ENFILE The limit on the total number of files open on the system has been reached. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -20928,10 +20955,10 @@ The call was interrupted by the user. @cindex close, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int close(int fd); -@exdent Request: +@exdent Request: Fclose,fd @exdent Return value: @@ -20941,10 +20968,10 @@ close returns zero on success, or -1 if an error occurred. @end smallexample @table @code -@item EBADF +@item EBADF fd isn't a valid open file descriptor. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -20953,29 +20980,29 @@ The call was interrupted by the user. @cindex read, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int read(int fd, void *buf, unsigned int count); -@exdent Request: +@exdent Request: Fread,fd,bufptr,count @exdent Return value: On success, the number of bytes read is returned. Zero indicates end of file. If count is zero, read -returns zero as well. On error, -1 is returned. +returns zero as well. On error, -1 is returned. @exdent Errors: @end smallexample @table @code -@item EBADF +@item EBADF fd is not a valid file descriptor or is not open for reading. -@item EFAULT +@item EFAULT buf is an invalid pointer value. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -20984,10 +21011,10 @@ The call was interrupted by the user. @cindex write, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int write(int fd, const void *buf, unsigned int count); -@exdent Request: +@exdent Request: Fwrite,fd,bufptr,count @exdent Return value: @@ -20999,21 +21026,21 @@ is returned. @end smallexample @table @code -@item EBADF +@item EBADF fd is not a valid file descriptor or is not open for writing. -@item EFAULT +@item EFAULT buf is an invalid pointer value. -@item EFBIG +@item EFBIG An attempt was made to write a file that exceeds the host specific maximum file size allowed. -@item ENOSPC +@item ENOSPC No space on device to write the data. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21022,24 +21049,24 @@ The call was interrupted by the user. @cindex lseek, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: long lseek (int fd, long offset, int flag); -@exdent Request: +@exdent Request: Flseek,fd,offset,flag @end smallexample @code{flag} is one of: @table @code -@item SEEK_SET +@item SEEK_SET The offset is set to offset bytes. -@item SEEK_CUR +@item SEEK_CUR The offset is set to its current location plus offset bytes. -@item SEEK_END +@item SEEK_END The offset is set to the size of the file plus offset bytes. @end table @@ -21054,16 +21081,16 @@ value of -1 is returned. @end smallexample @table @code -@item EBADF +@item EBADF fd is not a valid open file descriptor. -@item ESPIPE +@item ESPIPE fd is associated with the @value{GDBN} console. -@item EINVAL +@item EINVAL flag is not a proper value. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21072,10 +21099,10 @@ The call was interrupted by the user. @cindex rename, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int rename(const char *oldpath, const char *newpath); -@exdent Request: +@exdent Request: Frename,oldpathptr/len,newpathptr/len @exdent Return value: @@ -21085,47 +21112,47 @@ On success, zero is returned. On error, -1 is returned. @end smallexample @table @code -@item EISDIR +@item EISDIR newpath is an existing directory, but oldpath is not a directory. -@item EEXIST +@item EEXIST newpath is a non-empty directory. -@item EBUSY +@item EBUSY oldpath or newpath is a directory that is in use by some process. -@item EINVAL +@item EINVAL An attempt was made to make a directory a subdirectory of itself. -@item ENOTDIR +@item ENOTDIR A component used as a directory in oldpath or new path is not a directory. Or oldpath is a directory and newpath exists but is not a directory. -@item EFAULT +@item EFAULT oldpathptr or newpathptr are invalid pointer values. -@item EACCES +@item EACCES No access to the file or the path of the file. @item ENAMETOOLONG - + oldpath or newpath was too long. -@item ENOENT +@item ENOENT A directory component in oldpath or newpath does not exist. -@item EROFS +@item EROFS The file is on a read-only filesystem. -@item ENOSPC +@item ENOSPC The device containing the file has no room for the new directory entry. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21134,10 +21161,10 @@ The call was interrupted by the user. @cindex unlink, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int unlink(const char *pathname); -@exdent Request: +@exdent Request: Funlink,pathnameptr/len @exdent Return value: @@ -21147,32 +21174,32 @@ On success, zero is returned. On error, -1 is returned. @end smallexample @table @code -@item EACCES +@item EACCES No access to the file or the path of the file. -@item EPERM +@item EPERM The system does not allow unlinking of directories. -@item EBUSY +@item EBUSY The file pathname cannot be unlinked because it's being used by another process. -@item EFAULT +@item EFAULT pathnameptr is an invalid pointer value. @item ENAMETOOLONG pathname was too long. -@item ENOENT +@item ENOENT A directory component in pathname does not exist. -@item ENOTDIR +@item ENOTDIR A component of the path is not a directory. -@item EROFS +@item EROFS The file is on a read-only filesystem. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21182,11 +21209,11 @@ The call was interrupted by the user. @cindex stat, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int stat(const char *pathname, struct stat *buf); int fstat(int fd, struct stat *buf); -@exdent Request: +@exdent Request: Fstat,pathnameptr/len,bufptr Ffstat,fd,bufptr @@ -21197,26 +21224,26 @@ On success, zero is returned. On error, -1 is returned. @end smallexample @table @code -@item EBADF +@item EBADF fd is not a valid open file. -@item ENOENT +@item ENOENT A directory component in pathname does not exist or the path is an empty string. -@item ENOTDIR +@item ENOTDIR A component of the path is not a directory. -@item EFAULT +@item EFAULT pathnameptr is an invalid pointer value. -@item EACCES +@item EACCES No access to the file or the path of the file. @item ENAMETOOLONG pathname was too long. -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21225,10 +21252,10 @@ The call was interrupted by the user. @cindex gettimeofday, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int gettimeofday(struct timeval *tv, void *tz); -@exdent Request: +@exdent Request: Fgettimeofday,tvptr,tzptr @exdent Return value: @@ -21238,10 +21265,10 @@ On success, 0 is returned, -1 otherwise. @end smallexample @table @code -@item EINVAL +@item EINVAL tz is a non-NULL pointer. -@item EFAULT +@item EFAULT tvptr and/or tzptr is an invalid pointer value. @end table @@ -21250,10 +21277,10 @@ tvptr and/or tzptr is an invalid pointer value. @cindex isatty, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int isatty(int fd); -@exdent Request: +@exdent Request: Fisatty,fd @exdent Return value: @@ -21263,7 +21290,7 @@ Returns 1 if fd refers to the @value{GDBN} console, 0 otherwise. @end smallexample @table @code -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21272,10 +21299,10 @@ The call was interrupted by the user. @cindex system, file-i/o system call @smallexample -@exdent Synopsis: +@exdent Synopsis: int system(const char *command); -@exdent Request: +@exdent Request: Fsystem,commandptr/len @exdent Return value: @@ -21289,7 +21316,7 @@ In case /bin/sh could not be executed, 127 is returned. @end smallexample @table @code -@item EINTR +@item EINTR The call was interrupted by the user. @end table @@ -21317,8 +21344,8 @@ int@r{,} unsigned int@r{,} long@r{,} unsigned long@r{,} mode_t @r{and} time_t @code{Int}, @code{unsigned int}, @code{mode_t} and @code{time_t} are implemented as 32 bit values in this protocol. -@code{Long} and @code{unsigned long} are implemented as 64 bit types. - +@code{Long} and @code{unsigned long} are implemented as 64 bit types. + @xref{Limits}, for corresponding MIN and MAX values (similar to those in @file{limits.h}) to allow range checking on host and target. @@ -21426,7 +21453,7 @@ The buffer of type struct timeval used by the target and @value{GDBN} is defined as follows: @smallexample -struct timeval @{ +struct timeval @{ time_t tv_sec; /* second */ long tv_usec; /* microsecond */ @}; -- cgit v1.1