зеркало из https://github.com/github/ruby.git
lldb: Show encoding of String [ci skip]
This commit is contained in:
Родитель
8bdaaeb99a
Коммит
545e01645f
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче