public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Add some testcases
@ 2015-11-10  7:56 Fei Jie
  2015-11-10  7:57 ` [PATCH v3 4/4] Add testcases to break.exp Fei Jie
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Fei Jie @ 2015-11-10  7:56 UTC (permalink / raw)
  To: gdb-patches

I fixed my previous patches.These patches add testcases to files in gdb.base,
including default.exp, display.exp, list.exp, dfp-test.exp and break.exp so 
they can test these commands under more conditions.

Fei Jie (4):
  Add testcases to default.exp
  Add testcases to display.exp
  Add testcases to list.exp and dfp-test.exp
  Add testcases to break.exp

 gdb/testsuite/gdb.base/break.exp    |  9 +++++++
 gdb/testsuite/gdb.base/default.exp  | 10 ++++++++
 gdb/testsuite/gdb.base/dfp-test.exp |  1 +
 gdb/testsuite/gdb.base/display.c    |  6 +++++
 gdb/testsuite/gdb.base/display.exp  | 17 ++++++++++---
 gdb/testsuite/gdb.base/list.exp     | 49 +++++++++++++++++++++++++++++++++++++
 6 files changed, 89 insertions(+), 3 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/4] Add testcases to default.exp
  2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
                   ` (2 preceding siblings ...)
  2015-11-10  7:57 ` [PATCH v3 2/4] Add testcases to display.exp Fei Jie
@ 2015-11-10  7:57 ` Fei Jie
  2015-12-06 13:51   ` Joel Brobecker
  2015-11-10  8:02 ` [PATCH v3 0/4] Add some testcases fj
  4 siblings, 1 reply; 10+ messages in thread
From: Fei Jie @ 2015-11-10  7:57 UTC (permalink / raw)
  To: gdb-patches

    add testcases about info:
    *info extensions
    *info handle
    *info scope
    *info win
    add testcases about set width:
    *set width -1

gdb/testsuite/ChangeLog:

    * gdb.base/default.exp: Add new testcases.
---
 gdb/testsuite/gdb.base/default.exp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 4395c98..279dbb9 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -280,6 +280,8 @@ gdb_test "info copying"
 #
 #test info display
 gdb_test "info display" "There are no auto-display expressions now." "info display"
+#test info extensions
+gdb_test "info extensions" "Filename extensions and the languages they represent.*" "info extensions"
 #test info frame "f" abbreviation
 gdb_test "info f" "No stack.*|No selected frame.*" "info frame \"f\" abbreviation"
 #test info frame
@@ -290,6 +292,8 @@ gdb_test_no_output "info files" "info files"
 gdb_test "info float" "The program has no registers now." "info float"
 #test info functions
 gdb_test "info functions" "All defined functions:" "info functions"
+#test info handle
+gdb_test "info handle" "Signal\\s+Stop\\s+Print\\s+Pass to program\\s+Description.*" "info handle"
 #test info locals
 gdb_test "info locals" "No frame selected." "info locals"
 #test info program
@@ -298,6 +302,8 @@ gdb_test "info program" "The program being debugged is not being run." "info pro
 gdb_test "info registers" "The program has no registers now." "info registers"
 #test info stack "s" abbreviation
 gdb_test "info s" "No stack." "info stack \"s\" abbreviation"
+#test info scope
+gdb_test "info scope" "requires an argument \\(function, line or \\*addr\\) to define a scope" "info scope"
 #test info stack
 gdb_test "info stack" "No stack." "info stack"
 #test info set
@@ -353,6 +359,8 @@ gdb_test "info vector" "The program has no registers now." "info vector"
 gdb_test "info warranty" "15. *Disclaimer of Warranty.*" "info warranty"
 #test info watchpoints
 gdb_test "info watchpoints" "No watchpoints." "info watchpoints"
+#test info win
+gdb_test_no_output "info win" "info win"
 #test inspect
 gdb_test "inspect" "The history is empty." "inspect"
 #test jump
@@ -549,6 +557,8 @@ gdb_test "set variable" "Argument required .expression to compute.*" "set variab
 gdb_test_no_output "set verbose" "set verbose"
 #test set width
 gdb_test "set width" "Argument required .integer to set it to.*" "set width"
