This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Implement the ability to set/unset environment variables to GDBserver when starting the inferior


On Monday, August 07 2017, Simon Marchi wrote:

> On 2017-07-27 05:35, Sergio Durigan Junior wrote:
>> +# Helper function to re-run to main and breaking at the "break-here"
>> +# label.
>> +
>> +proc rerun_to_main { } {
>> +    global decimal hex
>> +
>> +    if { ![runto_main] } {
>> +	return -1
>> +    }
>> +
>> +    gdb_breakpoint [gdb_get_line_number "break-here"]
>> +
>> +    gdb_test "continue" "Breakpoint $decimal, main \\\(argc=1,
>> argv=$hex\\\) at.*" \
>> +	"continue until breakpoint"
>> +}
>
> Hi Sergio,

Hey Simon,

I'm back from vacation, sorry about the delay in replying these
messages.

> I just noticed something out of pure coincidence.  I noticed some TCL
> backtraces when running the testsuite that I hadn't seen before, such
> as:
>
> ERROR: tcl error sourcing
> /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.base/sigbpt.exp.
> ERROR: undefined tag "break-here"
>     while executing
> "error "undefined tag \"$text\"""
>     (procedure "gdb_get_line_number" line 36)
>     invoked from within
> "gdb_get_line_number "break-here""
>     (procedure "rerun_to_main" line 8)
>     invoked from within
> "rerun_to_main"
>     (procedure "stepi_out" line 10)
>     invoked from within
> "stepi_out "stepi""
>     (file
> "/home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.base/sigbpt.exp"
> line 256)
>     invoked from within
> "source
> /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.base/sigbpt.exp"
>     ("uplevel" body line 1)
>     invoked from within
> "uplevel #0 source
> /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.base/sigbpt.exp"
>     invoked from within
> "catch "uplevel #0 source $test_file_name""
>
> It turns out I had your test file (share-env-with-gdbserver.exp) still
> lying around in my repo.  The procedure defined above (rerun_to_main)
> overrides one with the same name defined in lib/gdb.exp, breaking the
> tests executed after, that use this proc.

Ops.  I'll redefine the proc and use another name.  Thanks for catching
that.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]