mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
lldb: Show encoding of String [ci skip]
This commit is contained in:
parent
8bdaaeb99a
commit
545e01645f
3 changed files with 5 additions and 0 deletions
|
@ -3457,6 +3457,7 @@ debug.$(OBJEXT): {$(VPATH)}config.h
|
|||
debug.$(OBJEXT): {$(VPATH)}debug.c
|
||||
debug.$(OBJEXT): {$(VPATH)}debug_counter.h
|
||||
debug.$(OBJEXT): {$(VPATH)}defines.h
|
||||
debug.$(OBJEXT): {$(VPATH)}encindex.h
|
||||
debug.$(OBJEXT): {$(VPATH)}encoding.h
|
||||
debug.$(OBJEXT): {$(VPATH)}eval_intern.h
|
||||
debug.$(OBJEXT): {$(VPATH)}gc.h
|
||||
|
|
2
debug.c
2
debug.c
|
@ -14,6 +14,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include "eval_intern.h"
|
||||
#include "encindex.h"
|
||||
#include "id.h"
|
||||
#include "internal/signal.h"
|
||||
#include "ruby/encoding.h"
|
||||
|
@ -50,6 +51,7 @@ const union {
|
|||
enum ruby_coderange_type enc_coderange_types;
|
||||
enum ruby_econv_flag_type econv_flag_types;
|
||||
rb_econv_result_t econv_result;
|
||||
enum ruby_preserved_encindex encoding_index;
|
||||
enum ruby_robject_flags robject_flags;
|
||||
enum ruby_robject_consts robject_consts;
|
||||
enum ruby_rmodule_flags rmodule_flags;
|
||||
|
|
|
@ -287,6 +287,8 @@ def lldb_inspect(debugger, target, result, val):
|
|||
append_command_output(debugger, "print *(struct RClass*)%0#x" % val.GetValueAsUnsigned(), result)
|
||||
elif flType == RUBY_T_STRING:
|
||||
result.write('T_STRING: %s' % flaginfo)
|
||||
encidx = ((flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)
|
||||
result.write('[%s] ' % target.FindFirstType("enum ruby_preserved_encindex").GetEnumMembers().GetTypeEnumMemberAtIndex(encidx).GetName()[14:])
|
||||
tRString = target.FindFirstType("struct RString").GetPointerType()
|
||||
ptr, len = string2cstr(val.Cast(tRString))
|
||||
if len == 0:
|
||||
|
|
Loading…
Reference in a new issue