public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] GDB API Updates
@ 2011-12-17 19:32 Keith Seitz
  0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2011-12-17 19:32 UTC (permalink / raw)
  To: insight

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

Hi,

GDB has once again been undergoing some churn with API changes to 
several functions. This patch should get things working again.

Please let me know if there are any problems.

Keith

ChangeLog
2011-12-17  Keith Seitz  <keiths@redhat.com>

	* generic/gdbtk-cmds.c (gdb_listfiles): Update API changes
	for map_partial_symbol_filenames.
	(gdb_get_line_command): Update API changes for decode_line_1 in gdb.
	(gdb_get_file_command): Likewise.
	(gdb_get_function_command): Likewise.
	* generic/gdbtk-stack.c (gdb_get_vars_command): Likewise.
	* generic/gdbtk-bp.c (tracepoint_exists): Likewise.
	(gdb_find_bp_at_line, gdb_get_breakpoint_info): Update breakpoint
	API changes in gdb.

[-- Attachment #2: api-updates.patch --]
[-- Type: text/x-patch, Size: 3799 bytes --]

Index: generic/gdbtk-bp.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v
retrieving revision 1.43
diff -u -p -r1.43 gdbtk-bp.c
--- generic/gdbtk-bp.c	2 Aug 2011 18:05:23 -0000	1.43
+++ generic/gdbtk-bp.c	17 Dec 2011 19:27:58 -0000
@@ -254,7 +254,8 @@ gdb_find_bp_at_line (ClientData clientDa
   Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
   ALL_BREAKPOINTS (b)
   {
-    if (b->line_number == line && !strcmp (b->source_file, s->filename))
+    if (b->loc->line_number == line
+	&& !strcmp (b->loc->source_file, s->filename))
       {
 	Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
 				  Tcl_NewIntObj (b->number));
@@ -336,7 +337,7 @@ gdb_get_breakpoint_info (ClientData clie
       Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                                 Tcl_NewStringObj (funcname, -1));
       Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
-                                Tcl_NewIntObj (b->line_number));
+                                Tcl_NewIntObj (b->loc->line_number));
       Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                                 Tcl_NewStringObj (core_addr_to_string
                                (b->loc->address), -1));
@@ -801,7 +802,7 @@ tracepoint_exists (char *args)
   char *file = NULL;
   int result = -1;
 
-  sals = decode_line_1 (&args, 1, NULL, 0, NULL);
+  sals = decode_line_1 (&args, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
   if (sals.nelts == 1)
     {
       resolve_sal_pc (&sals.sals[0]);
Index: generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.122
diff -u -p -r1.122 gdbtk-cmds.c
--- generic/gdbtk-cmds.c	11 Sep 2011 16:33:32 -0000	1.122
+++ generic/gdbtk-cmds.c	17 Dec 2011 19:27:59 -0000
@@ -960,7 +960,7 @@ gdb_get_line_command (ClientData clientD
     }
 
   args = Tcl_GetStringFromObj (objv[1], NULL);
-  sals = decode_line_1 (&args, 1, NULL, 0, NULL);
+  sals = decode_line_1 (&args, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
   if (sals.nelts == 1)
     {
       Tcl_SetIntObj (result_ptr->obj_ptr, sals.sals[0].line);
@@ -996,7 +996,7 @@ gdb_get_file_command (ClientData clientD
     }
 
   args = Tcl_GetStringFromObj (objv[1], NULL);
-  sals = decode_line_1 (&args, 1, NULL, 0, NULL);
+  sals = decode_line_1 (&args, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
   if (sals.nelts == 1)
     {
       Tcl_SetStringObj (result_ptr->obj_ptr,
@@ -1032,7 +1032,7 @@ gdb_get_function_command (ClientData cli
     }
 
   args = Tcl_GetStringFromObj (objv[1], NULL);
-  sals = decode_line_1 (&args, 1, NULL, 0, NULL);
+  sals = decode_line_1 (&args, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
   if (sals.nelts == 1)
     {
       resolve_sal_pc (&sals.sals[0]);
@@ -1200,7 +1200,7 @@ gdb_listfiles (ClientData clientData, Tc
   info.filesp = &files;
   info.len = len;
   info.pathname = pathname;
-  map_partial_symbol_filenames (do_listfiles, &info);
+  map_partial_symbol_filenames (do_listfiles, &info, 0);
 
   ALL_SYMTABS (objfile, symtab)
     {
Index: generic/gdbtk-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-stack.c,v
retrieving revision 1.36
diff -u -p -r1.36 gdbtk-stack.c
--- generic/gdbtk-stack.c	12 Apr 2011 05:11:08 -0000	1.36
+++ generic/gdbtk-stack.c	17 Dec 2011 19:27:59 -0000
@@ -298,7 +298,7 @@ gdb_get_vars_command (ClientData clientD
   if (objc == 2)
     {
       args = Tcl_GetStringFromObj (objv[1], NULL);
-      sals = decode_line_1 (&args, 1, NULL, 0, NULL);
+      sals = decode_line_1 (&args, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
       if (sals.nelts == 0)
 	{
 	  gdbtk_set_result (interp, "error decoding line");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-17 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-17 19:32 [PATCH] GDB API Updates Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).