Skip to content

Commit

Permalink
Merge pull request #4494 from MartinNowak/fix14225
Browse files Browse the repository at this point in the history
fix Issue 14225 - GDB: error reading variable (string + dup)
  • Loading branch information
WalterBright committed Mar 14, 2015
2 parents 2d6fc0e + c89d666 commit 7cb0b4f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/backend/dwarf.c
Expand Up @@ -1581,15 +1581,13 @@ unsigned dwarf_typidx(type *t)
{
DW_TAG_pointer_type,
0, // no children
DW_AT_byte_size, DW_FORM_data1,
DW_AT_type, DW_FORM_ref4,
0, 0,
};
static unsigned char abbrevTypePointerVoid[] =
{
DW_TAG_pointer_type,
0, // no children
DW_AT_byte_size, DW_FORM_data1,
0, 0,
};
#ifdef USE_DWARF_D_EXTENSIONS
Expand Down Expand Up @@ -1715,7 +1713,6 @@ unsigned dwarf_typidx(type *t)
: dwarf_abbrev_code(abbrevTypePointerVoid, sizeof(abbrevTypePointerVoid));
idx = infobuf->size();
infobuf->writeuLEB128(code); // abbreviation code
infobuf->writeByte(tysize(t->Tty)); // DW_AT_byte_size
if (nextidx)
infobuf->write32(nextidx); // DW_AT_type
break;
Expand Down
18 changes: 18 additions & 0 deletions test/runnable/gdb14225.d
@@ -0,0 +1,18 @@
/*
REQUIRED_ARGS: -g
PERMUTE_ARGS:
GDB_SCRIPT:
---
b 17
r
echo RESULT=
p lok
---
GDB_MATCH: RESULT=.*Something
*/
void main()
{
string lok = "Something";
auto chars = "Anything".dup;
// BP
}

0 comments on commit 7cb0b4f

Please sign in to comment.