Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [PATCH] Add fullname field for MI -break-info command
@ 2006-01-26 11:27 Nick Roberts
  2006-01-26 11:44 ` Vladimir Prus
  0 siblings, 1 reply; 23+ messages in thread
From: Nick Roberts @ 2006-01-26 11:27 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb-patches

+  if (ui_out_is_mi_like_p (uiout))
+    {
+      if (b->loc->loc_type == bp_loc_software_breakpoint || 
+          b->loc->loc_type == bp_loc_hardware_watchpoint)
                                               ^^^^^^^^^^
Should this be bp_loc_hardware_breakpoint?

+        {
+          struct symtab_and_line sal = find_pc_line (b->loc->address, 0);
+          symtab_to_fullname (sal.symtab);
+
+          if (sal.symtab->fullname)
+            {
+              annotate_field(10);
+              ui_out_field_string (uiout, "fullname", sal.symtab->fullname);
+            }
+        }
+    }
+

Also, I would move it up breakpoint.c (without the call to annotate_field)
to here:

	if (b->source_file)
	  {
	    sym = find_pc_sect_function (b->loc->address, b->loc->section);
	    if (sym)
	      {
		ui_out_text (uiout, "in ");
		ui_out_field_string (uiout, "func",
				     SYMBOL_PRINT_NAME (sym));
		ui_out_wrap_hint (uiout, wrap_indent);
		ui_out_text (uiout, " at ");
	      }
	    ui_out_field_string (uiout, "file", b->source_file);
	    ui_out_text (uiout, ":");

--->

	    ui_out_field_int (uiout, "line", b->line_number);
	  }

to be consistent with the output of print_frame, where the order is
file, fullname, line.

Putting it here might also mean that the test for b->loc->loc_type isn't
needed, but I don't really know.


Nick                                           http://www.inet.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [PATCH] Add fullname field for MI -break-info command
@ 2006-01-26  7:13 Nick Roberts
  0 siblings, 0 replies; 23+ messages in thread
From: Nick Roberts @ 2006-01-26  7:13 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb-patches


> > For a future: can you explain what "annotate_field" does? The annotate.h
> > file has no comments at all, and gdbint has "annotate_field" only inside
> > code examples. And generally, what are "annotations"?

> Annotations were the old interface used between GDB and front ends. It
> was all that was available before MI. For your own sanity, never ever
> try to deal with them.

Just to clarify: Annotations will be replaced by MI but there are currently
still front ends that use them.  So don't add new annotations but please be
careful not to change existing behaviour either.

Nick                                           http://www.inet.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [PATCH] Add fullname field for MI -break-info command
@ 2006-01-26  7:06 Nick Roberts
  0 siblings, 0 replies; 23+ messages in thread
From: Nick Roberts @ 2006-01-26  7:06 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb-patches


I've probably not followed the whole thread, but here goes...

> > Hmm, so I should update all examples of "-break-list" output as well? What 
> > path should I put there? Is /home/foo/bar/<whatever-the-source-file-is>.c 
> > fine?

> Yes, please update the documentation for -break-list,

-break-insert also uses print_one_breakpoint so I guess that should be
updated

>                                                       and I don't know
> if you should even bother with -break-info. I still don't know if that
> command should exist if it's identical to -break-list. A machine
> interface does not need 2 commands for the same functionatlity, IMO.

I don't know if its needed either but now its there I don't see any
point in removing it (if it ain't broke don't fix it).

Also the doc says:

    The `-break-info' Command

    Synopsis

          -break-info BREAKPOINT
    
       Get information about a single breakpoint.

    GDB command

    The corresponding GDB command is `info break BREAKPOINT'.

    Example

    N.A.

and

    Also note that the commands with a non-available example (N.A.) are not
    yet implemented.

but -break-info clearly has been implemented.


Nick                                           http://www.inet.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH] Add fullname field for MI -break-info command
@ 2006-01-24 16:42 Vladimir Prus
  0 siblings, 0 replies; 23+ messages in thread
From: Vladimir Prus @ 2006-01-24 16:42 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]


Hello!

The attached patch adds the "fullname" field to the output of MI -break-info
command.

Changelog entry:

2006-01-24 Vladimir Prus <ghost@cs.msu.su>
        
        * breakpoint.c (print_one_breakpoint): For MI-like UI, output
         'fullname' field.

Patch attached.

- Volodya
     

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: break_info_fullname.diff --]
[-- Type: text/x-diff; name="break_info_fullname.diff", Size: 944 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.220
diff -u -r1.220 breakpoint.c
--- breakpoint.c	16 Jan 2006 12:55:18 -0000	1.220
+++ breakpoint.c	24 Jan 2006 15:10:47 -0000
@@ -3603,6 +3603,23 @@
       print_command_lines (uiout, l, 4);
       do_cleanups (script_chain);
     }
+
+  if (ui_out_is_mi_like_p (uiout))
+    {
+      if (b->loc->loc_type == bp_loc_software_breakpoint || 
+          b->loc->loc_type == bp_loc_hardware_watchpoint)
+        {
+          struct symtab_and_line sal = find_pc_line (b->loc->address, 0);
+          symtab_to_fullname (sal.symtab);
+
+          if (sal.symtab->fullname)
+            {
+              annotate_field(10);
+              ui_out_field_string (uiout, "fullname", sal.symtab->fullname);
+            }
+        }
+    }
+
   do_cleanups (bkpt_chain);
   do_cleanups (old_chain);
 }

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH] Add fullname field for MI -break-info command
@ 2006-01-24 16:42 Vladimir Prus
  2006-01-24 16:51 ` Bob Rossi
  2006-01-24 21:13 ` Daniel Jacobowitz
  0 siblings, 2 replies; 23+ messages in thread
From: Vladimir Prus @ 2006-01-24 16:42 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]


Hello!

The attached patch adds the "fullname" field to the output of MI -break-info
command.

Changelog entry:

2006-01-24 Vladimir Prus <ghost@cs.msu.su>
        
        * breakpoint.c (print_one_breakpoint): For MI-like UI, output
         'fullname' field.

Patch attached.

- Volodya

[-- Attachment #2: break_info_fullname.diff --]
[-- Type: text/x-diff, Size: 944 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.220
diff -u -r1.220 breakpoint.c
--- breakpoint.c	16 Jan 2006 12:55:18 -0000	1.220
+++ breakpoint.c	24 Jan 2006 15:10:47 -0000
@@ -3603,6 +3603,23 @@
       print_command_lines (uiout, l, 4);
       do_cleanups (script_chain);
     }
+
+  if (ui_out_is_mi_like_p (uiout))
+    {
+      if (b->loc->loc_type == bp_loc_software_breakpoint || 
+          b->loc->loc_type == bp_loc_hardware_watchpoint)
+        {
+          struct symtab_and_line sal = find_pc_line (b->loc->address, 0);
+          symtab_to_fullname (sal.symtab);
+
+          if (sal.symtab->fullname)
+            {
+              annotate_field(10);
+              ui_out_field_string (uiout, "fullname", sal.symtab->fullname);
+            }
+        }
+    }
+
   do_cleanups (bkpt_chain);
   do_cleanups (old_chain);
 }

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

end of thread, other threads:[~2006-02-06 21:55 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 11:27 [PATCH] Add fullname field for MI -break-info command Nick Roberts
2006-01-26 11:44 ` Vladimir Prus
  -- strict thread matches above, loose matches on Subject: below --
2006-01-26  7:13 Nick Roberts
2006-01-26  7:06 Nick Roberts
2006-01-24 16:42 Vladimir Prus
2006-01-24 16:42 Vladimir Prus
2006-01-24 16:51 ` Bob Rossi
2006-01-25 11:07   ` Vladimir Prus
2006-01-25 12:10     ` Bob Rossi
2006-01-25 12:37       ` Andreas Schwab
2006-01-25 12:50       ` Vladimir Prus
2006-01-25 13:45         ` Bob Rossi
2006-01-26  7:10           ` Vladimir Prus
2006-01-28 13:10   ` Vladimir Prus
2006-02-01 22:32     ` Daniel Jacobowitz
2006-02-02  7:07       ` Vladimir Prus
2006-02-06 21:55         ` Daniel Jacobowitz
2006-01-24 21:13 ` Daniel Jacobowitz
2006-01-25 13:31   ` Vladimir Prus
2006-01-25 13:46     ` Bob Rossi
2006-01-26  7:20       ` Vladimir Prus
2006-01-25 13:51     ` Daniel Jacobowitz
2006-01-25 17:56     ` Eli Zaretskii

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