[lldb-dev] [Bug 30251] New: ioctl for request TIOCGWINSZ on STDOUT_FILENO not working on OS X

via lldb-dev lldb-dev at lists.llvm.org
Thu Sep 1 20:02:36 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30251

            Bug ID: 30251
           Summary: ioctl for request TIOCGWINSZ on STDOUT_FILENO not
                    working on OS X
           Product: lldb
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: 617283945a at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

When debugging a process in LLDB using the ``process launch -c /bin/sh'', using
ioctl with request TIOCGWINSZ on STDOUT_FILENO always gives the width and
height of the window as zero and zero.

Test program:

#include <unistd.h>
#include <sys/ioctl.h>
#include <stdio.h>

void main(){
    struct winsize tty_window_size;

    ioctl(STDOUT_FILENO, TIOCGWINSZ, &tty_window_size);

    printf("Rows: %i, Cols: %i\n", tty_window_size.ws_row,
tty_window_size.ws_col);
}

When run from terminal:

$ ./test_ioctl
Rows: 24, Cols: 80
$ lldb -v
lldb-320.4.156
$ lldb ./test_ioctl
(lldb) target create "./a.out"
(lldb) process launch -c /bin/sh
Rows: 0, Cols: 0
(lldb) q

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160902/7709bce1/attachment.html>


More information about the lldb-dev mailing list