File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,8 @@ def render_element(i):
290290
291291
292292def read_utf8_string (ptr_val , byte_count ):
293+ if byte_count == 0 :
294+ return '""'
293295 error = lldb .SBError ()
294296 process = ptr_val .get_wrapped_value ().GetProcess ()
295297 data = process .ReadMemory (ptr_val .as_integer (), byte_count , error )
Original file line number Diff line number Diff line change 1+ // compile-flags:-g
2+ // min-gdb-version: 7.7
3+ // min-lldb-version: 310
4+
5+ // === GDB TESTS ===================================================================================
6+
7+ // gdb-command: run
8+
9+ // gdb-command: print empty_string
10+ // gdb-check:$1 = ""
11+
12+ // gdb-command: print empty_str
13+ // gdb-check:$2 = ""
14+
15+ // === LLDB TESTS ==================================================================================
16+
17+ // lldb-command: run
18+
19+ // lldb-command: fr v empty_string
20+ // lldb-check:[...]empty_string = ""
21+
22+ // lldb-command: fr v empty_str
23+ // lldb-check:[...]empty_str = ""
24+
25+ fn main ( ) {
26+ let empty_string = String :: new ( ) ;
27+
28+ let empty_str = "" ;
29+
30+ zzz ( ) ; // #break
31+ }
32+
33+ fn zzz ( ) { }
You can’t perform that action at this time.
0 commit comments