gdb: fix 'osv thread' to work with GDB with python3

GDB's convert_value_from_python() with python2 was interpreting 'long'
typed value which doesn't fit into 'long long' as 'unsigned long
long'. On python3 we only have 'int' but the function was not adjusted
to replicate 'long' behavior, it throws overflow error if the value
exceeds 'long' range.

The value is converted using that function for example when it is
passed as gdb.Value() argument or when gdb.Value is used as comparison
target:

  if gdb_value == 0xffff000000000000:

The above will fail with:

  OverflowError: Python int too large to convert to C long

because GDB will try to fit the numeric constant on the right into
'long' on python3. As a workaround I convert gdb_value to python like
this:

  if ulong(gdb_value) == 0xffff000000000000:

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gdb: fix 'osv pagetable walk'

gdb.Value() handled 'int' differently than 'long' on python2. When the
value was 'int' GDB tried to fit it in 'long' (signed) whereas when it
was 'long', it tried 'unisgned long long'. On python3 we no longer
have 'long' and gdb.Value will treat python3's int the same way as
python2's int. We relied on being able to put unsigned long numbers
into gdb.Value and it seems there is no way to do that on python3. The
workaround is to use gdb.parse_and_eval() instead of gdb.Value
constructor.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gdb: use parentheses in print

So that it works on GDB with python3.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>