+#test set width -1
+gdb_test "set width -1" "integer -1 out of range"
 #test set write
 # This is only supported on targets which use exec.o.
 gdb_test_no_output "set write" "set write"
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp
  2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
  2015-11-10  7:57 ` [PATCH v3 4/4] Add testcases to break.exp Fei Jie
@ 2015-11-10  7:57 ` Fei Jie
  2015-12-06 14:08   ` Joel Brobecker
  2015-11-10  7:57 ` [PATCH v3 2/4] Add testcases to display.exp Fei Jie
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Fei Jie @ 2015-11-10  7:57 UTC (permalink / raw)
  To: gdb-patches

    add testcases which test list with more paraments to list.exp, and
    backtrace with parament '-1' to dfp-test.exp

gdb/testsuite/ChangeLog:

    *gdb.base/list.exp: Add new testcases.
    *gdb.base/dfp-test.exp: Likewise.
---
 gdb/testsuite/gdb.base/dfp-test.exp |  1 +
 gdb/testsuite/gdb.base/list.exp     | 49 +++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
index e648a6b..4caa50e 100644
--- a/gdb/testsuite/gdb.base/dfp-test.exp
+++ b/gdb/testsuite/gdb.base/dfp-test.exp
@@ -220,6 +220,7 @@ gdb_test "backtrace" ".*arg0_64 \\(arg0=0.1, arg1=1.0, arg2=2.0, arg3=3.0, arg4=
 gdb_breakpoint arg0_128
 gdb_continue_to_breakpoint "entry to arg0_128"
 gdb_test "backtrace" ".*arg0_128 \\(arg0=0.1, arg1=1.0, arg2=2.0, arg3=3.0, arg4=4.0, arg5=5.0\\).*" "backtrace at arg0_128"
+gdb_test "backtrace -1" ".*0x\[0-9\]\{1,16\}.*at\ .*${srcfile}.*"
 
 # Test calling inferior function with DFP arguments or return value.
 
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index 2aea9a3..c79369e 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -624,4 +624,53 @@ test_list "list -" 10 2 "7-8" "5-6"
 # the current line.
 test_list "list -" 10 1 "7" "6"
 
