public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: insight <insight@sourceware.org>
Subject: [PATCH] GDB API Updates
Date: Sat, 17 Dec 2011 19:32:00 -0000	[thread overview]
Message-ID: <4EECEE21.40500@redhat.com> (raw)

[-- 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");

                 reply	other threads:[~2011-12-17 19:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EECEE21.40500@redhat.com \
    --to=keiths@redhat.com \
    --cc=insight@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).