From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26749 invoked by alias); 2 Dec 2005 13:05:22 -0000 Received: (qmail 26715 invoked by uid 22791); 2 Dec 2005 13:05:11 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 Dec 2005 13:04:56 +0000 Received: from fra-out-02.spheriq.net (fra-out-02.spheriq.net [195.46.51.130]) by fra-del-04.spheriq.net with ESMTP id jB2D4q8S026059 for ; Fri, 2 Dec 2005 13:04:52 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-02.spheriq.net with ESMTP id jB2D4oGD008717 for ; Fri, 2 Dec 2005 13:04:51 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id jB2D4nP8005673 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 2 Dec 2005 13:04:50 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 87E22DA44; Fri, 2 Dec 2005 13:04:48 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 4C66B47392; Fri, 2 Dec 2005 13:07:54 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 03D5175994; Fri, 2 Dec 2005 13:07:53 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 681F647378; Fri, 2 Dec 2005 13:07:53 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CHA55297 (AUTH "andrew stubbs"); Fri, 2 Dec 2005 13:04:46 GMT Message-ID: <439045E4.6080209@st.com> Date: Fri, 02 Dec 2005 13:54:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Enhance break command help References: <438EEBC5.8040802@st.com> <438F2AC7.7070505@st.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------050609020401030608060101" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.2.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00047.txt.bz2 This is a multi-part message in MIME format. --------------050609020401030608060101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1016 Eli Zaretskii wrote: > Okay for the breakpoint.c patch, thanks. I have only one comment: > please remove all the "The" articles before argument names, like this: > > +LOCATION may be a line number, function name, or \"*\" and an address.\n\ > > instead of > > +The LOCATION may be a line number, function name, or \"*\" and an address.\n\ > > Also, can I ask you for a small favor? There are other *break and > similar commands defined in breakpoint.c, whose doc strings reference > those of other commands and eventually the one you fixed. I never > liked those references: the user shouldn't need to look up several > commands she doesn't care about to arrive at the required info. So > could you please modify all those other doc strings to simply repeat > the arguments' description you just fixed? How about the attached? I have broken out the common parts into a macro to prevent duplication and hopefully make future maintenance easier. I have tested gdb.base/help.exp and all is well. Andrew --------------050609020401030608060101 Content-Type: text/plain; name="break-help.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="break-help.patch" Content-length: 15750 2005-12-02 Andrew Stubbs * breakpoint.c (BREAK_ARGS_HELP): New mecro. (_initialize_breakpoint): Enhance break, tbreak, hbreak and thbreak commands' help by adding more information and using BREAK_ARGS_HELP to duplicate the common parts. Remove now-redundant cross-references. testsuite/ * gdb.base/help.exp (help b, help br, help bre, help brea) (help break): Update the expected message. Index: src/gdb/breakpoint.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/breakpoint.c 2005-12-02 12:24:19.000000000 +0000 +++ src/gdb/breakpoint.c 2005-12-02 12:47:08.000000000 +0000 @@ -7653,6 +7653,25 @@ decode_line_spec_1 (char *string, int fu return sals; } =0C +/* This help string is used for the break, hbreak, tbreak and thbreak comm= ands. + It is defined as a macro to prevent duplication. + COMMAND should be a string constant containing the name of the command.= */ +#define BREAK_ARGS_HELP(command) \ +command" [LOCATION] [thread THREADNUM] [if CONDITION]\n\ +LOCATION may be a line number, function name, or \"*\" and an address.\n\ +If a line number is specified, break at start of code for that line.\n\ +If a function is specified, break at start of code for that function.\n\ +If an address is specified, break at that exact address.\n\ +With no LOCATION, uses current execution address of selected stack frame.\= n\ +This is useful for breaking on return to a stack frame.\n\ +\n\ +THREADNUM is the number from \"info threads\".\n\ +CONDITION is a boolean expression.\n\ +\n\ +Multiple breakpoints at one place are permitted, and useful if conditional= .\n\ +\n\ +Do \"help breakpoints\" for info on other commands dealing with breakpoint= s." + void _initialize_breakpoint (void) { @@ -7688,22 +7707,28 @@ Usage is `condition N COND', where N is=20 expression to be evaluated whenever breakpoint N is reached.")); =20 c =3D add_com ("tbreak", class_breakpoint, tbreak_command, _("\ -Set a temporary breakpoint. Args like \"break\" command.\n\ +Set a temporary breakpoint.\n\ Like \"break\" except the breakpoint is only temporary,\n\ so it will be deleted when hit. Equivalent to \"break\" followed\n\ -by using \"enable delete\" on the breakpoint number.")); +by using \"enable delete\" on the breakpoint number.\n\ +\n" +BREAK_ARGS_HELP ("tbreak"))); set_cmd_completer (c, location_completer); =20 c =3D add_com ("hbreak", class_breakpoint, hbreak_command, _("\ -Set a hardware assisted breakpoint. Args like \"break\" command.\n\ +Set a hardware assisted breakpoint.\n\ Like \"break\" except the breakpoint requires hardware support,\n\ -some target hardware may not have this support.")); +some target hardware may not have this support.\n\ +\n" +BREAK_ARGS_HELP ("hbreak"))); set_cmd_completer (c, location_completer); =20 c =3D add_com ("thbreak", class_breakpoint, thbreak_command, _("\ -Set a temporary hardware assisted breakpoint. Args like \"break\" command.= \n\ +Set a temporary hardware assisted breakpoint.\n\ Like \"hbreak\" except the breakpoint is only temporary,\n\ -so it will be deleted when hit.")); +so it will be deleted when hit.\n\ +\n" +BREAK_ARGS_HELP ("thbreak"))); set_cmd_completer (c, location_completer); =20 add_prefix_cmd ("enable", class_breakpoint, enable_command, _("\ @@ -7808,17 +7833,8 @@ is executing in.\n\ See also the \"delete\" command which clears breakpoints by number.")); =20 c =3D add_com ("break", class_breakpoint, break_command, _("\ -Set breakpoint at specified line or function.\n\ -Argument may be line number, function name, or \"*\" and an address.\n\ -If line number is specified, break at start of code for that line.\n\ -If function is specified, break at start of code for that function.\n\ -If an address is specified, break at that exact address.\n\ -With no arg, uses current execution address of selected stack frame.\n\ -This is useful for breaking on return to a stack frame.\n\ -\n\ -Multiple breakpoints at one place are permitted, and useful if conditional= .\n\ -\n\ -Do \"help breakpoints\" for info on other commands dealing with breakpoint= s.")); +Set breakpoint at specified line or function.\n" +BREAK_ARGS_HELP ("break"))); set_cmd_completer (c, location_completer); =20 add_com_alias ("b", "break", class_run, 1); Index: src/gdb/testsuite/gdb.base/help.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/testsuite/gdb.base/help.exp 2005-12-02 12:24:18.000000000 = +0000 +++ src/gdb/testsuite/gdb.base/help.exp 2005-12-02 12:55:50.000000000 +0000 @@ -50,15 +50,15 @@ gdb_test "help append binary value" "App # test help attach gdb_test "help attach" "Attach to a process or file outside of GDB\.\[\r\n= \]+This command attaches to another target, of the same type as your last\[= \r\n\]+\"target\" command \\(\"info files\" will show your target stack\\)\= .\[\r\n\]+The command may take as argument a process id or a device file\.\= [\r\n\]+For a process id, you must have permission to send the process a si= gnal,\[\r\n\]+and it must have the same effective uid as the debugger\.\[\r= \n\]+When using \"attach\" with a process id, the debugger finds the\[\r\n\= ]+program running in the process, looking first in the current working\[\r\= n\]+directory, or \\(if not found there\\) using the source file search pat= h\[\r\n\]+\\(see the \"directory\" command\\)\. You can also use the \"fil= e\" command\[\r\n\]+to specify the program, and to load its symbol table\."= "help attach" # test help breakpoint "b" abbreviation -gdb_test "help b" "Set breakpoint at specified line or function\.\[\r\n\]+= Argument may be line number, function name, or \"\[*\]\" and an address\.\[= \r\n\]+If line number is specified, break at start of code for that line\.\= [\r\n\]+If function is specified, break at start of code for that function\= .\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]= +With no arg, uses current execution address of selected stack frame\.\[\r\= n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multip= le breakpoints at one place are permitted, and useful if conditional\.\[\r\= n\]+Do \"help breakpoints\" for info on other commands dealing with breakpo= ints\." "help breakpoint \"b\" abbreviation" +gdb_test "help b" "Set breakpoint at specified line or function\.\[\r\n\]+= break \\\[LOCATION\] \\\[thread THREADNUM\] \\\[if CONDITION\]\[\r\n\]+LOCA= TION may be a line number, function name, or \"\[*\]\" and an address\.\[\r= \n\]+If a line number is specified, break at start of code for that line\.\= [\r\n\]+If a function is specified, break at start of code for that functio= n\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n= \]+With no LOCATION, uses current execution address of selected stack frame= \.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]= +THREADNUM is the number from \"info threads\"\.\[\r\n\]+CONDITION is a boo= lean expression\.\[\r\n\]+Multiple breakpoints at one place are permitted, = and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on oth= er commands dealing with breakpoints\." "help breakpoint \"b\" abbreviation" # test help breakpoint "br" abbreviation -gdb_test "help br" "Set breakpoint at specified line or function\.\[\r\n\]= +Argument may be line number, function name, or \"\[*\]\" and an address\.\= [\r\n\]+If line number is specified, break at start of code for that line\.= \[\r\n\]+If function is specified, break at start of code for that function= \.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\= ]+With no arg, uses current execution address of selected stack frame\.\[\r= \n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multi= ple breakpoints at one place are permitted, and useful if conditional\.\[\r= \n\]+Do \"help breakpoints\" for info on other commands dealing with breakp= oints\." "help breakpoint \"br\" abbreviation" +gdb_test "help br" "Set breakpoint at specified line or function\.\[\r\n\]= +break \\\[LOCATION\] \\\[thread THREADNUM\] \\\[if CONDITION\]\[\r\n\]+LOC= ATION may be a line number, function name, or \"\[*\]\" and an address\.\[\= r\n\]+If a line number is specified, break at start of code for that line\.= \[\r\n\]+If a function is specified, break at start of code for that functi= on\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\= n\]+With no LOCATION, uses current execution address of selected stack fram= e\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\= ]+THREADNUM is the number from \"info threads\"\.\[\r\n\]+CONDITION is a bo= olean expression\.\[\r\n\]+Multiple breakpoints at one place are permitted,= and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on ot= her commands dealing with breakpoints\." "help breakpoint \"br\" abbreviati= on" # test help breakpoint "bre" abbreviation -gdb_test "help bre" "Set breakpoint at specified line or function\.\[\r\n\= ]+Argument may be line number, function name, or \"\[*\]\" and an address\.= \[\r\n\]+If line number is specified, break at start of code for that line\= .\[\r\n\]+If function is specified, break at start of code for that functio= n\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n= \]+With no arg, uses current execution address of selected stack frame\.\[\= r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Mult= iple breakpoints at one place are permitted, and useful if conditional\.\[\= r\n\]+Do \"help breakpoints\" for info on other commands dealing with break= points\." "help breakpoint \"bre\" abbreviation" +gdb_test "help bre" "Set breakpoint at specified line or function\.\[\r\n\= ]+break \\\[LOCATION\] \\\[thread THREADNUM\] \\\[if CONDITION\]\[\r\n\]+LO= CATION may be a line number, function name, or \"\[*\]\" and an address\.\[= \r\n\]+If a line number is specified, break at start of code for that line\= .\[\r\n\]+If a function is specified, break at start of code for that funct= ion\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r= \n\]+With no LOCATION, uses current execution address of selected stack fra= me\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n= \]+THREADNUM is the number from \"info threads\"\.\[\r\n\]+CONDITION is a b= oolean expression\.\[\r\n\]+Multiple breakpoints at one place are permitted= , and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on o= ther commands dealing with breakpoints\." "help breakpoint \"bre\" abbrevia= tion" # test help breakpoint "brea" abbreviation -gdb_test "help brea" "Set breakpoint at specified line or function\.\[\r\n= \]+Argument may be line number, function name, or \"\[*\]\" and an address\= .\[\r\n\]+If line number is specified, break at start of code for that line= \.\[\r\n\]+If function is specified, break at start of code for that functi= on\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\= n\]+With no arg, uses current execution address of selected stack frame\.\[= \r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Mul= tiple breakpoints at one place are permitted, and useful if conditional\.\[= \r\n\]+Do \"help breakpoints\" for info on other commands dealing with brea= kpoints\." "help breakpoint \"brea\" abbreviation" +gdb_test "help brea" "Set breakpoint at specified line or function\.\[\r\n= \]+break \\\[LOCATION\] \\\[thread THREADNUM\] \\\[if CONDITION\]\[\r\n\]+L= OCATION may be a line number, function name, or \"\[*\]\" and an address\.\= [\r\n\]+If a line number is specified, break at start of code for that line= \.\[\r\n\]+If a function is specified, break at start of code for that func= tion\.\[\r\n\]+If an address is specified, break at that exact address\.\[\= r\n\]+With no LOCATION, uses current execution address of selected stack fr= ame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\= n\]+THREADNUM is the number from \"info threads\"\.\[\r\n\]+CONDITION is a = boolean expression\.\[\r\n\]+Multiple breakpoints at one place are permitte= d, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on = other commands dealing with breakpoints\." "help breakpoint \"brea\" abbrev= iation" # test help breakpoint "break" abbreviation -gdb_test "help break" "Set breakpoint at specified line or function\.\[\r\= n\]+Argument may be line number, function name, or \"\[*\]\" and an address= \.\[\r\n\]+If line number is specified, break at start of code for that lin= e\.\[\r\n\]+If function is specified, break at start of code for that funct= ion\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r= \n\]+With no arg, uses current execution address of selected stack frame\.\= [\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Mu= ltiple breakpoints at one place are permitted, and useful if conditional\.\= [\r\n\]+Do \"help breakpoints\" for info on other commands dealing with bre= akpoints\." "help breakpoint \"break\" abbreviation" +gdb_test "help break" "Set breakpoint at specified line or function\.\[\r\= n\]+break \\\[LOCATION\] \\\[thread THREADNUM\] \\\[if CONDITION\]\[\r\n\]+= LOCATION may be a line number, function name, or \"\[*\]\" and an address\.= \[\r\n\]+If a line number is specified, break at start of code for that lin= e\.\[\r\n\]+If a function is specified, break at start of code for that fun= ction\.\[\r\n\]+If an address is specified, break at that exact address\.\[= \r\n\]+With no LOCATION, uses current execution address of selected stack f= rame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r= \n\]+THREADNUM is the number from \"info threads\"\.\[\r\n\]+CONDITION is a= boolean expression\.\[\r\n\]+Multiple breakpoints at one place are permitt= ed, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on= other commands dealing with breakpoints\." "help breakpoint \"break\" abbr= eviation" # test help breakpoints gdb_test "help breakpoints" "Making program stop at certain points\.\[\r\n= \]+List of commands:\[\r\n\]+awatch -- Set a watchpoint for an expression\[= \r\n\]+break -- Set breakpoint at specified line or function\[\r\n\]+catch = -- Set catchpoints to catch events\[\r\n\]+clear -- Clear breakpoint at spe= cified line or function\[\r\n\]+commands -- Set commands to be executed whe= n a breakpoint is hit\[\r\n\]+condition -- Specify breakpoint number N to b= reak only if COND is true\[\r\n\]+delete -- Delete some breakpoints or auto= -display expressions\[\r\n\]+disable -- Disable some breakpoints\[\r\n\]+en= able -- Enable some breakpoints\[\r\n\]+hbreak -- Set a hardware assisted = breakpoint\[\r\n\]+ignore -- Set ignore-count of breakpoint number N to COU= NT\[\r\n\]+rbreak -- Set a breakpoint for all functions matching REGEXP\[\r= \n\]+rwatch -- Set a read watchpoint for an expression\[\r\n\]+tbreak -- Se= t a temporary breakpoint\[\r\n\]+tcatch -- Set temporary catchpoints to cat= ch events\[\r\n\]+thbreak -- Set a temporary hardware assisted breakpoint\[= \r\n\]+watch -- Set a watchpoint for an expression\[\r\n\]+Type \"help\" fo= llowed by command name for full documentation\.\[\r\n\]+Command name abbrev= iations are allowed if unambiguous\." "help breakpoints" # test help backtrace "bt" abbreviation --------------050609020401030608060101--