+# Get main address.
+set main_addr ""
+gdb_test_multiple "print/x &main" "getting main's address" {
+    -re "$decimal = \($hex\)\r\n$gdb_prompt $" {
+        set main_addr $expect_out(1, string)
+    }
+}
+# Test set listsize to -1.
+set_listsize -1
+
+set_listsize 10
+# Test list with line number.
+gdb_test "list 12" \
+    "7\\s+x = 0.*16\\s+foo \\(x\\+\\+\\);"
+
+# Test list with +.
+gdb_test "list +" \
+    "17\\s+foo \\(x\\+\\+\\).*26\\s+foo \\(x\\+\\+\\);"
+
+# Test list with '+' number.
+gdb_test "list +1" \
+    "23\\s+foo \\(x\\+\\+\\).*32\\s+foo \\(x\\+\\+\\);"
+
+# Test list with starting line number and ','.
+gdb_test "list 20," \
+    "20\\s+foo \\(x\\+\\+\\).*29\\s+foo \\(x\\+\\+\\);"
+
+# Test list with ',' and ending line number.
+gdb_test "list ,25" \
+    "16\\s+foo \\(x\\+\\+\\).*25\\s+foo \\(x\\+\\+\\);"
+
+# Test list with address.
+gdb_test "list *${main_addr}" \
+    "${main_addr} is in main.*${srcfile}.*"
+
+# Test list with '-' last line number.
+gdb_test "list -${last_line}" \
+    "1\\s+#include \"list0.h\".*10\\s+foo \\(x\\+\\+\\);"
+
+# Test list with ',' and a little-out-of-ranged line number.
+set little_past_end [expr ${last_line} + 5 ]
+gdb_test "list ,${little_past_end}" \
+    ".*43\\s+\\} \\/\\* last line \\*\\/"
+
+# Test list with ',' and a much-out-of-ranged line number.
+set much_past_end [expr ${last_line} + 10 ]
+gdb_test "list ,${much_past_end}" \
+    "Line number 44 out of range.*"
+
 remote_exec build "rm -f list0.h"
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 2/4] Add testcases to display.exp
  2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
  2015-11-10  7:57 ` [PATCH v3 4/4] Add testcases to break.exp Fei Jie
  2015-11-10  7:57 ` [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp Fei Jie
@ 2015-11-10  7:57 ` Fei Jie
  2015-12-06 14:00   ` Joel Brobecker
  2015-11-10  7:57 ` [PATCH v3 1/4] Add testcases to default.exp Fei Jie
  2015-11-10  8:02 ` [PATCH v3 0/4] Add some testcases fj
  4 siblings, 1 reply; 10+ messages in thread
From: Fei Jie @ 2015-11-10  7:57 UTC (permalink / raw)
  To: gdb-patches

    add testcases to display different types of data and variables
    *display/d/u/o/t/a/c
    *display array and structure

gdb/testsuite/ChangeLog:

    * gdb.base/display.c: Add varaible types.
    * gdb.base/display.exp: Add testcases to test display.
---
 gdb/testsuite/gdb.base/display.c   |  6 ++++++
 gdb/testsuite/gdb.base/display.exp | 17 ++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c
index cd833e2..2ade4d7 100644
--- a/gdb/testsuite/gdb.base/display.c
+++ b/gdb/testsuite/gdb.base/display.c
@@ -4,6 +4,12 @@
 #define LOOP 10
 
 int sum = 0;
+int int_array[2] = {0, 1};
+struct
+  {
+	char name;
+	int age;
+  } human;
 
 /* Call to force a variable onto the stack so we can see its address.  */
 void force_mem (int *arg) { }
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index 6e21d9e..8cbf875 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -80,13 +80,24 @@ gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j"
 gdb_test "disp/i &k" ".*3: x/i &k(\r\n|  )   $hex:.*" "display &k"
 gdb_test "disp/f f" ".*4: /f f = 3.1415*" "display/f f"
 gdb_test "disp/s &sum" ".*5: x/s &sum  $hex.*sum.:.*" "display/s &sum"
+gdb_test "disp/d f" "6: /d f = 3" "display/d f"
+gdb_test "disp/u f" "7: /u f = 3" "display/u f"
+gdb_test "disp/o f" "8: /o f = 03" "display/o f"
+gdb_test "disp/t f" "9: /t f = 11" "display/t f"
+gdb_test "disp/a f" "10: /a f = 0x3" "display/a f"
+gdb_test "disp/c f" "11: /c f = 3\ \'\\\\003\'" "display/c f"
+
+gdb_test "disp int_array" \
+    "12: int_array = \\{0, 1\\}" "display array"
+gdb_test "disp human" \
+    "13: human = {name = 0 '\\\\000', age = 0}" "display struct"
 
 # Hit the displays
 #
-gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
-gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
+gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 3 \'\\\\003\'\r\n\[0-9\]*: /a f = 0x3\r\n\[1-9\]*: /t f = 11\r\n\[1-9\]*: /o f = 03\r\n\[1-9\]*: /u f = 3\r\n\[1-9\]*: /d f = 3\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
+gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 4 \'\\\\004\'\r\n\[0-9\]*: /a f = 0x4\r\n\[1-9\]*: /t f = 100\r\n\[1-9\]*: /o f = 04\r\n\[1-9\]*: /u f = 4\r\n\[1-9\]*: /d f = 4\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "second disp"
 
-gdb_test "enab  disp 6" ".*No display number 6..*" "catch err"
+gdb_test "enab  disp 14" ".*No display number 14..*" "catch err"
 gdb_test_no_output "disab disp 1" "disab disp 1"
 gdb_test_no_output "disab disp 2" "disab disp 2"
 gdb_test_no_output "enab disp 1"  "re-enab"
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 4/4] Add testcases to break.exp
  2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
