TUI build failure and SEG fault

Joshua Neuheisel jneuheisel@msn.com
Wed Dec 24 14:43:00 GMT 2003


First time patch to gdb...
This simple patch fixes PR 1460 (gdb fails to build with --enable-tui) as
well as a NULL pointer dereference (type 'display' in TUI mode).
Joshua


Index: gdb/ChangeLog
from Joshua Neuheisel  jneuheisel@msn.com

    * printcmd.c (display_command): NULL pointer check in TUI mode.

Index: gdb/tui/ChangeLog
from Joshua Neuheisel  jneheisel@msn.com

    * tuiSourceWin.c (tui_update_breakpoint_info): Use updated breakpoint
struct.

Index: gdb/printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.69
diff -c -p -r1.69 printcmd.c
*** gdb/printcmd.c 21 Sep 2003 01:26:45 -0000 1.69
--- gdb/printcmd.c 24 Dec 2003 14:19:10 -0000
*************** display_command (char *exp, int from_tty
*** 1355,1361 ****
  #if defined(TUI)
    /* NOTE: cagney/2003-02-13 The `tui_active' was previously
       `tui_version'.  */
!   if (tui_active && *exp == '$')
      display_it = (tui_set_layout (exp) == TUI_FAILURE);
  #endif

--- 1355,1361 ----
  #if defined(TUI)
    /* NOTE: cagney/2003-02-13 The `tui_active' was previously
       `tui_version'.  */
!   if (tui_active && exp && *exp == '$')
      display_it = (tui_set_layout (exp) == TUI_FAILURE);
  #endif

Index: gdb/tui/tuiSourceWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.c,v
retrieving revision 1.25
diff -c -p -r1.25 tuiSourceWin.c
*** gdb/tui/tuiSourceWin.c 22 Jun 2003 15:21:39 -0000 1.25
--- gdb/tui/tuiSourceWin.c 24 Dec 2003 14:19:10 -0000
*************** tui_update_breakpoint_info (TuiWinInfoPt
*** 455,461 ****
                 && (strcmp (src->filename, bp->source_file) == 0)
                 && bp->line_number == line->lineOrAddr.lineNo)
                || (win == disassemWin
!                   && bp->address == line->lineOrAddr.addr))
              {
                if (bp->enable_state == bp_disabled)
                  mode |= TUI_BP_DISABLED;
--- 455,461 ----
                 && (strcmp (src->filename, bp->source_file) == 0)
                 && bp->line_number == line->lineOrAddr.lineNo)
                || (win == disassemWin
!                   && bp->loc->address == line->lineOrAddr.addr))
              {
                if (bp->enable_state == bp_disabled)
                  mode |= TUI_BP_DISABLED;



More information about the Gdb-patches mailing list