Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] cleanup: source.c objfile removal
@ 2009-07-06 18:09 Jan Kratochvil
  2009-07-06 18:18 ` Daniel Jacobowitz
  2009-07-06 18:22 ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Kratochvil @ 2009-07-06 18:09 UTC (permalink / raw)
  To: gdb-patches

Hi,

probably obvious but rather requesting an approval.

It is needed to unify some psymtab and symtab functions later.


Thanks,
Jan


gdb/
2009-07-06  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* source.c (find_and_open_source): Remove the `objfile' parameter.
	Update the function comment.
	(open_source_file, symtab_to_fullname, psymtab_to_fullname): Update the
	find_and_open_source callers.

--- a/gdb/source.c
+++ b/gdb/source.c
@@ -922,11 +922,9 @@ rewrite_source_path (const char *path)
 }
 
 /* This function is capable of finding the absolute path to a
-   source file, and opening it, provided you give it an 
-   OBJFILE and FILENAME. Both the DIRNAME and FULLNAME are only
-   added suggestions on where to find the file. 
+   source file, and opening it, provided you give it a FILENAME. Both the
+   DIRNAME and FULLNAME are only added suggestions on where to find the file. 
 
-   OBJFILE should be the objfile associated with a psymtab or symtab. 
    FILENAME should be the filename to open.
    DIRNAME is the compilation directory of a particular source file.
            Only some debug formats provide this info.
@@ -944,8 +942,7 @@ rewrite_source_path (const char *path)
      FULLNAME is set to NULL.  */
 
 static int
-find_and_open_source (struct objfile *objfile,
-		      const char *filename,
+find_and_open_source (const char *filename,
 		      const char *dirname,
 		      char **fullname)
 {
@@ -1044,8 +1041,7 @@ open_source_file (struct symtab *s)
   if (!s)
     return -1;
 
-  return find_and_open_source (s->objfile, s->filename, s->dirname, 
-			       &s->fullname);
+  return find_and_open_source (s->filename, s->dirname, &s->fullname);
 }
 
 /* Finds the fullname that a symtab represents.
@@ -1065,8 +1061,7 @@ symtab_to_fullname (struct symtab *s)
 
   /* Don't check s->fullname here, the file could have been 
      deleted/moved/..., look for it again */
-  r = find_and_open_source (s->objfile, s->filename, s->dirname,
-			    &s->fullname);
+  r = find_and_open_source (s->filename, s->dirname, &s->fullname);
 
   if (r >= 0)
     {
@@ -1094,8 +1089,7 @@ psymtab_to_fullname (struct partial_symtab *ps)
 
   /* Don't check ps->fullname here, the file could have been
      deleted/moved/..., look for it again */
-  r = find_and_open_source (ps->objfile, ps->filename, ps->dirname,
-			    &ps->fullname);
+  r = find_and_open_source (ps->filename, ps->dirname, &ps->fullname);
 
   if (r >= 0)
     {


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

* Re: [patch] cleanup: source.c objfile removal
  2009-07-06 18:09 [patch] cleanup: source.c objfile removal Jan Kratochvil
@ 2009-07-06 18:18 ` Daniel Jacobowitz
  2009-07-06 18:26   ` Jan Kratochvil
  2009-07-06 18:22 ` Tom Tromey
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2009-07-06 18:18 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On Mon, Jul 06, 2009 at 08:09:29PM +0200, Jan Kratochvil wrote:
> Hi,
> 
> probably obvious but rather requesting an approval.
> 
> It is needed to unify some psymtab and symtab functions later.

OK.  The argument used to be used for an mmalloc pool (long ago).

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [patch] cleanup: source.c objfile removal
  2009-07-06 18:09 [patch] cleanup: source.c objfile removal Jan Kratochvil
  2009-07-06 18:18 ` Daniel Jacobowitz
@ 2009-07-06 18:22 ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2009-07-06 18:22 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> 2009-07-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan> 	* source.c (find_and_open_source): Remove the `objfile' parameter.
Jan> 	Update the function comment.
Jan> 	(open_source_file, symtab_to_fullname, psymtab_to_fullname): Update the
Jan> 	find_and_open_source callers.

Ok.  Thanks.

Tom


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

* Re: [patch] cleanup: source.c objfile removal
  2009-07-06 18:18 ` Daniel Jacobowitz
@ 2009-07-06 18:26   ` Jan Kratochvil
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2009-07-06 18:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

On Mon, 06 Jul 2009 20:22:04 +0200, Tom Tromey wrote:
> Ok.  Thanks.
On Mon, 06 Jul 2009 20:17:52 +0200, Daniel Jacobowitz wrote:
> OK.  The argument used to be used for an mmalloc pool (long ago).

Thanks, it is true I was a bit curious why objfile is there.

Checked-in:
	http://sourceware.org/ml/gdb-cvs/2009-07/msg00049.html


Regards,
Jan


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

end of thread, other threads:[~2009-07-06 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-06 18:09 [patch] cleanup: source.c objfile removal Jan Kratochvil
2009-07-06 18:18 ` Daniel Jacobowitz
2009-07-06 18:26   ` Jan Kratochvil
2009-07-06 18:22 ` Tom Tromey

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