@ 2015-11-10  7:57 ` Fei Jie
  2015-12-06 14:10   ` Joel Brobecker
  2015-11-10  7:57 ` [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp Fei Jie
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Fei Jie @ 2015-11-10  7:57 UTC (permalink / raw)
  To: gdb-patches

    add testcases to break.exp as follows:
    *break with non-existed condition
    *break with out-ou-ranged address
    *break at offset -1

gdb/testsuite/ChangeLog:

    * gdb.base/break.exp: Add new testcases.
---
 gdb/testsuite/gdb.base/break.exp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index f879bc8..117a18f 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -334,6 +334,11 @@ gdb_test "enable" "" ""
 gdb_test "disable 10" "No breakpoint number 10." \
     "disable non-existent breakpoint 10"
 
+gdb_test "break main if donot_exist == 0" \
+    "No symbol \"donot_exist\" in current context\\."
+gdb_test "break \*0xfffffffffffffffff" \
+    "Numeric constant too large\\."
+
 gdb_test_no_output "set \$baz = 1.234"
 gdb_test "disable \$baz" \
     "Convenience variable must have integer value.*" \
@@ -399,6 +404,10 @@ set bp_location10 [gdb_get_line_number "set breakpoint 10 here"]
 gdb_test "break +1" \
     "Breakpoint.*at.* file .*$srcfile, line $bp_location10\\." \
     "breakpoint offset +1"
+# Test break at offset -1.
+gdb_test "break -1" \
+    "Note: breakpoint .* also set at.*Breakpoint.*at.* file .*$srcfile, line.*" \
+    "breakpoint offset -1"
 
 # Check to see if breakpoint is hit when stepped onto
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/4] Add some testcases
  2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
                   ` (3 preceding siblings ...)
  2015-11-10  7:57 ` [PATCH v3 1/4] Add testcases to default.exp Fei Jie
@ 2015-11-10  8:02 ` fj
  4 siblings, 0 replies; 10+ messages in thread
From: fj @ 2015-11-10  8:02 UTC (permalink / raw)
  To: gdb-patches

In patch v3, I used regexp to replace breakpoint number in [patch 4/4].

On 11/10/2015 03:56 PM, Fei Jie wrote:
> I fixed my previous patches.These patches add testcases to files in gdb.base,
> including default.exp, display.exp, list.exp, dfp-test.exp and break.exp so
> they can test these commands under more conditions.
>
> Fei Jie (4):
>    Add testcases to default.exp
>    Add testcases to display.exp
>    Add testcases to list.exp and dfp-test.exp
>    Add testcases to break.exp
>
>   gdb/testsuite/gdb.base/break.exp    |  9 +++++++
>   gdb/testsuite/gdb.base/default.exp  | 10 ++++++++
>   gdb/testsuite/gdb.base/dfp-test.exp |  1 +
>   gdb/testsuite/gdb.base/display.c    |  6 +++++
>   gdb/testsuite/gdb.base/display.exp  | 17 ++++++++++---
>   gdb/testsuite/gdb.base/list.exp     | 49 +++++++++++++++++++++++++++++++++++++
>   6 files changed, 89 insertions(+), 3 deletions(-)
>

-- 
Thanks
Fei Jie

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 1/4] Add testcases to default.exp
  2015-11-10  7:57 ` [PATCH v3 1/4] Add testcases to default.exp Fei Jie
@ 2015-12-06 13:51   ` Joel Brobecker
  0 siblings, 0 replies; 10+ messages in thread
From: Joel Brobecker @ 2015-12-06 13:51 UTC (permalink / raw)
  To: Fei Jie; +Cc: gdb-patches

>     add testcases about info:
>     *info extensions
>     *info handle
>     *info scope
>     *info win
>     add testcases about set width:
>     *set width -1

Just a couple of minor nits:

  1. "testcases" -> "tests"; the .exp file (Eg. default.exp) is
     a testcase, while a call to gdb_test executed a test. The testcase
     is a collection of tests usually logically related.

  2. We follow the GNU Coding Standards.
     https://sourceware.org/gdb/wiki/Internals%20Coding-Standards

     Above, sentences should start with a capital letter and end
     with a period (or a colon, as is more appropriate in your case).
     Therefore, start at the start of the line (no identation), and
     write "Add" instead of "add".

> gdb/testsuite/ChangeLog:
> 
>     * gdb.base/default.exp: Add new testcases.

Same as above, "testcases" -> "tests".

>  gdb/testsuite/gdb.base/default.exp | 10 ++++++++++
>  1 file changed, 10 insertions(+)

The changes themselves look good to me.

