Skip to content

Instantly share code, notes, and snippets.

@GrooveStomp
Created July 26, 2016 16:58
Show Gist options
  • Save GrooveStomp/1ad5b0029cbbcfb18f4c5043fe2f58d4 to your computer and use it in GitHub Desktop.
Save GrooveStomp/1ad5b0029cbbcfb18f4c5043fe2f58d4 to your computer and use it in GitHub Desktop.
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-slitaz-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/aaron/code/dvtm/dvtm...done.
(gdb) run
Starting program: /home/aaron/code/dvtm/dvtm
[?7h[?1000h[?25l[?1c[1][2][3][4][5][]=[][?25h[?0c
Program received signal SIGSEGV, Segmentation fault.
0x0804e96a in main (argc=1, argv=0xbffffd24) at dvtm.c:1764
1764 FD_SET(pty, &rd);
(gdb) list
1759 destroy(c);
1760 c = t;
1761 continue;
1762 }
1763 int pty = c->editor ? vt_pty_get(c->editor) : vt_pty_get(c->app);
1764 FD_SET(pty, &rd);
1765 nfds = MAX(nfds, pty);
1766 c = c->next;
1767 }
1768
(gdb) print c->editor
$1 = (Vt *) 0x0
(gdb) print c->app
$2 = (Vt *) 0x80a4238
(gdb) break 1763
Breakpoint 1 at 0x804e931: file dvtm.c, line 1763.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n)
Starting program: /home/aaron/code/dvtm/dvtm
[?7h[?1000h[?25l[?1c[1][2][3][4][5][]=[][?25h[?0c
Breakpoint 1, main (argc=1, argv=0xbffffd24) at dvtm.c:1763
1763 int pty = c->editor ? vt_pty_get(c->editor) : vt_pty_get(c->app);
(gdb) step
vt_pty_get (t=0x80a4238) at vt.c:1658
1658 return t->pty;
(gdb) list 1658
1653 return t->pid = pid;
1654 }
1655
1656 int vt_pty_get(Vt *t)
1657 {
1658 return t->pty;
1659 }
1660
1661 ssize_t vt_write(Vt *t, const char *buf, size_t len)
1662 {
(gdb) print t
$3 = (Vt *) 0x80a4238
(gdb) pty ttype t
type = struct Vt {
Buffer buffer_normal;
Buffer buffer_alternate;
Buffer *buffer;
attr_t defattrs;
short int deffg;
short int defbg;
int pty;
pid_t pid;
unsigned int seen_input : 1;
unsigned int insert : 1;
unsigned int escaped : 1;
unsigned int curshid : 1;
unsigned int curskeymode : 1;
unsigned int bell : 1;
unsigned int relposmode : 1;
unsigned int mousetrack : 1;
unsigned int graphmode : 1;
unsigned int savgraphmode : 1;
_Bool charsets[2];
char rbuf[8192];
char ebuf[8192];
unsigned int rlen;
unsigned int elen;
int srow;
int scol;
char title[256];
vt_title_handler_t title_handler;
vt_urgent_handler_t urgent_handler;
void *data;
} *
(gdb) print t->pty
$4 = -1
(gdb) liframe
#0 vt_pty_get (t=0x80a4238) at vt.c:1658
1658 return t->pty;
(gdb) list 1658
1653 return t->pid = pid;
1654 }
1655
1656 int vt_pty_get(Vt *t)
1657 {
1658 return t->pty;
1659 }
1660
1661 ssize_t vt_write(Vt *t, const char *buf, size_t len)
1662 {
(gdb) q
A debugging session is active.
Inferior 1 [process 1293] will be killed.
Quit anyway? (y or n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment