gdb - how to print result of evaluation for C++ -


Ive was looking around but was unable to figure out how to print in GDB in the outcome of an evaluation is. For example, in the code given below:

  if (strcmp (current_node-> word, min_node- & gt; word) & gt; min_node = current_node;  

(Up I was trying a possible method to check the alphabetical order for stars, and it was not certain that it works properly)

Now I can see min_node and if the value changes but this is sometimes more complex in the inserted code, I was wondering if there is an easy way to see the evaluation of a test on the line, where Currently GDB / Programs Week is.

Many thanks!

There is no expression-level single phase in GDB, if you are asking for it.

Your Options (Typically <<>

>

> It is surprising, this works: GDB can evaluate the function call, by executing the code in the ongoing program and executing the code. Of course, it is quite dangerous If the function can have a bad effect or crash; in this case, it is so harmless that people will not usually think of potential problems.
  • The directional level DBly) Single-step (Ni / C). When call is instructed, you find results in a register according to processor conventions (x86% eax).
  • Variables can be used for intermediate To assign values, edit the code, and split it into separate lines; then use regular single-phase and observe the variable.

  • Comments

    Popular posts from this blog

    asp.net - Javascript/DOM Why is does my form not support submit()? -

    sockets - Delphi: TTcpServer, connection reset when reading -

    javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -