This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Implement the ability to set/unset environment variables to GDBserver when starting the inferior
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, Eli Zaretskii <eliz at gnu dot org>
- Date: Mon, 07 Aug 2017 11:29:54 +0200
- Subject: Re: [PATCH v2] Implement the ability to set/unset environment variables to GDBserver when starting the inferior
- Authentication-results: sourceware.org; auth=none
- References: <20170629194106.23070-1-sergiodj@redhat.com> <20170727033531.23066-1-sergiodj@redhat.com>
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,
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.
Simon