Re: [PATCHv2] Restore gdb.SYMBOL_STRUCT_DOMAIN constant

Tom de Vries
2021-06-05T12:27:40Z

On 6/3/21 3:00 PM, Hannes Domani via Gdb-patches wrote:
> Am Mittwoch, 2. Juni 2021, 20:39:58 MESZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:
>
>>>>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>> Hannes> It was removed (probably by mistake) in
>> Hannes> 51e78fc5fa21870d415c52f90b93e3c6ad57be46.
>>
>> Yes, sorry about that.
>>
>> Hannes> gdb/ChangeLog:
>>
>> Hannes> 2021-05-26  Hannes Domani  <ssbssa@yahoo.de>
>>
>> Hannes>     * python/py-symbol.c (gdbpy_initialize_symbols): Restore
>> Hannes>     gdb.SYMBOL_LABEL_DOMAIN constant.
>>
>> Hannes> gdb/testsuite/ChangeLog:
>>
>> Hannes> 2021-05-26  Hannes Domani  <ssbssa@yahoo.de>
>>
>> Hannes>     * gdb.python/py-symbol.exp: Test symbol constants.
>>
>> This is ok.  Thank you.
>>
>> Hannes> +# Test gdb.Symbol domain categories
>> Hannes> +gdb_test "python print gdb.SYMBOL_UNDEF_DOMAIN" \
>> Hannes> +    "0" "test gdb.SYMBOL_UNDEF_DOMAIN"
>> Hannes> +gdb_test "python print gdb.SYMBOL_VAR_DOMAIN" \
>> Hannes> +    "1" "test gdb.SYMBOL_VAR_DOMAIN"
>>
>> While we don't want people to rely on the values of these constants, it
>> seems harmless in the test suite.  If someone changes one, they can just
>> update the test.
>
> Pushed, thanks.

With python 3, I'm running into:
...
(gdb) PASS: gdb.python/py-symbol.exp: test symbol destructor
python print gdb.SYMBOL_UNDEF_DOMAIN^M
File "<string>", line 1^M
print gdb.SYMBOL_UNDEF_DOMAIN^M
^^M
SyntaxError: Missing parentheses in call to 'print'. Did you mean
print(gdb.SYMBOL_UNDEF_DOMAIN)?^M
Error while executing Python code.^M
(gdb) FAIL: gdb.python/py-symbol.exp: test gdb.SYMBOL_UNDEF_DOMAIN
...

Thanks,
- Tom