aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Domani <ssbssa@yahoo.de>2021-05-25 17:18:55 +0200
committerHannes Domani <ssbssa@yahoo.de>2021-06-03 14:56:55 +0200
commit6ac5237cf17d299491294359818baab522be5a42 (patch)
treeb967b240166b11b734ca61b8d9dd5528f4f36b43
parentbbd47c1230b3fbc25e6292ea3f2f5d275d4d459a (diff)
downloadfsf-binutils-gdb-6ac5237cf17d299491294359818baab522be5a42.zip
fsf-binutils-gdb-6ac5237cf17d299491294359818baab522be5a42.tar.gz
fsf-binutils-gdb-6ac5237cf17d299491294359818baab522be5a42.tar.bz2
Restore gdb.SYMBOL_LABEL_DOMAIN constant
It was removed (probably by mistake) in 51e78fc5fa21870d415c52f90b93e3c6ad57be46. gdb/ChangeLog: 2021-06-03 Hannes Domani <ssbssa@yahoo.de> * python/py-symbol.c (gdbpy_initialize_symbols): Restore gdb.SYMBOL_LABEL_DOMAIN constant. gdb/testsuite/ChangeLog: 2021-06-03 Hannes Domani <ssbssa@yahoo.de> * gdb.python/py-symbol.exp: Test symbol constants.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/py-symbol.c2
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.python/py-symbol.exp48
4 files changed, 59 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6e5e88f..60c2948 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-03 Hannes Domani <ssbssa@yahoo.de>
+
+ * python/py-symbol.c (gdbpy_initialize_symbols): Restore
+ gdb.SYMBOL_LABEL_DOMAIN constant.
+
2021-06-01 John Baldwin <jhb@FreeBSD.org>
* infrun.c (handle_inferior_event): Only call
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 8953ee0..d44b55e 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -673,6 +673,8 @@ gdbpy_initialize_symbols (void)
VAR_DOMAIN) < 0
|| PyModule_AddIntConstant (gdb_module, "SYMBOL_STRUCT_DOMAIN",
STRUCT_DOMAIN) < 0
+ || PyModule_AddIntConstant (gdb_module, "SYMBOL_LABEL_DOMAIN",
+ LABEL_DOMAIN) < 0
|| PyModule_AddIntConstant (gdb_module, "SYMBOL_MODULE_DOMAIN",
MODULE_DOMAIN) < 0
|| PyModule_AddIntConstant (gdb_module, "SYMBOL_COMMON_BLOCK_DOMAIN",
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7959f58..642c18c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-03 Hannes Domani <ssbssa@yahoo.de>
+
+ * gdb.python/py-symbol.exp: Test symbol constants.
+
2021-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* gdb.dwarf2/per-bfd-sharing.exp: Fix temp-dir leakage.
diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index 341a8fc..41b583c 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -255,3 +255,51 @@ delete_breakpoints
gdb_unload
gdb_test "python print (a\[0\].is_valid())" "False" "test symbol non-validity"
gdb_test_no_output "python a = None" "test symbol destructor"
+
+# Test gdb.Symbol domain categories
+gdb_test "python print gdb.SYMBOL_UNDEF_DOMAIN" \
+ "0" "test gdb.SYMBOL_UNDEF_DOMAIN"
+gdb_test "python print gdb.SYMBOL_VAR_DOMAIN" \
+ "1" "test gdb.SYMBOL_VAR_DOMAIN"
+gdb_test "python print gdb.SYMBOL_STRUCT_DOMAIN" \
+ "2" "test gdb.SYMBOL_STRUCT_DOMAIN"
+gdb_test "python print gdb.SYMBOL_MODULE_DOMAIN" \
+ "3" "test gdb.SYMBOL_MODULE_DOMAIN"
+gdb_test "python print gdb.SYMBOL_LABEL_DOMAIN" \
+ "4" "test gdb.SYMBOL_LABEL_DOMAIN"
+gdb_test "python print gdb.SYMBOL_COMMON_BLOCK_DOMAIN" \
+ "5" "test gdb.SYMBOL_COMMON_BLOCK_DOMAIN"
+
+# Test gdb.Symbol address class categories
+gdb_test "python print gdb.SYMBOL_LOC_UNDEF" \
+ "0" "test gdb.SYMBOL_LOC_UNDEF"
+gdb_test "python print gdb.SYMBOL_LOC_CONST" \
+ "1" "test gdb.SYMBOL_LOC_CONST"
+gdb_test "python print gdb.SYMBOL_LOC_STATIC" \
+ "2" "test gdb.SYMBOL_LOC_STATIC"
+gdb_test "python print gdb.SYMBOL_LOC_REGISTER" \
+ "3" "test gdb.SYMBOL_LOC_REGISTER"
+gdb_test "python print gdb.SYMBOL_LOC_ARG" \
+ "4" "test gdb.SYMBOL_LOC_ARG"
+gdb_test "python print gdb.SYMBOL_LOC_REF_ARG" \
+ "5" "test gdb.SYMBOL_LOC_REF_ARG"
+gdb_test "python print gdb.SYMBOL_LOC_REGPARM_ADDR" \
+ "6" "test gdb.SYMBOL_LOC_REGPARM_ADDR"
+gdb_test "python print gdb.SYMBOL_LOC_LOCAL" \
+ "7" "test gdb.SYMBOL_LOC_LOCAL"
+gdb_test "python print gdb.SYMBOL_LOC_TYPEDEF" \
+ "8" "test gdb.SYMBOL_LOC_TYPEDEF"
+gdb_test "python print gdb.SYMBOL_LOC_LABEL" \
+ "9" "test gdb.SYMBOL_LOC_LABEL"
+gdb_test "python print gdb.SYMBOL_LOC_BLOCK" \
+ "10" "test gdb.SYMBOL_LOC_BLOCK"
+gdb_test "python print gdb.SYMBOL_LOC_CONST_BYTES" \
+ "11" "test gdb.SYMBOL_LOC_CONST_BYTES"
+gdb_test "python print gdb.SYMBOL_LOC_UNRESOLVED" \
+ "12" "test gdb.SYMBOL_LOC_UNRESOLVED"
+gdb_test "python print gdb.SYMBOL_LOC_OPTIMIZED_OUT" \
+ "13" "test gdb.SYMBOL_LOC_OPTIMIZED_OUT"
+gdb_test "python print gdb.SYMBOL_LOC_COMPUTED" \
+ "14" "test gdb.SYMBOL_LOC_COMPUTED"
+gdb_test "python print gdb.SYMBOL_LOC_COMMON_BLOCK" \
+ "15" "test gdb.SYMBOL_LOC_COMMON_BLOCK"