public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/14396] New: Missing DW_ATE_UTF support (char16_t, char32_t)
@ 2012-07-24 22:26 mjw at redhat dot com
  2012-07-24 22:39 ` [Bug translator/14396] " jistone at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mjw at redhat dot com @ 2012-07-24 22:26 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14396

             Bug #: 14396
           Summary: Missing DW_ATE_UTF support (char16_t, char32_t)
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: mjw@redhat.com
    Classification: Unclassified


elfutils dwarf.h was missing the new DWARF4 DW_ATE_UTF define.
So systemtap also doesn't support this this data encoding.

Example usage:

#include <string.h>

const char *foo = "cow";
const char16_t *bar = u"bear";

int
main ()
{
  if (foo == "bear" && bar == u"cow")
    return 42;

  return 0;
}

$ g++ -g -std=c++0x -o utf utf.cxx

$ stap -e 'probe process.function("main") { log($foo$$); log($bar$$) }' -c
./utf
"cow"
4195852

Would be nice to see the $bar value also decoded.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/14396] Missing DW_ATE_UTF support (char16_t, char32_t)
  2012-07-24 22:26 [Bug translator/14396] New: Missing DW_ATE_UTF support (char16_t, char32_t) mjw at redhat dot com
@ 2012-07-24 22:39 ` jistone at redhat dot com
  2012-08-10  0:56 ` jistone at redhat dot com
  2012-08-11  1:04 ` jistone at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2012-07-24 22:39 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14396

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jistone at redhat dot com

--- Comment #1 from Josh Stone <jistone at redhat dot com> 2012-07-24 22:39:36 UTC ---
(In reply to comment #0)
> $ stap -e 'probe process.function("main") { log($foo$$); log($bar$$) }' -c
> ./utf
> "cow"
> 4195852
> 
> Would be nice to see the $bar value also decoded.

dwarf_pretty_print::print_chars() uses user_string2/kernel_string2 to read
strings bytewise.  We could add similar functions for UTF-16 and UTF-32 which
convert to UTF-8 to make stap strings.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/14396] Missing DW_ATE_UTF support (char16_t, char32_t)
  2012-07-24 22:26 [Bug translator/14396] New: Missing DW_ATE_UTF support (char16_t, char32_t) mjw at redhat dot com
  2012-07-24 22:39 ` [Bug translator/14396] " jistone at redhat dot com
@ 2012-08-10  0:56 ` jistone at redhat dot com
  2012-08-11  1:04 ` jistone at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2012-08-10  0:56 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14396

--- Comment #2 from Josh Stone <jistone at redhat dot com> 2012-08-10 00:56:21 UTC ---
Created attachment 6570
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6570
Add kernel_string_utf16/32

Here's a prototype of what those conversion functions might look like for
kernel memory.  The user variants would be the same, just s/kread/uread/.

(And now I see that uread() doesn't exist, but it should...)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/14396] Missing DW_ATE_UTF support (char16_t, char32_t)
  2012-07-24 22:26 [Bug translator/14396] New: Missing DW_ATE_UTF support (char16_t, char32_t) mjw at redhat dot com
  2012-07-24 22:39 ` [Bug translator/14396] " jistone at redhat dot com
  2012-08-10  0:56 ` jistone at redhat dot com
@ 2012-08-11  1:04 ` jistone at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2012-08-11  1:04 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14396

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Josh Stone <jistone at redhat dot com> 2012-08-11 01:04:22 UTC ---
15ceae2 loc2c-runtime.h: Add uread() and uwrite()
8987b30 PR14396: Add UTF-16/32 conversion functions
6561d8d PR14396: Add pretty-printing support for UTF

$ stap -e 'probe process.function("main") { log($foo$); log($bar$) }' -c ./utf
"cow"
"bear"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-11  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 22:26 [Bug translator/14396] New: Missing DW_ATE_UTF support (char16_t, char32_t) mjw at redhat dot com
2012-07-24 22:39 ` [Bug translator/14396] " jistone at redhat dot com
2012-08-10  0:56 ` jistone at redhat dot com
2012-08-11  1:04 ` jistone at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).