Skip to content

Allow empty names for non-struct/union types #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/JsDbg.Gdb/JsDbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def FormatType(symbol_type):
# (This is only an issue with clang,
# https://bugs.llvm.org/show_bug.cgi?id=43054)
stripped = symbol_type.strip_typedefs()
if stripped.name:
if stripped.name or (stripped.code != gdb.TYPE_CODE_STRUCT and
stripped.code != gdb.TYPE_CODE_UNION):
t = stripped
else:
t = symbol_type
Expand Down
6 changes: 6 additions & 0 deletions server/JsDbg.Gdb/testsuite/jsdbg.tests/basic.exp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ expect $gdb_prompt
send "run\n"
expect $gdb_prompt

# Some tests for FormatType
send "python print(JsDbg.FormatType(gdb.lookup_type('IntPointer')))\n"
test "int \\\*" "Test that we strip typedefs from pointer types"
expect $gdb_prompt

# Tests for the IDebugger implementation
send "python print(JsDbg.LookupGlobalSymbol('test_program', 'global_var'))\n"
test "{int#$decimal}" "LookupGlobalSymbol"
regexp $decimal $match pointer
Expand Down
3 changes: 3 additions & 0 deletions server/JsDbg.Gdb/testsuite/test_program.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
int global_var = 42;

typedef int* IntPointer;
IntPointer ip;

class Base {
int base_member_;
};
Expand Down