Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [Bug:cli] Loading user-defined function generates an internal error
@ 2009-12-30  5:35 Nick Roberts
  2009-12-30  5:46 ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Roberts @ 2009-12-30  5:35 UTC (permalink / raw)
  To: gdb


If the user-defined function below is put in a file user.cmd, say, then in
internal error is generated upon loading it:

..
(gdb) source user.cmd
utils.c:1206: internal-error: virtual memory exhausted.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
utils.c:1206: internal-error: virtual memory exhausted.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Aborted (core dumped)

This didn't used to happen, say 3 months ago.

-- 
Nick                                           http://users.snap.net.nz/~nickrob


define p_tree

  set $tree = ($arg0)
  set $i = 0
  set $node = $tree->_M_t->_M_impl->_M_header->_M_left
  set $tree_size = $tree->_M_t->_M_impl->_M_node_count

  while ($i < $tree_size)
    set $i++
    printf "NODE %d: ", $i
    set $value = (void *)($node + 1)
    p *($arg1 *)$value
    set $value = $value + 4
    p *($arg2 *)$value

    # Next (bigger) value must be to right...
    if ($node->_M_right != 0)
      set $node = $node->_M_right

      # Descend tree while there is a left node.
      while ($node->_M_left != 0)
        set $node = $node->_M_left
      end

      # ...or further up the tree.
    else
      set $tmp_node = $node->_M_parent

      # Ascend tree while at right node.
      while ($node == $tmp_node->_M_right)
        set $node = $tmp_node
        set $tmp_node = $tmp_node->_M_parent
      end

      # Set to parent of first left node (condition always true?)
      if ($node->_M_right != $tmp_node)
        set $node = $tmp_node
      end
    end
  end
end


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-01-01 11:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-30  5:35 [Bug:cli] Loading user-defined function generates an internal error Nick Roberts
2009-12-30  5:46 ` Joel Brobecker
2009-12-30  8:50   ` Nick Roberts
2009-12-31  6:27     ` Vladimir Prus
2009-12-30 22:26   ` Nick Roberts
2010-01-01  8:41     ` [patch] Fix crash on CLI indented comments [Re: [Bug:cli] Loading user-defined function generates an internal error] Jan Kratochvil
2010-01-01 10:36       ` Joel Brobecker
2010-01-01 11:01         ` Jan Kratochvil
2010-01-01 11:12         ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox