Any non-split 'print' functions available?

128 views
Skip to first unread message

Xiangdong JI

unread,
Oct 31, 2019, 8:10:05 AM10/31/19
to golang-nuts
seeking utilities for diagnosing some 'nosplit' runtime functions. Thanks a lot.

Ian Lance Taylor

unread,
Nov 1, 2019, 2:00:04 AM11/1/19
to Xiangdong JI, golang-nuts
On Thu, Oct 31, 2019 at 5:10 AM Xiangdong JI <xiangd...@arm.com> wrote:
>
> seeking utilities for diagnosing some 'nosplit' runtime functions. Thanks a lot.

b := []byte("my debug message\n")
write1(2, &b[0], len(b))

Ian

Xiangdong JI

unread,
Nov 1, 2019, 2:43:37 AM11/1/19
to golang-nuts
Thanks Ian, having difficulty figuring out how to print a pointer using write1, could you please shed a light? Thanks.

On Friday, November 1, 2019 at 2:00:04 PM UTC+8, Ian Lance Taylor wrote:

Ian Lance Taylor

unread,
Nov 1, 2019, 9:56:13 AM11/1/19
to Xiangdong JI, golang-nuts
On Thu, Oct 31, 2019 at 11:44 PM Xiangdong JI <xiangd...@arm.com> wrote:
>
> Thanks Ian, having difficulty figuring out how to print a pointer using write1, could you please shed a light? Thanks.

You have to do something like (untested)

var buf [20]byte
b := itoa(buf[:], uint64(uintptr(ptrToPrint)))
write1(2, &b[0], len(b))

Ian

> On Friday, November 1, 2019 at 2:00:04 PM UTC+8, Ian Lance Taylor wrote:
>>
>> On Thu, Oct 31, 2019 at 5:10 AM Xiangdong JI <xiang...@arm.com> wrote:
>> >
>> > seeking utilities for diagnosing some 'nosplit' runtime functions. Thanks a lot.
>>
>> b := []byte("my debug message\n")
>> write1(2, &b[0], len(b))
>>
>> Ian
>
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d097f1f1-7127-49d3-834c-e22c8b7ecb26%40googlegroups.com.

Aram Hăvărneanu

unread,
Nov 1, 2019, 7:20:51 PM11/1/19
to Ian Lance Taylor, Xiangdong JI, golang-nuts
For this type of thing I'd recommend a debugger.

--
Aram Hăvărneanu
Reply all
Reply to author
Forward
0 new messages