Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:tabraham1:branches:home:jeff_mahoney:crash-python:devel
gdb
0007-py-type-gdbpy_lookup_type-accept-None-as-N...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0007-py-type-gdbpy_lookup_type-accept-None-as-NULL.patch of Package gdb
From abfd788a55c469170bf85c1f72305ce8ced189b9 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney <jeffm@suse.com> Date: Sat, 13 Apr 2019 23:01:52 -0400 Subject: [PATCH 07/17] py-type: gdbpy_lookup_type accept None as NULL gdb.lookup_type already handles an absent block parameter as NULL. It should also accept None as NULL, allowing callers to avoid jumping through hoops to make unqualified lookups in a generic way. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- gdb/doc/python.texi | 4 ++-- gdb/python/py-type.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index a5012b0ca0d..0b3391e28d7 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -1181,8 +1181,8 @@ module: @defun gdb.lookup_type (name @r{[}, block@r{]}) This function looks up a type by its @var{name}, which must be a string. -If @var{block} is given, then @var{name} is looked up in that scope. -Otherwise, it is searched for globally. +If @var{block} is given as a @code{gdb.Block}, then @var{name} is looked up in that scope. Otherwise, if it is absent or is @code{None}, it is +searched for globally. Ordinarily, this function will return an instance of @code{gdb.Type}. If the named type cannot be found, it will throw an exception. diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 7be3f3276c2..58d53f4429d 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -1449,7 +1449,7 @@ gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw) &type_name, &block_obj)) return NULL; - if (block_obj) + if (block_obj && block_obj != Py_None) { block = block_object_to_block (block_obj); if (! block) -- 2.37.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor