public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
@ 2022-09-23 14:17 Simon Marchi
  2022-09-23 14:17 ` [PATCH 1/3] gdb/testsuite: bump duration for the whole test in do_self_tests Simon Marchi
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Simon Marchi @ 2022-09-23 14:17 UTC (permalink / raw)
  To: gdb-patches

My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
regressions in gdb.gdb/python-helper.exp.  I forgot to update
gdb-gdb.py.in, as always.

It looks like my CI doesn't run the test properly.  Because inserting the
first breakpoint times out, do_self_tests skips the test.  I also had
troubles running the test locally due to these timeouts.  So the first
two patches address problems related to that, and the third one is the
actual fix.

Simon Marchi (3):
  gdb/testsuite: bump duration for the whole test in do_self_tests
  gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
  gdb/testsuite: update field names in gdb-gdb.py.in

 gdb/gdb-gdb.py.in                       |  4 +-
 gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
 gdb/testsuite/lib/gdb.exp               |  8 +--
 gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
 4 files changed, 31 insertions(+), 105 deletions(-)


base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
-- 
2.37.3


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

* [PATCH 1/3] gdb/testsuite: bump duration for the whole test in do_self_tests
  2022-09-23 14:17 [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Simon Marchi
@ 2022-09-23 14:17 ` Simon Marchi
  2022-09-23 14:18 ` [PATCH 2/3] gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp Simon Marchi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2022-09-23 14:17 UTC (permalink / raw)
  To: gdb-patches

When running gdb.gdb/python-helper.exp, I get some timeouts:

    continue
    Continuing.
    print 1

    FAIL: gdb.gdb/python-helper.exp: hit breakpoint in outer gdb (timeout)

At this time, GDB is actually processing the stop and reading in some
CUs.  selftest_setup does bump the timeout, but it's not for the whole
test.

Since debugging GDB with GDB is (unfortunately) a bit slow, bump the
timeout for the whole duration of the setup and body.  On my optimized
build, the command takes just a bit more than the current timeout of 10
seconds.  But it's much slower if running the test on an unoptimized
build, so I think it's necessary to bump the timeout for that in any
case.

Change-Id: I4d38285870e76c94f9d0bfdb60648a2e7f2cfa5d
---
 gdb/testsuite/lib/selftest-support.exp | 36 ++++++--------------------
 1 file changed, 8 insertions(+), 28 deletions(-)

diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
index 138afc0df568..2b17c539a96f 100644
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -45,29 +45,14 @@ proc find_gdb { arg } {
 
 proc selftest_setup { executable function } {
     global gdb_prompt
-    global timeout
     global INTERNAL_GDBFLAGS
 
     # load yourself into the debugger
-    # This can take a relatively long time, particularly for testing where
-    # the executable is being accessed over a network, or where gdb does not
-    # support partial symbols for a particular target and has to load the
-    # entire symbol table.  Set the timeout to 10 minutes, which should be
-    # adequate for most environments (it *has* timed out with 5 min on a
-    # SPARCstation SLC under moderate load, so this isn't unreasonable).
-    # After gdb is started, set the timeout to 30 seconds for the duration
-    # of this test, and then back to the original value.
-
-    set oldtimeout $timeout
-    set timeout 600
-    verbose "Timeout is now $timeout seconds" 2
 
     global gdb_file_cmd_debug_info
     set gdb_file_cmd_debug_info "unset"
 
     set result [gdb_load $executable]
-    set timeout $oldtimeout
-    verbose "Timeout is now $timeout seconds" 2
 
     if { $result != 0 } then {
 	return -1
@@ -85,9 +70,6 @@ proc selftest_setup { executable function } {
     }
 
     # run yourself
-    # It may take a very long time for the inferior gdb to start (lynx),
-    # so we bump it back up for the duration of this command.
-    set timeout 600
 
     set description "run until breakpoint at $function"
     gdb_test_multiple "run $INTERNAL_GDBFLAGS" "$description" {
@@ -99,21 +81,14 @@ proc selftest_setup { executable function } {
         }
         -re "vfork: No more processes.*$gdb_prompt $" {
             fail "$description (out of virtual memory)"
-            set timeout $oldtimeout
-            verbose "Timeout is now $timeout seconds" 2
             return -1
         }
         -re ".*$gdb_prompt $" {
             fail "$description"
-            set timeout $oldtimeout
-            verbose "Timeout is now $timeout seconds" 2
             return -1
         }
     }
 
-    set timeout $oldtimeout
-    verbose "Timeout is now $timeout seconds" 2
-
     return 0
 }
 
@@ -159,9 +134,14 @@ proc do_self_tests {function body} {
     gdb_start
     set file [remote_download host $GDB_FULLPATH $xgdb]
 
-    set result [selftest_setup $file $function]
-    if {$result == 0} then {
-	set result [uplevel $body]
+    # When debugging GDB with GDB, some operations can take a relatively long
+    # time, especially if the build is non-optimized.  Bump the timeout for the
+    # duration of the test.
+    with_timeout_factor 10 {
+	set result [selftest_setup $file $function]
+	if {$result == 0} then {
+	    set result [uplevel $body]
+	}
     }
 
     gdb_exit
-- 
2.37.3


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

* [PATCH 2/3] gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
  2022-09-23 14:17 [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Simon Marchi
  2022-09-23 14:17 ` [PATCH 1/3] gdb/testsuite: bump duration for the whole test in do_self_tests Simon Marchi
