forked from tromey/gdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PR python/19438, PR python/18393 - initialize dictionaries
This fixes PR python/19438 and PR python/18393. Both bugs are about invoking dir() on some Python object implemented by gdb, and getting a crash. The crash happens because the dictionary field of these objects was not initialized. Apparently what happens is that this field can be lazily initialized by Python when assigning to an attribute; and it can also be handled ok when using dir() but without __dict__ defined; but gdb defines __dict__ because this isn't supplied automatically by Python. The docs on this seem rather sparse, but this patch works ok. An alternative might be to lazily create the dictionary in gdb_py_generic_dict, but I went with this approach because it seemed more straightforward. Built and regtested on x86-64 Fedora 23. 2016-05-23 Tom Tromey <[email protected]> PR python/19438, PR python/18393: * python/py-objfile.c (objfpy_initialize): Initialize self->dict. * python/py-progspace.c (pspy_initialize): Initialize self->dict. 2016-05-23 Tom Tromey <[email protected]> PR python/19438, PR python/18393: * gdb.python/py-progspace.exp: Add "dir" test. * gdb.python/py-objfile.exp: Add "dir" test.
- Loading branch information
Showing
6 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
2016-05-23 Tom Tromey <[email protected]> | ||
|
||
PR python/19438, PR python/18393: | ||
* python/py-objfile.c (objfpy_initialize): Initialize self->dict. | ||
* python/py-progspace.c (pspy_initialize): Initialize self->dict. | ||
|
||
2016-05-23 Gary Benson <[email protected]> | ||
|
||
* nat/gdb_thread_db.h (td_thr_validate_ftype): Remove typedef. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
2016-05-23 Tom Tromey <[email protected]> | ||
|
||
PR python/19438, PR python/18393: | ||
* gdb.python/py-progspace.exp: Add "dir" test. | ||
* gdb.python/py-objfile.exp: Add "dir" test. | ||
|
||
2016-05-23 Yao Qi <[email protected]> | ||
|
||
* gdb.arch/thumb-prologue.exp: Use standard_testfile. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters