Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [PATCH: gdb/mi] -stack-list-locals testcase
@ 2004-01-06  1:12 Michael Elizabeth Chastain
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-06  1:12 UTC (permalink / raw)
  To: cagney, nick; +Cc: gdb-patches

Line number differences say that gdb stopped on a different line.
Sometimes this is legal gdb behavior, and sometimes it indicates
a problem in gdb or in the debug output of gcc or in the interface
between the two.

Someone has to look closely at the gdb.log and decide which line
number(s) are legal to stop on.  If gdb stops on a different line
number than it's supposed to, that is a bug, and it gets a FAIL
or a KFAIL or an XFAIL.

Michael C


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH: gdb/mi] -stack-list-locals testcase
@ 2004-01-07 21:06 Michael Elizabeth Chastain
  2004-01-07 23:47 ` Nick Roberts
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-07 21:06 UTC (permalink / raw)
  To: cagney, kettenis; +Cc: gdb-patches, nick

mark> I think it would be useful if Nick could post the output from "objdump
mark> --stabs" on the generated binary.  The output of "gcc -g -S" on the
mark> relevant source file would be even more useful.

Right.  Generally, the name and version of the compiler is essential
information here.  (The compiler used to build the test program,
not the compiler used to build gdb!)

Michael C


^ permalink raw reply	[flat|nested] 8+ messages in thread
* RFC (gdb/mi): -stack-list-locals
@ 2003-11-23  0:16 Nick Roberts
  2003-11-26  0:48 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Roberts @ 2003-11-23  0:16 UTC (permalink / raw)
  To: gdb-patches


Attached is a patch for -stack-list-locals which roughly modifies this command
as I described previously on gdb@sources.redhat.com (Thu, 6 Nov 2003 22:04:22
+0000). It actually does the following:

1) Display the name, type and value for simple data types.
2) Display the name and type for complex data types.

I don't really know what make_cleanup_ui_out_tuple_begin_end and do_cleanups
do and I've approximated a simple data type to something that isn't
TYPE_CODE_ARRAY or TYPE_CODE_STRUCT so it's probably a pretty gross hack.

The idea is that the user can see the value of simple data types immediately
and can create variable objects for complex data types if he wishes to explore
their values in more detail.

Any comments?


    Nick                                         http://www.nick.uklinux.net



*** mi-cmd-stack.c.~1.19.~	2003-06-12 23:29:37.000000000 +0100
--- mi-cmd-stack.c	2003-11-22 23:49:24.000000000 +0000
***************
*** 273,292 ****
  		  make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
  	      ui_out_field_string (uiout, "name", DEPRECATED_SYMBOL_NAME (sym));
  
! 	      if (values)
! 		{
! 		  struct symbol *sym2;
! 		  if (!locals)
! 		    sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
! 					  block, VAR_DOMAIN,
! 					  (int *) NULL,
! 				2	  (struct symtab **) NULL);
! 		  else
  		    sym2 = sym;
  		  print_variable_value (sym2, fi, stb->stream);
  		  ui_out_field_stream (uiout, "value", stb);
- 		  do_cleanups (cleanup_tuple);
  		}
  	    }
  	}
        if (BLOCK_FUNCTION (block))
--- 273,303 ----
  		  make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
  	      ui_out_field_string (uiout, "name", DEPRECATED_SYMBOL_NAME (sym));
  
! 	      struct symbol *sym2;
! 	      if (!locals)
! 		sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
! 				      block, VAR_DOMAIN,
! 				      (int *) NULL,
! 				      (struct symtab **) NULL);
! 	      else
  		    sym2 = sym;
+ 	      if (values == 2)
+ 		{
+ 		  type_print (sym2->type, "", stb->stream, -1);
+ 		  ui_out_field_stream (uiout, "type", stb);
+ 		  if (TYPE_CODE (sym2->type) != TYPE_CODE_ARRAY &&
+ 		      TYPE_CODE (sym2->type) != TYPE_CODE_STRUCT)
+ 		    {
+ 		      print_variable_value (sym2, fi, stb->stream);
+ 		      ui_out_field_stream (uiout, "value", stb);
+ 		    }
+ 		}
+ 	      else if (values)
+ 		{
  		  print_variable_value (sym2, fi, stb->stream);
  		  ui_out_field_stream (uiout, "value", stb);
  		}
+ 	      if (values) do_cleanups (cleanup_tuple);
  	    }
  	}
        if (BLOCK_FUNCTION (block))


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

end of thread, other threads:[~2004-01-07 23:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-06  1:12 [PATCH: gdb/mi] -stack-list-locals testcase Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2004-01-07 21:06 Michael Elizabeth Chastain
2004-01-07 23:47 ` Nick Roberts
2003-11-23  0:16 RFC (gdb/mi): -stack-list-locals Nick Roberts
2003-11-26  0:48 ` Andrew Cagney
2003-12-02  3:14   ` RFC (gdb/mi): -stack-list-locals + PATCH Nick Roberts
2003-12-09  2:42     ` RFC (gdb/mi): -stack-list-locals + REVISED PATCH Nick Roberts
2003-12-10 17:56       ` Andrew Cagney
2003-12-12 20:51         ` RFC (gdb/mi): -stack-list-locals Nick Roberts
2003-12-12 21:09           ` David Carlton
2003-12-17  2:29             ` [PATCH: gdb/mi + doco] -stack-list-locals and -var-list-children Nick Roberts
2004-01-05 21:43               ` Andrew Cagney
2004-01-06  0:14                 ` [PATCH: gdb/mi] -stack-list-locals testcase Nick Roberts
2004-01-06  1:07                   ` Andrew Cagney
2004-01-07 16:31                     ` Andrew Cagney
2004-01-07 17:34                       ` Mark Kettenis
2004-01-07 17:40                         ` Daniel Jacobowitz

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