Skip to content
This repository has been archived by the owner on Jul 4, 2021. It is now read-only.

Commit

Permalink
Minor improvements to std::string viewer.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 7, 2008
1 parent 42e33be commit fe80ab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dataplugin_tests/std_str/stdstr.cpp
Expand Up @@ -4,7 +4,8 @@ int main(void)
{
std::string x("Hello, world!");
std::string y("blah blah blah");
return (strlen(x.c_str()) != strlen(y.c_str())) ? 0 : 1;
std::wstring z(L"This is a wide string.");
return (wcslen(z.c_str()) != (strlen(x.c_str()) + strlen(y.c_str()))) ? 0 : 1;
}

/* end of viewstdstr.cpp ... */
Expand Down
4 changes: 2 additions & 2 deletions dataplugin_tests/std_str/viewstdstr.cpp
Expand Up @@ -17,7 +17,7 @@ static void view_std_string(const void *ptr, const GDB_dataplugin_funcs *funcs)
if (cstr == 0)
return;

funcs->print("(const char *) \"%s\"\n", cstr);
funcs->print("(std::string) \"%s\"\n", cstr);
funcs->freemem(cstr);
}

Expand All @@ -33,7 +33,7 @@ static void view_std_wstring(const void *ptr, const GDB_dataplugin_funcs *funcs)
if (wcstr == 0)
return;

funcs->print("(const wchar_t *) \"%ls\"\n", wcstr);
funcs->print("(std::wstring) L\"%ls\"\n", wcstr);
funcs->freemem(wcstr);
}

Expand Down

0 comments on commit fe80ab3

Please sign in to comment.