@ 2022-09-23 14:18 ` Simon Marchi
  2022-09-23 14:18 ` [PATCH 3/3] gdb/testsuite: update field names in gdb-gdb.py.in Simon Marchi
  2022-09-23 17:02 ` [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Luis Machado
  3 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2022-09-23 14:18 UTC (permalink / raw)
  To: gdb-patches

If some command in there gives the wrong answer, we currently have to
wait for a timeout for the test to continue.  For instance, I currently
see:

    print *val->type
    $1 = Python Exception <class 'gdb.error'>: Cannot take address of method length.

    (outer-gdb) FAIL: gdb.gdb/python-helper.exp: pretty print type (timeout)

We can avoid this and modernize the test at the same time by using the
-prompt option of gdb_test.

gdb_test_no_output currently accepts a -prompt_re option (the variable
name passed to parse_args defines the option name), but I think
it's a typo.  It's supposed to be -prompt, like gdb_test.  I can't find
anything using -prompt_re using grep.  Change it to just "prompt".

Change-Id: Icc0a9a0ef482e62460c708bccdd544c11d711eca
---
 gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
 gdb/testsuite/lib/gdb.exp               |  8 +--
 2 files changed, 21 insertions(+), 75 deletions(-)

diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp
index 6db8bf0df507..ea362ef693d9 100644
--- a/gdb/testsuite/gdb.gdb/python-helper.exp
+++ b/gdb/testsuite/gdb.gdb/python-helper.exp
@@ -82,13 +82,11 @@ proc test_python_helper {} {
     # binary into the inner GDB.
     gdb_test_no_output "disable breakpoints"
 
+    set outer_prompt_re "\\(outer-gdb\\) $"
+
     # Adjust the prompt on the outer gdb, this just makes things a
     # little clearer when trying to unpick which GDB is active.
-    gdb_test_multiple "set prompt (outer-gdb) " "set outer gdb prompt" {
-	-re "\[(\]outer-gdb\[)\].*\[(\]outer-gdb\[)\] $" {
-	    pass $gdb_test_name
-	}
-    }
+    gdb_test_no_output -prompt $outer_prompt_re  "set prompt (outer-gdb) " "set outer gdb prompt"
 
     # Send a command to the outer GDB to continue the inner GDB.  The
     # stop is being detected from the inner GDB, hence the use of -i
@@ -113,18 +111,10 @@ proc test_python_helper {} {
     # Send Ctrl-C to the inner GDB, this should kick us back to the
     # prompt of the outer GDB.
     send_inferior "\003"
-    gdb_test_multiple "" "interrupted the inner" {
-	-re ".*\\(outer-gdb\\) $" {
-	    pass $gdb_test_name
-	}
-    }
+    gdb_test -prompt $outer_prompt_re "" "" "interrupted the inner"
 
     # Now enable all breakpoints within the outer GDB.
-    gdb_test_multiple "enable breakpoints" "" {
-	-re "\\(outer-gdb\\) $" {
-	    pass $gdb_test_name
-	}
-    }
+    gdb_test_no_output -prompt $outer_prompt_re "enable breakpoints"
 
     # We need to resume the inner GDB after interrupting it, this is
     # done by sending 'continue'.  However, GDB will not redisplay the
@@ -137,11 +127,7 @@ proc test_python_helper {} {
     # GDB, this should result in the outer GDB stopping at one of the
     # breakpoints we created..
     send_inferior "print 1\n"
-    gdb_test_multiple "" "hit breakpoint in outer gdb" {
-	-re "Breakpoint $decimal, value_print.*\\(outer-gdb\\) $" {
-	    pass $gdb_test_name
-	}
-    }
+    gdb_test -prompt $outer_prompt_re "" "Breakpoint $decimal, value_print.*" "hit breakpoint in outer gdb"
 
     # Now inspect the type of parameter VAL, this should trigger the
     # pretty printers.
@@ -152,16 +138,8 @@ proc test_python_helper {} {
 		    " chain = 0x0," \
 		    " instance_flags = 0," \
 		    " length = $decimal," \
-		    " main_type = $hex}" \
-		    "\\(outer-gdb\\) $"]
-    gdb_test_multiple "print *val->type" "pretty print type" {
-	-re "$answer" {
-	    pass $gdb_test_name
-	}
-	-re "There is no member named.*\r\n\\(outer-gdb\\) $" {
-	    fail $gdb_test_name
-	}
-    }
+		    " main_type = $hex}"]
+    gdb_test -prompt $outer_prompt_re "print *val->type" $answer "pretty print type"
 
     set answer [multi_line \
 		    "$decimal = " \
@@ -170,16 +148,8 @@ proc test_python_helper {} {
 		    " flags = \[^\r\n\]+," \
 		    " owner = $hex \\(gdbarch\\)," \
 		    " target_type = 0x0," \
-		    " type_specific_field = TYPE_SPECIFIC_NONE}" \
-		    "\\(outer-gdb\\) $"]
-    gdb_test_multiple "print *val->type->main_type" "pretty print type->main_type" {
-	-re "$answer" {
-	    pass $gdb_test_name
-	}
-	-re "There is no member named.*\r\n\\(outer-gdb\\) $" {
-	    fail $gdb_test_name
-	}
-    }
+		    " type_specific_field = TYPE_SPECIFIC_NONE}"]
+    gdb_test -prompt $outer_prompt_re "print *val->type->main_type" $answer "pretty print type->main_type"
 
     # Send the continue to the outer GDB, which resumes the inner GDB,
     # we then detect the prompt from the inner GDB, hence the use of
@@ -195,12 +165,8 @@ proc test_python_helper {} {
     # information, this will include the TYPE_SPECIFIC_INT
     # information.
     send_inferior "print global_c.m_val\n"
-    gdb_test_multiple "" "print integer from DWARF info" {
-	-re "Breakpoint $decimal, value_print.*\\(outer-gdb\\) $" {
-	    pass $gdb_test_name
-	}
-    }
-
+    gdb_test -prompt $outer_prompt_re "" "Breakpoint $decimal, value_print.*" "print integer from DWARF info"
+	
     set answer [multi_line \
 		    "$decimal = " \
 		    "{name = $hex \"int\"," \
@@ -208,16 +174,8 @@ proc test_python_helper {} {
 		    " flags = \[^\r\n\]+," \
 		    " owner = $hex \\(objfile\\)," \
 		    " target_type = 0x0," \
-		    " int_stuff = { bit_size = $decimal, bit_offset = $decimal }}" \
-		    "\\(outer-gdb\\) $"]
-    gdb_test_multiple "print *val->type->main_type" "pretty print type->main_type for DWARF type" {
-	-re "$answer" {
-	    pass $gdb_test_name
-	}
-	-re "There is no member named.*\r\n\\(outer-gdb\\) $" {
-	    fail $gdb_test_name
-	}
-    }
+		    " int_stuff = { bit_size = $decimal, bit_offset = $decimal }}"]
+    gdb_test -prompt $outer_prompt_re "print *val->type->main_type" $answer "pretty print type->main_type for DWARF type"
 
     # Send the continue to the outer GDB, which resumes the inner GDB,
     # we then detect the prompt from the inner GDB, hence the use of
@@ -232,11 +190,7 @@ proc test_python_helper {} {
     # Send a command to the inner GDB, this should result in the outer
     # GDB stopping at the value_print breakpoint again.
     send_inferior "ptype global_c\n"
-    gdb_test_multiple "" "hit breakpoint in outer gdb again" {
-	-re "Breakpoint $decimal, c_print_type .*\\(outer-gdb\\) $" {
-	    pass $gdb_test_name
-	}
-    }
+    gdb_test -prompt $outer_prompt_re "" "Breakpoint $decimal, c_print_type.*" "hit breakpoint in outer gdb again"
 
     set answer [multi_line \
 		    "$decimal = " \
@@ -251,16 +205,8 @@ proc test_python_helper {} {
 		    "   m_loc_kind = FIELD_LOC_KIND_BITPOS," \
 		    "   bitsize = 0," \
 		    "   bitpos = 0}," \
-		    " cplus_stuff = $hex}" \
-		    "\\(outer-gdb\\) $"]
-    gdb_test_multiple "print *type->main_type" "" {
-	-re "$answer" {
-	    pass $gdb_test_name
-	}
-	-re "\r\n\\(outer-gdb\\) $" {
-	    fail $gdb_test_name
-	}
-    }
+		    " cplus_stuff = $hex}"]
+    gdb_test -prompt $outer_prompt_re "print *type->main_type" $answer
 
     return 0
 }
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 68536b00f146..5ab4df1bcf3c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1478,17 +1478,17 @@ proc gdb_test_no_output { args } {
     global gdb_prompt
 
     parse_args {
-	{prompt_re ""}
+	{prompt ""}
 	{nopass}
     }
 
     lassign $args command message
 
-    set prompt_re [fill_in_default_prompt $prompt_re]
+    set prompt [fill_in_default_prompt $prompt]
 
     set command_regex [string_to_regexp $command]
-    gdb_test_multiple $command $message -prompt $prompt_re {
-	-re "^$command_regex\r\n$prompt_re" {
+    gdb_test_multiple $command $message -prompt $prompt {
+	-re "^$command_regex\r\n$prompt" {
 	    if {!$nopass} {
 		pass $gdb_test_name
 	    }
-- 
2.37.3


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

* [PATCH 3/3] gdb/testsuite: update field names in gdb-gdb.py.in
  2022-09-23 14:17 [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Simon Marchi
  2022-09-23 14:17 ` [PATCH 1/3] gdb/testsuite: bump duration for the whole test in do_self_tests Simon Marchi
  2022-09-23 14:18 ` [PATCH 2/3] gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp Simon Marchi
@ 2022-09-23 14:18 ` Simon Marchi
  2022-09-23 17:02 ` [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Luis Machado
  3 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2022-09-23 14:18 UTC (permalink / raw)
  To: gdb-patches

Patches that renamed the type::length and type::target_type fields
didn't update gdb-gdb.py.in accordingly, do that.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29599
Change-Id: I0f3f37a94d43497789156b0ded4d2f2dd5b89496
---
 gdb/gdb-gdb.py.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in
index a6148d6dd67e..c43f54e202d3 100644
--- a/gdb/gdb-gdb.py.in
+++ b/gdb/gdb-gdb.py.in
@@ -115,7 +115,7 @@ class StructTypePrettyPrinter:
         fields.append(
             "instance_flags = %s" % TypeFlagsPrinter(self.val["m_instance_flags"])
         )
-        fields.append("length = %d" % self.val["length"])
+        fields.append("length = %d" % self.val["m_length"])
         fields.append("main_type = %s" % self.val["main_type"])
         return "\n{" + ",\n ".join(fields) + "}"
 
@@ -260,7 +260,7 @@ class StructMainTypePrettyPrinter:
         fields.append("code = %s" % self.val["code"])
         fields.append("flags = [%s]" % self.flags_to_string())
         fields.append("owner = %s" % self.owner_to_string())
-        fields.append("target_type = %s" % self.val["target_type"])
+        fields.append("target_type = %s" % self.val["m_target_type"])
         if self.val["nfields"] > 0:
             for fieldno in range(self.val["nfields"]):
                 fields.append(self.struct_field_img(fieldno))
-- 
2.37.3


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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-23 14:17 [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Simon Marchi
                   ` (2 preceding siblings ...)
  2022-09-23 14:18 ` [PATCH 3/3] gdb/testsuite: update field names in gdb-gdb.py.in Simon Marchi
@ 2022-09-23 17:02 ` Luis Machado
  2022-09-23 21:35   ` Tom de Vries
  3 siblings, 1 reply; 11+ messages in thread
From: Luis Machado @ 2022-09-23 17:02 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
> regressions in gdb.gdb/python-helper.exp.  I forgot to update
> gdb-gdb.py.in, as always.
> 
> It looks like my CI doesn't run the test properly.  Because inserting the
> first breakpoint times out, do_self_tests skips the test.  I also had
> troubles running the test locally due to these timeouts.  So the first
> two patches address problems related to that, and the third one is the
> actual fix.
> 
> Simon Marchi (3):
>    gdb/testsuite: bump duration for the whole test in do_self_tests
>    gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>    gdb/testsuite: update field names in gdb-gdb.py.in
> 
>   gdb/gdb-gdb.py.in                       |  4 +-
>   gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>   gdb/testsuite/lib/gdb.exp               |  8 +--
>   gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>   4 files changed, 31 insertions(+), 105 deletions(-)
> 
> 
> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956

Thanks for the series. I tested this on my end and it seems to work nicely.

The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
interpreter hitting GC_find_limit_with_bound. I'm not sure why this happens. Maybe
it is a problem with guile and armhf.

I don't think it is a flaw with the patch though. We'd have to go out of our way
to handle something like this in the testcase.

So this series LGTM.

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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-23 17:02 ` [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Luis Machado
@ 2022-09-23 21:35   ` Tom de Vries
  2022-09-26 18:01     ` Simon Marchi
  0 siblings, 1 reply; 11+ messages in thread
From: Tom de Vries @ 2022-09-23 21:35 UTC (permalink / raw)
  To: Luis Machado, Simon Marchi, gdb-patches

On 9/23/22 19:02, Luis Machado via Gdb-patches wrote:
> On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
>> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
>> regressions in gdb.gdb/python-helper.exp.  I forgot to update
>> gdb-gdb.py.in, as always.
>>
>> It looks like my CI doesn't run the test properly.  Because inserting the
>> first breakpoint times out, do_self_tests skips the test.  I also had
>> troubles running the test locally due to these timeouts.  So the first
>> two patches address problems related to that, and the third one is the
>> actual fix.
>>
>> Simon Marchi (3):
>>    gdb/testsuite: bump duration for the whole test in do_self_tests
>>    gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>>    gdb/testsuite: update field names in gdb-gdb.py.in
>>
>>   gdb/gdb-gdb.py.in                       |  4 +-
>>   gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>>   gdb/testsuite/lib/gdb.exp               |  8 +--
>>   gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>>   4 files changed, 31 insertions(+), 105 deletions(-)
>>
>>
>> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
> 
> Thanks for the series. I tested this on my end and it seems to work nicely.
> 
> The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
> interpreter hitting GC_find_limit_with_bound. I'm not sure why this 
> happens. Maybe
> it is a problem with guile and armhf.

It's documented behaviour of libgc1, see
https://sourceware.org/bugzilla/show_bug.cgi?id=29325 .

Thanks,
- Tom

> 
> I don't think it is a flaw with the patch though. We'd have to go out of 
> our way
> to handle something like this in the testcase.
> 
> So this series LGTM.

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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-23 21:35   ` Tom de Vries
@ 2022-09-26 18:01     ` Simon Marchi
  2022-09-26 18:39       ` Tom de Vries
  2022-09-27 10:34       ` Bruno Larsen
  0 siblings, 2 replies; 11+ messages in thread
From: Simon Marchi @ 2022-09-26 18:01 UTC (permalink / raw)
  To: Tom de Vries, Luis Machado, gdb-patches



On 2022-09-23 17:35, Tom de Vries wrote:
> On 9/23/22 19:02, Luis Machado via Gdb-patches wrote:
>> On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
>>> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
>>> regressions in gdb.gdb/python-helper.exp.  I forgot to update
>>> gdb-gdb.py.in, as always.
>>>
>>> It looks like my CI doesn't run the test properly.  Because inserting the
>>> first breakpoint times out, do_self_tests skips the test.  I also had
>>> troubles running the test locally due to these timeouts.  So the first
>>> two patches address problems related to that, and the third one is the
>>> actual fix.
>>>
>>> Simon Marchi (3):
>>>    gdb/testsuite: bump duration for the whole test in do_self_tests
>>>    gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>>>    gdb/testsuite: update field names in gdb-gdb.py.in
>>>
>>>   gdb/gdb-gdb.py.in                       |  4 +-
>>>   gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>>>   gdb/testsuite/lib/gdb.exp               |  8 +--
>>>   gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>>>   4 files changed, 31 insertions(+), 105 deletions(-)
>>>
>>>
>>> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
>>
>> Thanks for the series. I tested this on my end and it seems to work nicely.
>>
>> The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
>> interpreter hitting GC_find_limit_with_bound. I'm not sure why this happens. Maybe
>> it is a problem with guile and armhf.
> 
> It's documented behaviour of libgc1, see
> https://sourceware.org/bugzilla/show_bug.cgi?id=29325 .

Ack, this is an orthogonal issue (and for some reason I don't see it on
my Arch Linux, but I have certainly seen it elsewhere).

Just to confirm, does the series look good to you too Tom?

Simon

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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-26 18:01     ` Simon Marchi
@ 2022-09-26 18:39       ` Tom de Vries
  2022-09-26 21:33         ` Simon Marchi
  2022-09-27 10:34       ` Bruno Larsen
  1 sibling, 1 reply; 11+ messages in thread
From: Tom de Vries @ 2022-09-26 18:39 UTC (permalink / raw)
  To: Simon Marchi, Luis Machado, gdb-patches

On 9/26/22 20:01, Simon Marchi wrote:
> 
> 
> On 2022-09-23 17:35, Tom de Vries wrote:
>> On 9/23/22 19:02, Luis Machado via Gdb-patches wrote:
>>> On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
>>>> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
>>>> regressions in gdb.gdb/python-helper.exp.  I forgot to update
>>>> gdb-gdb.py.in, as always.
>>>>
>>>> It looks like my CI doesn't run the test properly.  Because inserting the
>>>> first breakpoint times out, do_self_tests skips the test.  I also had
>>>> troubles running the test locally due to these timeouts.  So the first
>>>> two patches address problems related to that, and the third one is the
>>>> actual fix.
>>>>
>>>> Simon Marchi (3):
>>>>     gdb/testsuite: bump duration for the whole test in do_self_tests
>>>>     gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>>>>     gdb/testsuite: update field names in gdb-gdb.py.in
>>>>
>>>>    gdb/gdb-gdb.py.in                       |  4 +-
>>>>    gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>>>>    gdb/testsuite/lib/gdb.exp               |  8 +--
>>>>    gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>>>>    4 files changed, 31 insertions(+), 105 deletions(-)
>>>>
>>>>
>>>> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
>>>
>>> Thanks for the series. I tested this on my end and it seems to work nicely.
>>>
>>> The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
>>> interpreter hitting GC_find_limit_with_bound. I'm not sure why this happens. Maybe
>>> it is a problem with guile and armhf.
>>
>> It's documented behaviour of libgc1, see
>> https://sourceware.org/bugzilla/show_bug.cgi?id=29325 .
> 
> Ack, this is an orthogonal issue (and for some reason I don't see it on
> my Arch Linux, but I have certainly seen it elsewhere).
> 
> Just to confirm, does the series look good to you too Tom?
> 

Hi Simon,

it does, yes, thanks.

I did wonder a bit about the first patch, where we remove the whole bit 
about the 5 minute timeout, but after thinking a bit on this I realized 
that setting absolute timeouts like that are likely to be inaccurate, so 
replacing it with a relative one (timeout factor) is better.  The quoted 
example is likely to have an in increased timeout in the board settings 
anyway, so that could partially take care of the drop in timeout from 5m 
(600s) to 10 (timeout factor) * 10s (100s).

Anyway, I tested the series and it takes care of the regression for me.

Thanks,
- Tom

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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-26 18:39       ` Tom de Vries
@ 2022-09-26 21:33         ` Simon Marchi
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2022-09-26 21:33 UTC (permalink / raw)
  To: Tom de Vries, Luis Machado, gdb-patches



On 2022-09-26 14:39, Tom de Vries wrote:
> On 9/26/22 20:01, Simon Marchi wrote:
>>
>>
>> On 2022-09-23 17:35, Tom de Vries wrote:
>>> On 9/23/22 19:02, Luis Machado via Gdb-patches wrote:
>>>> On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
>>>>> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
>>>>> regressions in gdb.gdb/python-helper.exp.  I forgot to update
>>>>> gdb-gdb.py.in, as always.
>>>>>
>>>>> It looks like my CI doesn't run the test properly.  Because inserting the
>>>>> first breakpoint times out, do_self_tests skips the test.  I also had
>>>>> troubles running the test locally due to these timeouts.  So the first
>>>>> two patches address problems related to that, and the third one is the
>>>>> actual fix.
>>>>>
>>>>> Simon Marchi (3):
>>>>>     gdb/testsuite: bump duration for the whole test in do_self_tests
>>>>>     gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>>>>>     gdb/testsuite: update field names in gdb-gdb.py.in
>>>>>
>>>>>    gdb/gdb-gdb.py.in                       |  4 +-
>>>>>    gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>>>>>    gdb/testsuite/lib/gdb.exp               |  8 +--
>>>>>    gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>>>>>    4 files changed, 31 insertions(+), 105 deletions(-)
>>>>>
>>>>>
>>>>> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
>>>>
>>>> Thanks for the series. I tested this on my end and it seems to work nicely.
>>>>
>>>> The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
>>>> interpreter hitting GC_find_limit_with_bound. I'm not sure why this happens. Maybe
>>>> it is a problem with guile and armhf.
>>>
>>> It's documented behaviour of libgc1, see
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=29325 .
>>
>> Ack, this is an orthogonal issue (and for some reason I don't see it on
>> my Arch Linux, but I have certainly seen it elsewhere).
>>
>> Just to confirm, does the series look good to you too Tom?
>>
> 
> Hi Simon,
> 
> it does, yes, thanks.
> 
> I did wonder a bit about the first patch, where we remove the whole bit about the 5 minute timeout, but after thinking a bit on this I realized that setting absolute timeouts like that are likely to be inaccurate, so replacing it with a relative one (timeout factor) is better.  The quoted example is likely to have an in increased timeout in the board settings anyway, so that could partially take care of the drop in timeout from 5m (600s) to 10 (timeout factor) * 10s (100s).

Yeah, that was my thinking: if it's a slow board, it will have some
increased timeout already, and that will be multiplied by 10.  This is
better than one hard-coded value added 20 years ago for some specific
board.

> Anyway, I tested the series and it takes care of the regression for me.

Thanks, will push.

Simon

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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-26 18:01     ` Simon Marchi
  2022-09-26 18:39       ` Tom de Vries
@ 2022-09-27 10:34       ` Bruno Larsen
  2022-09-27 10:42         ` Luis Machado
  1 sibling, 1 reply; 11+ messages in thread
From: Bruno Larsen @ 2022-09-27 10:34 UTC (permalink / raw)
  To: Simon Marchi, Tom de Vries, Luis Machado, gdb-patches

On 26/09/2022 20:01, Simon Marchi via Gdb-patches wrote:
>
> On 2022-09-23 17:35, Tom de Vries wrote:
>> On 9/23/22 19:02, Luis Machado via Gdb-patches wrote:
>>> On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
>>>> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
>>>> regressions in gdb.gdb/python-helper.exp.  I forgot to update
>>>> gdb-gdb.py.in, as always.
>>>>
>>>> It looks like my CI doesn't run the test properly.  Because inserting the
>>>> first breakpoint times out, do_self_tests skips the test.  I also had
>>>> troubles running the test locally due to these timeouts.  So the first
>>>> two patches address problems related to that, and the third one is the
>>>> actual fix.
>>>>
>>>> Simon Marchi (3):
>>>>     gdb/testsuite: bump duration for the whole test in do_self_tests
>>>>     gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>>>>     gdb/testsuite: update field names in gdb-gdb.py.in
>>>>
>>>>    gdb/gdb-gdb.py.in                       |  4 +-
>>>>    gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>>>>    gdb/testsuite/lib/gdb.exp               |  8 +--
>>>>    gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>>>>    4 files changed, 31 insertions(+), 105 deletions(-)
>>>>
>>>>
>>>> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
>>> Thanks for the series. I tested this on my end and it seems to work nicely.
>>>
>>> The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
>>> interpreter hitting GC_find_limit_with_bound. I'm not sure why this happens. Maybe
>>> it is a problem with guile and armhf.
>> It's documented behaviour of libgc1, see
>> https://sourceware.org/bugzilla/show_bug.cgi?id=29325 .
> Ack, this is an orthogonal issue (and for some reason I don't see it on
> my Arch Linux, but I have certainly seen it elsewhere).

This bug happens because of an old version of libgc being used, where 
they used that segfault to probe memory for something. They have 
developed a new way of probing that doesn't trigger this segfault, but 
not all distributions seem to have backported it. It's probably not 
happening on Arch because htey have a new version of the library, while 
on fedora it was happening until recently (Alexandra backported that for 
us). Fixing this sort of needs to happen on a per-distro basis, as it 
isn't GDB related, it's an "available libraries" problem.

Cheers,
Bruno

>
> Just to confirm, does the series look good to you too Tom?
>
> Simon
>


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

* Re: [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups
  2022-09-27 10:34       ` Bruno Larsen
@ 2022-09-27 10:42         ` Luis Machado
  0 siblings, 0 replies; 11+ messages in thread
From: Luis Machado @ 2022-09-27 10:42 UTC (permalink / raw)
  To: Bruno Larsen, Simon Marchi, Tom de Vries, gdb-patches

On 9/27/22 11:34, Bruno Larsen wrote:
> On 26/09/2022 20:01, Simon Marchi via Gdb-patches wrote:
>>
>> On 2022-09-23 17:35, Tom de Vries wrote:
>>> On 9/23/22 19:02, Luis Machado via Gdb-patches wrote:
>>>> On 9/23/22 15:17, Simon Marchi via Gdb-patches wrote:
>>>>> My patches that touched TYPE_LENGTH and TYPE_TARGET_TYPE caused
>>>>> regressions in gdb.gdb/python-helper.exp.  I forgot to update
>>>>> gdb-gdb.py.in, as always.
>>>>>
>>>>> It looks like my CI doesn't run the test properly.  Because inserting the
>>>>> first breakpoint times out, do_self_tests skips the test.  I also had
>>>>> troubles running the test locally due to these timeouts.  So the first
>>>>> two patches address problems related to that, and the third one is the
>>>>> actual fix.
>>>>>
>>>>> Simon Marchi (3):
>>>>>     gdb/testsuite: bump duration for the whole test in do_self_tests
>>>>>     gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp
>>>>>     gdb/testsuite: update field names in gdb-gdb.py.in
>>>>>
>>>>>    gdb/gdb-gdb.py.in                       |  4 +-
>>>>>    gdb/testsuite/gdb.gdb/python-helper.exp | 88 +++++--------------------
>>>>>    gdb/testsuite/lib/gdb.exp               |  8 +--
>>>>>    gdb/testsuite/lib/selftest-support.exp  | 36 +++-------
>>>>>    4 files changed, 31 insertions(+), 105 deletions(-)
>>>>>
>>>>>
>>>>> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
>>>> Thanks for the series. I tested this on my end and it seems to work nicely.
>>>>
>>>> The only hiccup I noticed is when GDB runs into a SIGSEGV due to the guile
>>>> interpreter hitting GC_find_limit_with_bound. I'm not sure why this happens. Maybe
>>>> it is a problem with guile and armhf.
>>> It's documented behaviour of libgc1, see
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=29325 .
>> Ack, this is an orthogonal issue (and for some reason I don't see it on
>> my Arch Linux, but I have certainly seen it elsewhere).
> 
> This bug happens because of an old version of libgc being used, where they used that segfault to probe memory for something. They have developed a new way of probing that doesn't trigger this segfault, but not all distributions seem to have backported it. It's probably not happening on Arch because htey have a new version of the library, while on fedora it was happening until recently (Alexandra backported that for us). Fixing this sort of needs to happen on a per-distro basis, as it isn't GDB related, it's an "available libraries" problem.

Thanks for the tip. I'll try to update the packages for this particular distro (Ubuntu 22.04).

> 
> Cheers,
> Bruno
> 
>>
>> Just to confirm, does the series look good to you too Tom?
>>
>> Simon
>>
> 


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

end of thread, other threads:[~2022-09-27 10:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 14:17 [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Simon Marchi
2022-09-23 14:17 ` [PATCH 1/3] gdb/testsuite: bump duration for the whole test in do_self_tests Simon Marchi
2022-09-23 14:18 ` [PATCH 2/3] gdb/testsuite: use gdb_test in gdb.gdb/python-helper.exp Simon Marchi
2022-09-23 14:18 ` [PATCH 3/3] gdb/testsuite: update field names in gdb-gdb.py.in Simon Marchi
2022-09-23 17:02 ` [PATCH 0/3] Fix gdb.gdb/python-helper.exp + cleanups Luis Machado
2022-09-23 21:35   ` Tom de Vries
2022-09-26 18:01     ` Simon Marchi
2022-09-26 18:39       ` Tom de Vries
2022-09-26 21:33         ` Simon Marchi
2022-09-27 10:34       ` Bruno Larsen
2022-09-27 10:42         ` Luis Machado

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).