IIRC, I sent you the form to get started on copyright assignement,
so we'll need those to get through before we can accept your
contribution.

Thank you,
-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 2/4] Add testcases to display.exp
  2015-11-10  7:57 ` [PATCH v3 2/4] Add testcases to display.exp Fei Jie
@ 2015-12-06 14:00   ` Joel Brobecker
  0 siblings, 0 replies; 10+ messages in thread
From: Joel Brobecker @ 2015-12-06 14:00 UTC (permalink / raw)
  To: Fei Jie; +Cc: gdb-patches

On Tue, Nov 10, 2015 at 03:56:26PM +0800, Fei Jie wrote:
>     add testcases to display different types of data and variables
>     *display/d/u/o/t/a/c
>     *display array and structure

Same as for patch #1, no identation and capital 'A' for "Add".
Also, would you mind adding a space after the '*' for each bullet point?
I think this is going to make the revision log more readable.

> gdb/testsuite/ChangeLog:
> 
>     * gdb.base/display.c: Add varaible types.

typo: "varaible" -> "variable". But the sentence is malformed, since
it says you're adding types, which is not the case; you are adding
varaibles. I would be more precise, to help readers of the
ChangeLog entry, and say:

        * gdb.base/display.c: Add integer array varaible.  Add struct
        variable.

>     * gdb.base/display.exp: Add testcases to test display.

"Add additional tests of the display command."

> ---
>  gdb/testsuite/gdb.base/display.c   |  6 ++++++
>  gdb/testsuite/gdb.base/display.exp | 17 ++++++++++++++---
>  2 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c
> index cd833e2..2ade4d7 100644
> --- a/gdb/testsuite/gdb.base/display.c
> +++ b/gdb/testsuite/gdb.base/display.c
> @@ -4,6 +4,12 @@
>  #define LOOP 10
>  
>  int sum = 0;
> +int int_array[2] = {0, 1};
> +struct
> +  {
> +	char name;
> +	int age;
> +  } human;

The formatting does not conform to the GNU Coding Standards. It should
be:

struct
{
  char name;
  int age;
} human;

>  
>  /* Call to force a variable onto the stack so we can see its address.  */
>  void force_mem (int *arg) { }
> diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
> index 6e21d9e..8cbf875 100644
> --- a/gdb/testsuite/gdb.base/display.exp
> +++ b/gdb/testsuite/gdb.base/display.exp
> @@ -80,13 +80,24 @@ gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j"
>  gdb_test "disp/i &k" ".*3: x/i &k(\r\n|  )   $hex:.*" "display &k"
>  gdb_test "disp/f f" ".*4: /f f = 3.1415*" "display/f f"
>  gdb_test "disp/s &sum" ".*5: x/s &sum  $hex.*sum.:.*" "display/s &sum"
> +gdb_test "disp/d f" "6: /d f = 3" "display/d f"
> +gdb_test "disp/u f" "7: /u f = 3" "display/u f"
> +gdb_test "disp/o f" "8: /o f = 03" "display/o f"
> +gdb_test "disp/t f" "9: /t f = 11" "display/t f"
> +gdb_test "disp/a f" "10: /a f = 0x3" "display/a f"
> +gdb_test "disp/c f" "11: /c f = 3\ \'\\\\003\'" "display/c f"
> +
> +gdb_test "disp int_array" \
> +    "12: int_array = \\{0, 1\\}" "display array"
> +gdb_test "disp human" \
> +    "13: human = {name = 0 '\\\\000', age = 0}" "display struct"
>  
>  # Hit the displays
>  #
> -gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
> -gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
> +gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 3 \'\\\\003\'\r\n\[0-9\]*: /a f = 0x3\r\n\[1-9\]*: /t f = 11\r\n\[1-9\]*: /o f = 03\r\n\[1-9\]*: /u f = 3\r\n\[1-9\]*: /d f = 3\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
> +gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 4 \'\\\\004\'\r\n\[0-9\]*: /a f = 0x4\r\n\[1-9\]*: /t f = 100\r\n\[1-9\]*: /o f = 04\r\n\[1-9\]*: /u f = 4\r\n\[1-9\]*: /d f = 4\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "second disp"

