1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

wafsamba: Normalize strings in gdb output when comparing ABI

This fixes an issue with gdb >= 13:

libndr.so: symbol ndr_transfer_syntax_ndr64 has changed
    old_signature: uuid = {
        time_low = 1903232307,
        time_mid = 48826,
        time_hi_and_version = 18743,
        clock_seq = "\203\031",
        node = "\265\333\357\234\314\066"
    }, if_version = 1

    new_signature: uuid = {
        time_low = 1903232307,
        time_mid = 48826,
        time_hi_and_version = 18743,
        clock_seq = "\203\031",
        node = "\265\333\357\234\3146"
    }, if_version = 1

\314\066 and \3146 are the same as \066 translates into the char '6'. In order
to address this we should do byte comparison in python.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Alexander Bokovoy <ab@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Alexander Bokovoy 2023-04-24 14:29:49 +02:00 committed by Andreas Schneider
parent b5e9c2bc0e
commit 60f9396a7d

View File

@ -42,7 +42,8 @@ def normalise_signature(sig):
def normalise_varargs(sig): def normalise_varargs(sig):
'''cope with older versions of gdb''' '''cope with older versions of gdb'''
sig = re.sub(r',\s\.\.\.', '', sig) sig = re.sub(r',\s\.\.\.', '', sig)
return sig # Make sure we compare bytes and not strings
return bytes(sig, encoding='utf-8').decode('unicode_escape')
def parse_sigs(sigs, abi_match): def parse_sigs(sigs, abi_match):