This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3] [PR/24474] Add gdb.lookup_static_symbol to the python API
> diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
> index 5b8a2be7c4..ab72a4cb9d 100644
> --- a/gdb/testsuite/gdb.python/py-symbol.exp
> +++ b/gdb/testsuite/gdb.python/py-symbol.exp
> @@ -48,6 +48,25 @@ gdb_test "python print (gdb.lookup_global_symbol('qq').needs_frame)" \
> "False" \
> "print whether qq needs a frame"
>
> +set rr_line [gdb_get_line_number "line of rr"]
> +gdb_test "python print (gdb.lookup_global_symbol ('rr') is None)" "True" \
> + "lookup_global_symbol for static var"
> +
> +gdb_test "python print (gdb.lookup_static_symbol ('rr').line)" "$rr_line" \
> + "print line number of rr"
> +
> +gdb_test "python print (gdb.lookup_static_symbol ('rr').value ())" "42" \
> + "print value of rr"
> +
> +gdb_test "python print (gdb.lookup_static_symbol ('rr').needs_frame)" \
> + "False" \
> + "print whether rr needs a frame"
> +
> +gdb_test "python print (gdb.lookup_static_symbol ('nonexistant') is None)" \
> + "True" "lookup_static_symbol for nonexistant var"
Ah, just noticed this, "nonexistant" -> "nonexistent".
The patch LGTM with that fixed.
Thanks,
Simon