Do you think the tests above could be made more readable by using
the multi_line function?

-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp
  2015-11-10  7:57 ` [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp Fei Jie
@ 2015-12-06 14:08   ` Joel Brobecker
  0 siblings, 0 replies; 10+ messages in thread
From: Joel Brobecker @ 2015-12-06 14:08 UTC (permalink / raw)
  To: Fei Jie; +Cc: gdb-patches

On Tue, Nov 10, 2015 at 03:56:27PM +0800, Fei Jie wrote:
>     add testcases which test list with more paraments to list.exp, and
>     backtrace with parament '-1' to dfp-test.exp
> 
> gdb/testsuite/ChangeLog:
> 
>     *gdb.base/list.exp: Add new testcases.
>     *gdb.base/dfp-test.exp: Likewise.

Same remarks as in #1 and #2 about "add" -> "Add" and the inaccurate
use of "testcases" instead of "tests. There is also a typo in
"paraments"

You should split the two patches, as the changes are logically
unrelated.

> ---
>  gdb/testsuite/gdb.base/dfp-test.exp |  1 +
>  gdb/testsuite/gdb.base/list.exp     | 49 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 50 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
> index e648a6b..4caa50e 100644
> --- a/gdb/testsuite/gdb.base/dfp-test.exp
> +++ b/gdb/testsuite/gdb.base/dfp-test.exp
> @@ -220,6 +220,7 @@ gdb_test "backtrace" ".*arg0_64 \\(arg0=0.1, arg1=1.0, arg2=2.0, arg3=3.0, arg4=
>  gdb_breakpoint arg0_128
>  gdb_continue_to_breakpoint "entry to arg0_128"
>  gdb_test "backtrace" ".*arg0_128 \\(arg0=0.1, arg1=1.0, arg2=2.0, arg3=3.0, arg4=4.0, arg5=5.0\\).*" "backtrace at arg0_128"
> +gdb_test "backtrace -1" ".*0x\[0-9\]\{1,16\}.*at\ .*${srcfile}.*"
>  
>  # Test calling inferior function with DFP arguments or return value.
>  
> diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
> index 2aea9a3..c79369e 100644
> --- a/gdb/testsuite/gdb.base/list.exp
> +++ b/gdb/testsuite/gdb.base/list.exp
> @@ -624,4 +624,53 @@ test_list "list -" 10 2 "7-8" "5-6"
>  # the current line.
>  test_list "list -" 10 1 "7" "6"
>  
> +# Get main address.
> +set main_addr ""
> +gdb_test_multiple "print/x &main" "getting main's address" {
> +    -re "$decimal = \($hex\)\r\n$gdb_prompt $" {
> +        set main_addr $expect_out(1, string)

I don't think you need the \ before ( and ).

The rest of the testcase looks OK to me.
-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 4/4] Add testcases to break.exp
  2015-11-10  7:57 ` [PATCH v3 4/4] Add testcases to break.exp Fei Jie
@ 2015-12-06 14:10   ` Joel Brobecker
  0 siblings, 0 replies; 10+ messages in thread
From: Joel Brobecker @ 2015-12-06 14:10 UTC (permalink / raw)
  To: Fei Jie; +Cc: gdb-patches

>     add testcases to break.exp as follows:
>     *break with non-existed condition
>     *break with out-ou-ranged address
>     *break at offset -1
> 
> gdb/testsuite/ChangeLog:
> 
>     * gdb.base/break.exp: Add new testcases.

Same comments as before...
The changes themselves look OK to me.

-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-12-06 14:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
2015-11-10  7:57 ` [PATCH v3 4/4] Add testcases to break.exp Fei Jie
2015-12-06 14:10   ` Joel Brobecker
2015-11-10  7:57 ` [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp Fei Jie
2015-12-06 14:08   ` Joel Brobecker
2015-11-10  7:57 ` [PATCH v3 2/4] Add testcases to display.exp Fei Jie
2015-12-06 14:00   ` Joel Brobecker
2015-11-10  7:57 ` [PATCH v3 1/4] Add testcases to default.exp Fei Jie
2015-12-06 13:51   ` Joel Brobecker
2015-11-10  8:02 ` [PATCH v3 0/4] Add some testcases fj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).