This is the mail archive of the 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] Fixup gdb.python/py-value.exp for bare-metal aarch64-elf

On 10/11/2016 09:55 PM, Luis Machado wrote:
> +  set argc_value [get_integer_valueof "argc" 0]
>    gdb_test "python argc_lazy = gdb.parse_and_eval('argc')"
>    gdb_test "python argc_notlazy = gdb.parse_and_eval('argc')"
>    gdb_test "python argc_notlazy.fetch_lazy()"
>    gdb_test "python print (argc_lazy.is_lazy)" "True"
>    gdb_test "python print (argc_notlazy.is_lazy)" "False"
> -  gdb_test "print argc" " = 1" "sanity check argc"
> +  gdb_test "print argc" " = $argc_value" "sanity check argc"
>    gdb_test "python print (argc_lazy.is_lazy)" "\r\nTrue"
>    gdb_test_no_output "set argc=2"

Pedantically, $argc_value could be 2, so this would be better
something like

   gdb_test_no_output "set argc=[expr $argc_value + 1]" "change argc"

> -  gdb_test "python print (argc_notlazy)" "\r\n1"
> +  gdb_test "python print (argc_notlazy)" "\r\n$argc_value"

>    gdb_test "python print (argc_lazy)" "\r\n2"


>    gdb_test "python print (argc_lazy.is_lazy)" "False"

Pedro Alves

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