URL
https://opencores.org/ocsvn/or1k_old/or1k_old/trunk
Subversion Repositories or1k_old
[/] [or1k_old/] [trunk/] [insight/] [gdb/] [doc/] [gdb.info-12] - Rev 1782
Compare with Previous | Blame | View Log
This is ./gdb.info, produced by makeinfo version 4.0 from gdb.texinfo.INFO-DIR-SECTION Programming & development tools.START-INFO-DIR-ENTRY* Gdb: (gdb). The GNU debugger.END-INFO-DIR-ENTRYThis file documents the GNU debugger GDB.This is the Ninth Edition, April 2001, of `Debugging with GDB: theGNU Source-Level Debugger' for GDB Version 20010707.Copyright (C)1988,1989,1990,1991,1992,1993,1994,1995,1996,1998,1999,2000,2001Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1 orany later version published by the Free Software Foundation; with theInvariant Sections being "A Sample GDB Session" and "Free Software",with the Front-Cover texts being "A GNU Manual," and with theBack-Cover Texts as in (a) below.(a) The FSF's Back-Cover Text is: "You have freedom to copy andmodify this GNU Manual, like GNU software. Copies published by the FreeSoftware Foundation raise funds for GNU development."File: gdb.info, Node: GDB/MI Stack Manipulation, Next: GDB/MI Symbol Query, Prev: GDB/MI Miscellaneous Commands, Up: GDB/MIGDB/MI Stack Manipulation Commands==================================The `-stack-info-frame' Command-------------------------------Synopsis........-stack-info-frameGet info on the current frame.GDB Command...........The corresponding GDB command is `info frame' or `frame' (withoutarguments).Example.......N.A.The `-stack-info-depth' Command-------------------------------Synopsis........-stack-info-depth [ MAX-DEPTH ]Return the depth of the stack. If the integer argument MAX-DEPTH isspecified, do not count beyond MAX-DEPTH frames.GDB Command...........There's no equivalent GDB command.Example.......For a stack with frame levels 0 through 11:(gdb)-stack-info-depth^done,depth="12"(gdb)-stack-info-depth 4^done,depth="4"(gdb)-stack-info-depth 12^done,depth="12"(gdb)-stack-info-depth 11^done,depth="11"(gdb)-stack-info-depth 13^done,depth="12"(gdb)The `-stack-list-arguments' Command-----------------------------------Synopsis........-stack-list-arguments SHOW-VALUES[ LOW-FRAME HIGH-FRAME ]Display a list of the arguments for the frames between LOW-FRAME andHIGH-FRAME (inclusive). If LOW-FRAME and HIGH-FRAME are not provided,list the arguments for the whole call stack.The SHOW-VALUES argument must have a value of 0 or 1. A value of 0means that only the names of the arguments are listed, a value of 1means that both names and values of the arguments are printed.GDB Command...........GDB does not have an equivalent command. `gdbtk' has a`gdb_get_args' command which partially overlaps with the functionalityof `-stack-list-arguments'.Example.......(gdb)-stack-list-frames^done,stack=[frame={level="0 ",addr="0x00010734",func="callee4",file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"},frame={level="1 ",addr="0x0001076c",func="callee3",file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"},frame={level="2 ",addr="0x0001078c",func="callee2",file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"},frame={level="3 ",addr="0x000107b4",func="callee1",file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"},frame={level="4 ",addr="0x000107e0",func="main",file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"}](gdb)-stack-list-arguments 0^done,stack-args=[frame={level="0",args=[]},frame={level="1",args=[name="strarg"]},frame={level="2",args=[name="intarg",name="strarg"]},frame={level="3",args=[name="intarg",name="strarg",name="fltarg"]},frame={level="4",args=[]}](gdb)-stack-list-arguments 1^done,stack-args=[frame={level="0",args=[]},frame={level="1",args=[{name="strarg",value="0x11940 \"A string argument.\""}]},frame={level="2",args=[{name="intarg",value="2"},{name="strarg",value="0x11940 \"A string argument.\""}]},{frame={level="3",args=[{name="intarg",value="2"},{name="strarg",value="0x11940 \"A string argument.\""},{name="fltarg",value="3.5"}]},frame={level="4",args=[]}](gdb)-stack-list-arguments 0 2 2^done,stack-args=[frame={level="2",args=[name="intarg",name="strarg"]}](gdb)-stack-list-arguments 1 2 2^done,stack-args=[frame={level="2",args=[{name="intarg",value="2"},{name="strarg",value="0x11940 \"A string argument.\""}]}](gdb)The `-stack-list-frames' Command--------------------------------Synopsis........-stack-list-frames [ LOW-FRAME HIGH-FRAME ]List the frames currently on the stack. For each frame it displaysthe following info:`LEVEL'The frame number, 0 being the topmost frame, i.e. the innermostfunction.`ADDR'The `$pc' value for that frame.`FUNC'Function name.`FILE'File name of the source file where the function lives.`LINE'Line number corresponding to the `$pc'.If invoked without arguments, this command prints a backtrace for thewhole stack. If given two integer arguments, it shows the frames whoselevels are between the two arguments (inclusive). If the two argumentsare equal, it shows the single frame at the corresponding level.GDB Command...........The corresponding GDB commands are `backtrace' and `where'.Example.......Full stack backtrace:(gdb)-stack-list-frames^done,stack=[frame={level="0 ",addr="0x0001076c",func="foo",file="recursive2.c",line="11"},frame={level="1 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="2 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="3 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="4 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="5 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="6 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="7 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="8 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="9 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="10",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="11",addr="0x00010738",func="main",file="recursive2.c",line="4"}](gdb)Show frames between LOW_FRAME and HIGH_FRAME:(gdb)-stack-list-frames 3 5^done,stack=[frame={level="3 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="4 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"},frame={level="5 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"}](gdb)Show a single frame:(gdb)-stack-list-frames 3 3^done,stack=[frame={level="3 ",addr="0x000107a4",func="foo",file="recursive2.c",line="14"}](gdb)The `-stack-list-locals' Command--------------------------------Synopsis........-stack-list-locals PRINT-VALUESDisplay the local variable names for the current frame. With anargument of 0 prints only the names of the variables, with argument of 1prints also their values.GDB Command...........`info locals' in GDB, `gdb_get_locals' in `gdbtk'.Example.......(gdb)-stack-list-locals 0^done,locals=[name="A",name="B",name="C"](gdb)-stack-list-locals 1^done,locals=[{name="A",value="1"},{name="B",value="2"},{name="C",value="3"}](gdb)The `-stack-select-frame' Command---------------------------------Synopsis........-stack-select-frame FRAMENUMChange the current frame. Select a different frame FRAMENUM on thestack.GDB Command...........The corresponding GDB commands are `frame', `up', `down',`select-frame', `up-silent', and `down-silent'.Example.......(gdb)-stack-select-frame 2^done(gdb)File: gdb.info, Node: GDB/MI Symbol Query, Next: GDB/MI Target Manipulation, Prev: GDB/MI Stack Manipulation, Up: GDB/MIGDB/MI Symbol Query Commands============================The `-symbol-info-address' Command----------------------------------Synopsis........-symbol-info-address SYMBOLDescribe where SYMBOL is stored.GDB Command...........The corresponding GDB command is `info address'.Example.......N.A.The `-symbol-info-file' Command-------------------------------Synopsis........-symbol-info-fileShow the file for the symbol.GDB Command...........There's no equivalent GDB command. `gdbtk' has `gdb_find_file'.Example.......N.A.The `-symbol-info-function' Command-----------------------------------Synopsis........-symbol-info-functionShow which function the symbol lives in.GDB Command...........`gdb_get_function' in `gdbtk'.Example.......N.A.The `-symbol-info-line' Command-------------------------------Synopsis........-symbol-info-lineShow the core addresses of the code for a source line.GDB Command...........The corresponding GDB comamnd is `info line'. `gdbtk' has the`gdb_get_line' and `gdb_get_file' commands.Example.......N.A.The `-symbol-info-symbol' Command---------------------------------Synopsis........-symbol-info-symbol ADDRDescribe what symbol is at location ADDR.GDB Command...........The corresponding GDB command is `info symbol'.Example.......N.A.The `-symbol-list-functions' Command------------------------------------Synopsis........-symbol-list-functionsList the functions in the executable.GDB Command...........`info functions' in GDB, `gdb_listfunc' and `gdb_search' in `gdbtk'.Example.......N.A.The `-symbol-list-types' Command--------------------------------Synopsis........-symbol-list-typesList all the type names.GDB Command...........The corresponding commands are `info types' in GDB, `gdb_search' in`gdbtk'.Example.......N.A.The `-symbol-list-variables' Command------------------------------------Synopsis........-symbol-list-variablesList all the global and static variable names.GDB Command...........`info variables' in GDB, `gdb_search' in `gdbtk'.Example.......N.A.The `-symbol-locate' Command----------------------------Synopsis........-symbol-locateGDB Command...........`gdb_loc' in `gdbtk'.Example.......N.A.The `-symbol-type' Command--------------------------Synopsis........-symbol-type VARIABLEShow type of VARIABLE.GDB Command...........The corresponding GDB command is `ptype', `gdbtk' has`gdb_obj_variable'.Example.......N.A.File: gdb.info, Node: GDB/MI Target Manipulation, Next: GDB/MI Thread Commands, Prev: GDB/MI Symbol Query, Up: GDB/MIGDB/MI Target Manipulation Commands===================================The `-target-attach' Command----------------------------Synopsis........-target-attach PID | FILEAttach to a process PID or a file FILE outside of GDB.GDB command...........The corresponding GDB command is `attach'.Example.......N.A.The `-target-compare-sections' Command--------------------------------------Synopsis........-target-compare-sections [ SECTION ]Compare data of section SECTION on target to the exec file. Withoutthe argument, all sections are compared.GDB Command...........The GDB equivalent is `compare-sections'.Example.......N.A.The `-target-detach' Command----------------------------Synopsis........-target-detachDisconnect from the remote target. There's no output.GDB command...........The corresponding GDB command is `detach'.Example.......(gdb)-target-detach^done(gdb)The `-target-download' Command------------------------------Synopsis........-target-downloadLoads the executable onto the remote target. It prints out anupdate message every half second, which includes the fields:`section'The name of the section.`section-sent'The size of what has been sent so far for that section.`section-size'The size of the section.`total-sent'The total size of what was sent so far (the current and theprevious sections).`total-size'The size of the overall executable to download.Each message is sent as status record (*note GDB/MI Output Syntax:GDB/MI Output Syntax.).In addition, it prints the name and size of the sections, as they aredownloaded. These messages include the following fields:`section'The name of the section.`section-size'The size of the section.`total-size'The size of the overall executable to download.At the end, a summary is printed.GDB Command...........The corresponding GDB command is `load'.Example.......Note: each status message appears on a single line. Here themessages have been broken down so that they can fit onto a page.(gdb)-target-download+download,{section=".text",section-size="6668",total-size="9880"}+download,{section=".text",section-sent="512",section-size="6668",total-sent="512",total-size="9880"}+download,{section=".text",section-sent="1024",section-size="6668",total-sent="1024",total-size="9880"}+download,{section=".text",section-sent="1536",section-size="6668",total-sent="1536",total-size="9880"}+download,{section=".text",section-sent="2048",section-size="6668",total-sent="2048",total-size="9880"}+download,{section=".text",section-sent="2560",section-size="6668",total-sent="2560",total-size="9880"}+download,{section=".text",section-sent="3072",section-size="6668",total-sent="3072",total-size="9880"}+download,{section=".text",section-sent="3584",section-size="6668",total-sent="3584",total-size="9880"}+download,{section=".text",section-sent="4096",section-size="6668",total-sent="4096",total-size="9880"}+download,{section=".text",section-sent="4608",section-size="6668",total-sent="4608",total-size="9880"}+download,{section=".text",section-sent="5120",section-size="6668",total-sent="5120",total-size="9880"}+download,{section=".text",section-sent="5632",section-size="6668",total-sent="5632",total-size="9880"}+download,{section=".text",section-sent="6144",section-size="6668",total-sent="6144",total-size="9880"}+download,{section=".text",section-sent="6656",section-size="6668",total-sent="6656",total-size="9880"}+download,{section=".init",section-size="28",total-size="9880"}+download,{section=".fini",section-size="28",total-size="9880"}+download,{section=".data",section-size="3156",total-size="9880"}+download,{section=".data",section-sent="512",section-size="3156",total-sent="7236",total-size="9880"}+download,{section=".data",section-sent="1024",section-size="3156",total-sent="7748",total-size="9880"}+download,{section=".data",section-sent="1536",section-size="3156",total-sent="8260",total-size="9880"}+download,{section=".data",section-sent="2048",section-size="3156",total-sent="8772",total-size="9880"}+download,{section=".data",section-sent="2560",section-size="3156",total-sent="9284",total-size="9880"}+download,{section=".data",section-sent="3072",section-size="3156",total-sent="9796",total-size="9880"}^done,address="0x10004",load-size="9880",transfer-rate="6586",write-rate="429"(gdb)The `-target-exec-status' Command---------------------------------Synopsis........-target-exec-statusProvide information on the state of the target (whether it isrunning or not, for instance).GDB Command...........There's no equivalent GDB command.Example.......N.A.The `-target-list-available-targets' Command--------------------------------------------Synopsis........-target-list-available-targetsList the possible targets to connect to.GDB Command...........The corresponding GDB command is `help target'.Example.......N.A.The `-target-list-current-targets' Command------------------------------------------Synopsis........-target-list-current-targetsDescribe the current target.GDB Command...........The corresponding information is printed by `info file' (among otherthings).Example.......N.A.The `-target-list-parameters' Command-------------------------------------Synopsis........-target-list-parametersGDB Command...........No equivalent.Example.......N.A.The `-target-select' Command----------------------------Synopsis........-target-select TYPE PARAMETERS ...Connect GDB to the remote target. This command takes two args:`TYPE'The type of target, for instance `async', `remote', etc.`PARAMETERS'Device names, host names and the like. *Note Commands formanaging targets: Target Commands, for more details.The output is a connection notification, followed by the address atwhich the target program is, in the following form:^connected,addr="ADDRESS",func="FUNCTION NAME",args=[ARG LIST]GDB Command...........The corresponding GDB command is `target'.Example.......(gdb)-target-select async /dev/ttya^connected,addr="0xfe00a300",func="??",args=[](gdb)File: gdb.info, Node: GDB/MI Thread Commands, Next: GDB/MI Tracepoint Commands, Prev: GDB/MI Target Manipulation, Up: GDB/MIGDB/MI Thread Commands======================The `-thread-info' Command--------------------------Synopsis........-thread-infoGDB command...........No equivalent.Example.......N.A.The `-thread-list-all-threads' Command--------------------------------------Synopsis........-thread-list-all-threadsGDB Command...........The equivalent GDB command is `info threads'.Example.......N.A.The `-thread-list-ids' Command------------------------------Synopsis........-thread-list-idsProduces a list of the currently known GDB thread ids. At the endof the list it also prints the total number of such threads.GDB Command...........Part of `info threads' supplies the same information.Example.......No threads present, besides the main process:(gdb)-thread-list-ids^done,thread-ids={},number-of-threads="0"(gdb)Several threads:(gdb)-thread-list-ids^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},number-of-threads="3"(gdb)The `-thread-select' Command----------------------------Synopsis........-thread-select THREADNUMMake THREADNUM the current thread. It prints the number of the newcurrent thread, and the topmost frame for that thread.GDB Command...........The corresponding GDB command is `thread'.Example.......(gdb)-exec-next^running(gdb)*stopped,reason="end-stepping-range",thread-id="2",line="187",file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"(gdb)-thread-list-ids^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},number-of-threads="3"(gdb)-thread-select 3^done,new-thread-id="3",frame={level="0 ",func="vprintf",args=[{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""},{name="arg",value="0x2"}],file="vprintf.c",line="31"}(gdb)File: gdb.info, Node: GDB/MI Tracepoint Commands, Next: GDB/MI Variable Objects, Prev: GDB/MI Thread Commands, Up: GDB/MIGDB/MI Tracepoint Commands==========================The tracepoint commands are not yet implemented.File: gdb.info, Node: GDB/MI Variable Objects, Prev: GDB/MI Tracepoint Commands, Up: GDB/MIGDB/MI Variable Objects=======================Motivation for Variable Objects in GDB/MI-----------------------------------------For the implementation of a variable debugger window (locals, watchedexpressions, etc.), we are proposing the adaptation of the existing codeused by `Insight'.The two main reasons for that are:1. It has been proven in practice (it is already on its secondgeneration).2. It will shorten development time (needless to say how important itis now).The original interface was designed to be used by Tcl code, so it wasslightly changed so it could be used through GDB/MI. This sectiondescribes the GDB/MI operations that will be available and gives somehints about their use._Note_: In addition to the set of operations described here, weexpect the GUI implementation of a variable window to require, atleast, the following operations:* `-gdb-show' `output-radix'* `-stack-list-arguments'* `-stack-list-locals'* `-stack-select-frame'Introduction to Variable Objects in GDB/MI------------------------------------------The basic idea behind variable objects is the creation of a namedobject to represent a variable, an expression, a memory location oreven a CPU register. For each object created, a set of operations isavailable for examining or changing its properties.Furthermore, complex data types, such as C structures, arerepresented in a tree format. For instance, the `struct' type variableis the root and the children will represent the struct members. If achild is itself of a complex type, it will also have children of itsown. Appropriate language differences are handled for C, C++ and Java.When returning the actual values of the objects, this facility allowsfor the individual selection of the display format used in the resultcreation. It can be chosen among: binary, decimal, hexadecimal, octaland natural. Natural refers to a default format automatically chosenbased on the variable type (like decimal for an `int', hex forpointers, etc.).The following is the complete set of GDB/MI operations defined toaccess this functionality:*Operation* *Description*`-var-create' create a variable object`-var-delete' delete the variable object and its children`-var-set-format' set the display format of this variable`-var-show-format' show the display format of this variable`-var-info-num-children' tells how many children this object has`-var-list-children' return a list of the object's children`-var-info-type' show the type of this variable object`-var-info-expression' print what this variable object represents`-var-show-attributes' is this variable editable? does it existhere?`-var-evaluate-expression' get the value of this variable`-var-assign' set the value of this variable`-var-update' update the variable and its childrenIn the next subsection we describe each operation in detail andsuggest how it can be used.Description And Use of Operations on Variable Objects-----------------------------------------------------The `-var-create' Command-------------------------Synopsis........-var-create {NAME | "-"}{FRAME-ADDR | "*"} EXPRESSIONThis operation creates a variable object, which allows themonitoring of a variable, the result of an expression, a memory cell ora CPU register.The NAME parameter is the string by which the object can bereferenced. It must be unique. If `-' is specified, the varobj systemwill generate a string "varNNNNNN" automatically. It will be uniqueprovided that one does not specify NAME on that format. The commandfails if a duplicate name is found.The frame under which the expression should be evaluated can bespecified by FRAME-ADDR. A `*' indicates that the current frame shouldbe used.EXPRESSION is any expression valid on the current language set (mustnot begin with a `*'), or one of the following:* `*ADDR', where ADDR is the address of a memory cell* `*ADDR-ADDR' -- a memory address range (TBD)* `$REGNAME' -- a CPU register nameResult......This operation returns the name, number of children and the type ofthe object created. Type is returned as a string as the ones generatedby the GDB CLI:name="NAME",numchild="N",type="TYPE"The `-var-delete' Command-------------------------Synopsis........-var-delete NAMEDeletes a previously created variable object and all of its children.Returns an error if the object NAME is not found.The `-var-set-format' Command-----------------------------Synopsis........-var-set-format NAME FORMAT-SPECSets the output format for the value of the object NAME to beFORMAT-SPEC.The syntax for the FORMAT-SPEC is as follows:FORMAT-SPEC ==>{binary | decimal | hexadecimal | octal | natural}The `-var-show-format' Command------------------------------Synopsis........-var-show-format NAMEReturns the format used to display the value of the object NAME.FORMAT ==>FORMAT-SPECThe `-var-info-num-children' Command------------------------------------Synopsis........-var-info-num-children NAMEReturns the number of children of a variable object NAME:numchild=NThe `-var-list-children' Command--------------------------------Synopsis........-var-list-children NAMEReturns a list of the children of the specified variable object:numchild=N,children={{name=NAME,numchild=N,type=TYPE},(repeats N times)}The `-var-info-type' Command----------------------------Synopsis........-var-info-type NAMEReturns the type of the specified variable NAME. The type isreturned as a string in the same format as it is output by the GDB CLI:type=TYPENAMEThe `-var-info-expression' Command----------------------------------Synopsis........-var-info-expression NAMEReturns what is represented by the variable object NAME:lang=LANG-SPEC,exp=EXPRESSIONwhere LANG-SPEC is `{"C" | "C++" | "Java"}'.The `-var-show-attributes' Command----------------------------------Synopsis........-var-show-attributes NAMEList attributes of the specified variable object NAME:status=ATTR [ ( ,ATTR )* ]where ATTR is `{ { editable | noneditable } | TBD }'.The `-var-evaluate-expression' Command--------------------------------------Synopsis........-var-evaluate-expression NAMEEvaluates the expression that is represented by the specifiedvariable object and returns its value as a string in the current formatspecified for the object:value=VALUEThe `-var-assign' Command-------------------------Synopsis........-var-assign NAME EXPRESSIONAssigns the value of EXPRESSION to the variable object specified byNAME. The object must be `editable'.The `-var-update' Command-------------------------Synopsis........-var-update {NAME | "*"}Update the value of the variable object NAME by evaluating itsexpression after fetching all the new values from memory or registers.A `*' causes all existing variable objects to be updated.File: gdb.info, Node: GDB Bugs, Next: Formatting Documentation, Prev: GDB/MI, Up: TopReporting Bugs in GDB*********************Your bug reports play an essential role in making GDB reliable.Reporting a bug may help you by bringing a solution to your problem,or it may not. But in any case the principal function of a bug reportis to help the entire community by making the next version of GDB workbetter. Bug reports are your contribution to the maintenance of GDB.In order for a bug report to serve its purpose, you must include theinformation that enables us to fix the bug.* Menu:* Bug Criteria:: Have you found a bug?* Bug Reporting:: How to report bugsFile: gdb.info, Node: Bug Criteria, Next: Bug Reporting, Up: GDB BugsHave you found a bug?=====================If you are not sure whether you have found a bug, here are someguidelines:* If the debugger gets a fatal signal, for any input whatever, thatis a GDB bug. Reliable debuggers never crash.* If GDB produces an error message for valid input, that is a bug.(Note that if you're cross debugging, the problem may also besomewhere in the connection to the target.)* If GDB does not produce an error message for invalid input, thatis a bug. However, you should note that your idea of "invalidinput" might be our idea of "an extension" or "support fortraditional practice".* If you are an experienced user of debugging tools, your suggestionsfor improvement of GDB are welcome in any case.File: gdb.info, Node: Bug Reporting, Prev: Bug Criteria, Up: GDB BugsHow to report bugs==================A number of companies and individuals offer support for GNU products.If you obtained GDB from a support organization, we recommend youcontact that organization first.You can find contact information for many support companies andindividuals in the file `etc/SERVICE' in the GNU Emacs distribution.In any event, we also recommend that you send bug reports for GDB tothis addresses:bug-gdb@gnu.org*Do not send bug reports to `info-gdb', or to `help-gdb', or to anynewsgroups.* Most users of GDB do not want to receive bug reports.Those that do have arranged to receive `bug-gdb'.The mailing list `bug-gdb' has a newsgroup `gnu.gdb.bug' whichserves as a repeater. The mailing list and the newsgroup carry exactlythe same messages. Often people think of posting bug reports to thenewsgroup instead of mailing them. This appears to work, but it has oneproblem which can be crucial: a newsgroup posting often lacks a mailpath back to the sender. Thus, if we need to ask for more information,we may be unable to reach you. For this reason, it is better to sendbug reports to the mailing list.As a last resort, send bug reports on paper to:GNU Debugger BugsFree Software Foundation Inc.59 Temple Place - Suite 330Boston, MA 02111-1307USAThe fundamental principle of reporting bugs usefully is this:*report all the facts*. If you are not sure whether to state a fact orleave it out, state it!Often people omit facts because they think they know what causes theproblem and assume that some details do not matter. Thus, you mightassume that the name of the variable you use in an example does notmatter. Well, probably it does not, but one cannot be sure. Perhapsthe bug is a stray memory reference which happens to fetch from thelocation where that name is stored in memory; perhaps, if the name weredifferent, the contents of that location would fool the debugger intodoing the right thing despite the bug. Play it safe and give aspecific, complete example. That is the easiest thing for you to do,and the most helpful.Keep in mind that the purpose of a bug report is to enable us to fixthe bug. It may be that the bug has been reported previously, butneither you nor we can know that unless your bug report is complete andself-contained.Sometimes people give a few sketchy facts and ask, "Does this ring abell?" Those bug reports are useless, and we urge everyone to _refuseto respond to them_ except to chide the sender to report bugs properly.To enable us to fix the bug, you should include all these things:* The version of GDB. GDB announces it if you start with noarguments; you can also print it at any time using `show version'.Without this, we will not know whether there is any point inlooking for the bug in the current version of GDB.* The type of machine you are using, and the operating system nameand version number.* What compiler (and its version) was used to compile GDB--e.g."gcc-2.8.1".* What compiler (and its version) was used to compile the programyou are debugging--e.g. "gcc-2.8.1", or "HP92453-01 A.10.32.03 HPC Compiler". For GCC, you can say `gcc --version' to get thisinformation; for other compilers, see the documentation for thosecompilers.* The command arguments you gave the compiler to compile yourexample and observe the bug. For example, did you use `-O'? Toguarantee you will not omit something important, list them all. Acopy of the Makefile (or the output from make) is sufficient.If we were to try to guess the arguments, we would probably guesswrong and then we might not encounter the bug.* A complete input script, and all necessary source files, that willreproduce the bug.* A description of what behavior you observe that you believe isincorrect. For example, "It gets a fatal signal."Of course, if the bug is that GDB gets a fatal signal, then wewill certainly notice it. But if the bug is incorrect output, wemight not notice unless it is glaringly wrong. You might as wellnot give us a chance to make a mistake.Even if the problem you experience is a fatal signal, you shouldstill say so explicitly. Suppose something strange is going on,such as, your copy of GDB is out of synch, or you have encountereda bug in the C library on your system. (This has happened!) Yourcopy might crash and ours would not. If you told us to expect acrash, then when ours fails to crash, we would know that the bugwas not happening for us. If you had not told us to expect acrash, then we would not be able to draw any conclusion from ourobservations.* If you wish to suggest changes to the GDB source, send us contextdiffs. If you even discuss something in the GDB source, refer toit by context, not by line number.The line numbers in our development sources will not match thosein your sources. Your line numbers would convey no usefulinformation to us.Here are some things that are not necessary:* A description of the envelope of the bug.Often people who encounter a bug spend a lot of time investigatingwhich changes to the input file will make the bug go away and whichchanges will not affect it.This is often time consuming and not very useful, because the waywe will find the bug is by running a single example under thedebugger with breakpoints, not by pure deduction from a series ofexamples. We recommend that you save your time for something else.Of course, if you can find a simpler example to report _instead_of the original one, that is a convenience for us. Errors in theoutput will be easier to spot, running under the debugger will takeless time, and so on.However, simplification is not vital; if you do not want to dothis, report the bug anyway and send us the entire test case youused.* A patch for the bug.A patch for the bug does help us if it is a good one. But do notomit the necessary information, such as the test case, on theassumption that a patch is all we need. We might see problemswith your patch and decide to fix the problem another way, or wemight not understand it at all.Sometimes with a program as complicated as GDB it is very hard toconstruct an example that will make the program follow a certainpath through the code. If you do not send us the example, we willnot be able to construct one, so we will not be able to verifythat the bug is fixed.And if we cannot understand what bug you are trying to fix, or whyyour patch should be an improvement, we will not install it. Atest case will help us to understand.* A guess about what the bug is or what it depends on.Such guesses are usually wrong. Even we cannot guess right aboutsuch things without first using the debugger to find the facts.File: gdb.info, Node: Command Line Editing, Next: Using History Interactively, Prev: Formatting Documentation, Up: TopCommand Line Editing********************This chapter describes the basic features of the GNU command lineediting interface.* Menu:* Introduction and Notation:: Notation used in this text.* Readline Interaction:: The minimum set of commands for editing a line.* Readline Init File:: Customizing Readline from a user's view.* Bindable Readline Commands:: A description of most of the Readline commandsavailable for binding* Readline vi Mode:: A short description of how to make Readlinebehave like the vi editor.File: gdb.info, Node: Introduction and Notation, Next: Readline Interaction, Up: Command Line EditingIntroduction to Line Editing============================The following paragraphs describe the notation used to representkeystrokes.The text <C-k> is read as `Control-K' and describes the characterproduced when the <k> key is pressed while the Control key is depressed.The text <M-k> is read as `Meta-K' and describes the characterproduced when the Meta key (if you have one) is depressed, and the <k>key is pressed. The Meta key is labeled <ALT> on many keyboards. Onkeyboards with two keys labeled <ALT> (usually to either side of thespace bar), the <ALT> on the left side is generally set to work as aMeta key. The <ALT> key on the right may also be configured to work asa Meta key or may be configured as some other modifier, such as aCompose key for typing accented characters.If you do not have a Meta or <ALT> key, or another key working as aMeta key, the identical keystroke can be generated by typing <ESC>first, and then typing <k>. Either process is known as "metafying" the<k> key.The text <M-C-k> is read as `Meta-Control-k' and describes thecharacter produced by "metafying" <C-k>.In addition, several keys have their own names. Specifically,<DEL>, <ESC>, <LFD>, <SPC>, <RET>, and <TAB> all stand for themselveswhen seen in this text, or in an init file (*note Readline Init File::).If your keyboard lacks a <LFD> key, typing <C-j> will produce thedesired character. The <RET> key may be labeled <Return> or <Enter> onsome keyboards.File: gdb.info, Node: Readline Interaction, Next: Readline Init File, Prev: Introduction and Notation, Up: Command Line EditingReadline Interaction====================Often during an interactive session you type in a long line of text,only to notice that the first word on the line is misspelled. TheReadline library gives you a set of commands for manipulating the textas you type it in, allowing you to just fix your typo, and not forcingyou to retype the majority of the line. Using these editing commands,you move the cursor to the place that needs correction, and delete orinsert the text of the corrections. Then, when you are satisfied withthe line, you simply press <RETURN>. You do not have to be at the endof the line to press <RETURN>; the entire line is accepted regardlessof the location of the cursor within the line.* Menu:* Readline Bare Essentials:: The least you need to know about Readline.* Readline Movement Commands:: Moving about the input line.* Readline Killing Commands:: How to delete text, and how to get it back!* Readline Arguments:: Giving numeric arguments to commands.* Searching:: Searching through previous lines.File: gdb.info, Node: Readline Bare Essentials, Next: Readline Movement Commands, Up: Readline InteractionReadline Bare Essentials------------------------In order to enter characters into the line, simply type them. Thetyped character appears where the cursor was, and then the cursor movesone space to the right. If you mistype a character, you can use yourerase character to back up and delete the mistyped character.Sometimes you may mistype a character, and not notice the erroruntil you have typed several other characters. In that case, you cantype <C-b> to move the cursor to the left, and then correct yourmistake. Afterwards, you can move the cursor to the right with <C-f>.When you add text in the middle of a line, you will notice thatcharacters to the right of the cursor are `pushed over' to make roomfor the text that you have inserted. Likewise, when you delete textbehind the cursor, characters to the right of the cursor are `pulledback' to fill in the blank space created by the removal of the text. Alist of the bare essentials for editing the text of an input linefollows.<C-b>Move back one character.<C-f>Move forward one character.<DEL> or <Backspace>Delete the character to the left of the cursor.<C-d>Delete the character underneath the cursor.Printing charactersInsert the character into the line at the cursor.<C-_> or <C-x C-u>Undo the last editing command. You can undo all the way back to anempty line.(Depending on your configuration, the <Backspace> key be set to deletethe character to the left of the cursor and the <DEL> key set to deletethe character underneath the cursor, like <C-d>, rather than thecharacter to the left of the cursor.)File: gdb.info, Node: Readline Movement Commands, Next: Readline Killing Commands, Prev: Readline Bare Essentials, Up: Readline InteractionReadline Movement Commands--------------------------The above table describes the most basic keystrokes that you need inorder to do editing of the input line. For your convenience, manyother commands have been added in addition to <C-b>, <C-f>, <C-d>, and<DEL>. Here are some commands for moving more rapidly about the line.<C-a>Move to the start of the line.<C-e>Move to the end of the line.<M-f>Move forward a word, where a word is composed of letters anddigits.<M-b>Move backward a word.<C-l>Clear the screen, reprinting the current line at the top.Notice how <C-f> moves forward a character, while <M-f> movesforward a word. It is a loose convention that control keystrokesoperate on characters while meta keystrokes operate on words.File: gdb.info, Node: Readline Killing Commands, Next: Readline Arguments, Prev: Readline Movement Commands, Up: Readline InteractionReadline Killing Commands-------------------------"Killing" text means to delete the text from the line, but to saveit away for later use, usually by "yanking" (re-inserting) it back intothe line. (`Cut' and `paste' are more recent jargon for `kill' and`yank'.)If the description for a command says that it `kills' text, then youcan be sure that you can get the text back in a different (or the same)place later.When you use a kill command, the text is saved in a "kill-ring".Any number of consecutive kills save all of the killed text together, sothat when you yank it back, you get it all. The kill ring is not linespecific; the text that you killed on a previously typed line isavailable to be yanked back later, when you are typing another line.Here is the list of commands for killing text.<C-k>Kill the text from the current cursor position to the end of theline.<M-d>Kill from the cursor to the end of the current word, or, if betweenwords, to the end of the next word. Word boundaries are the sameas those used by <M-f>.<M-DEL>Kill from the cursor the start of the previous word, or, if betweenwords, to the start of the previous word. Word boundaries are thesame as those used by <M-b>.<C-w>Kill from the cursor to the previous whitespace. This isdifferent than <M-DEL> because the word boundaries differ.Here is how to "yank" the text back into the line. Yanking means tocopy the most-recently-killed text from the kill buffer.<C-y>Yank the most recently killed text back into the buffer at thecursor.<M-y>Rotate the kill-ring, and yank the new top. You can only do thisif the prior command is <C-y> or <M-y>.File: gdb.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline InteractionReadline Arguments------------------You can pass numeric arguments to Readline commands. Sometimes theargument acts as a repeat count, other times it is the sign of theargument that is significant. If you pass a negative argument to acommand which normally acts in a forward direction, that command willact in a backward direction. For example, to kill text back to thestart of the line, you might type `M-- C-k'.The general way to pass numeric arguments to a command is to typemeta digits before the command. If the first `digit' typed is a minussign (`-'), then the sign of the argument will be negative. Once youhave typed one meta digit to get the argument started, you can type theremainder of the digits, and then the command. For example, to givethe <C-d> command an argument of 10, you could type `M-1 0 C-d'.File: gdb.info, Node: Searching, Prev: Readline Arguments, Up: Readline InteractionSearching for Commands in the History-------------------------------------Readline provides commands for searching through the command historyfor lines containing a specified string. There are two search modes:INCREMENTAL and NON-INCREMENTAL.Incremental searches begin before the user has finished typing thesearch string. As each character of the search string is typed,Readline displays the next entry from the history matching the stringtyped so far. An incremental search requires only as many charactersas needed to find the desired history entry. To search backward in thehistory for a particular string, type <C-r>. Typing <C-s> searchesforward through the history. The characters present in the value ofthe `isearch-terminators' variable are used to terminate an incrementalsearch. If that variable has not been assigned a value, the <ESC> and<C-J> characters will terminate an incremental search. <C-g> willabort an incremental search and restore the original line. When thesearch is terminated, the history entry containing the search stringbecomes the current line.To find other matching entries in the history list, type <C-r> or<C-s> as appropriate. This will search backward or forward in thehistory for the next entry matching the search string typed so far.Any other key sequence bound to a Readline command will terminate thesearch and execute that command. For instance, a <RET> will terminatethe search and accept the line, thereby executing the command from thehistory list.Non-incremental searches read the entire search string beforestarting to search for matching history lines. The search string may betyped by the user or be part of the contents of the current line.File: gdb.info, Node: Readline Init File, Next: Bindable Readline Commands, Prev: Readline Interaction, Up: Command Line EditingReadline Init File==================Although the Readline library comes with a set of Emacs-likekeybindings installed by default, it is possible to use a different setof keybindings. Any user can customize programs that use Readline byputting commands in an "inputrc" file, conventionally in his homedirectory. The name of this file is taken from the value of theenvironment variable `INPUTRC'. If that variable is unset, the defaultis `~/.inputrc'.When a program which uses the Readline library starts up, the initfile is read, and the key bindings are set.In addition, the `C-x C-r' command re-reads this init file, thusincorporating any changes that you might have made to it.* Menu:* Readline Init File Syntax:: Syntax for the commands in the inputrc file.* Conditional Init Constructs:: Conditional key bindings in the inputrc file.* Sample Init File:: An example inputrc file.
