This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] [patch] OBJF_NOT_FILENAME [Re: [RFC] Record objfile->original_name as an absolute path]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches at sourceware dot org
- Date: Wed, 9 Oct 2013 15:23:49 +0200
- Subject: [commit] [patch] OBJF_NOT_FILENAME [Re: [RFC] Record objfile->original_name as an absolute path]
- Authentication-results: sourceware.org; auth=none
- References: <yjt2zjr09xqr dot fsf at ruffy dot mtv dot corp dot google dot com> <20130926084713 dot GA11031 at host2 dot jankratochvil dot net> <87siwqcayo dot fsf at fleche dot redhat dot com> <20131008182301 dot GA27355 at host2 dot jankratochvil dot net> <87hacrfrev dot fsf at fleche dot redhat dot com>
On Tue, 08 Oct 2013 22:18:00 +0200, Tom Tromey wrote:
> Jan> I will integrate it with add-ons to the Doug's patch.
>
> Thanks, Jan.
> It looks good. Just one nit:
Checked in, Doug's patch conflicts on top of it but I guess I will be the one
updating the Doug's patch anyway.
> Jan> +/* ORIGINAL_NAME and OBFD->FILENAME correspong to text description unrelated to
>
> Typo, "correspond".
Fixed.
Thanks,
Jan
https://sourceware.org/ml/gdb-cvs/2013-10/msg00054.html
--- src/gdb/ChangeLog 2013/10/08 19:56:14 1.16084
+++ src/gdb/ChangeLog 2013/10/09 13:22:35 1.16085
@@ -1,3 +1,17 @@
+2013-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ New flag OBJF_NOT_FILENAME.
+ * auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME.
+ * jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for
+ allocate_objfile.
+ (jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for
+ symbol_file_add_from_bfd.
+ * jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for
+ allocate_objfile.
+ * objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is
+ NULL.
+ * objfiles.h (OBJF_NOT_FILENAME): New.
+
2013-10-08 Tom Tromey <tromey@redhat.com>
* Makefile.in (SFILES): Add build-id.c.
--- src/gdb/auto-load.c 2013/09/24 13:57:36 1.22
+++ src/gdb/auto-load.c 2013/10/09 13:22:35 1.23
@@ -840,7 +840,7 @@
void
load_auto_scripts_for_objfile (struct objfile *objfile)
{
- if (!global_auto_load)
+ if (!global_auto_load || (objfile->flags & OBJF_NOT_FILENAME) != 0)
return;
if (auto_load_gdb_scripts)
--- src/gdb/jit.c 2013/09/24 14:00:06 1.56
+++ src/gdb/jit.c 2013/10/09 13:22:36 1.57
@@ -785,7 +785,8 @@
priv_data = cb->priv_data;
- objfile = allocate_objfile (NULL, "<< JIT compiled code >>", 0);
+ objfile = allocate_objfile (NULL, "<< JIT compiled code >>",
+ OBJF_NOT_FILENAME);
objfile->per_bfd->gdbarch = target_gdbarch ();
terminate_minimal_symbol_table (objfile);
@@ -926,7 +927,7 @@
/* This call does not take ownership of SAI. */
make_cleanup_bfd_unref (nbfd);
objfile = symbol_file_add_from_bfd (nbfd, bfd_get_filename (nbfd), 0, sai,
- OBJF_SHARED, NULL);
+ OBJF_SHARED | OBJF_NOT_FILENAME, NULL);
do_cleanups (old_cleanups);
add_objfile_entry (objfile, entry_addr);
--- src/gdb/jv-lang.c 2013/09/24 14:00:06 1.112
+++ src/gdb/jv-lang.c 2013/10/09 13:22:36 1.113
@@ -118,7 +118,8 @@
/* Mark it as shared so that it is cleared when the inferior is
re-run. */
- dynamics_objfile = allocate_objfile (NULL, NULL, OBJF_SHARED);
+ dynamics_objfile = allocate_objfile (NULL, NULL,
+ OBJF_SHARED | OBJF_NOT_FILENAME);
dynamics_objfile->per_bfd->gdbarch = gdbarch;
data = XCNEW (struct jv_per_objfile_data);
--- src/gdb/objfiles.c 2013/10/07 19:40:38 1.170
+++ src/gdb/objfiles.c 2013/10/09 13:22:36 1.171
@@ -289,6 +289,7 @@
if (name == NULL)
{
gdb_assert (abfd == NULL);
+ gdb_assert ((flags & OBJF_NOT_FILENAME) != 0);
name = "<<anonymous objfile>>";
}
objfile->original_name = obstack_copy0 (&objfile->objfile_obstack, name,
--- src/gdb/objfiles.h 2013/10/07 19:40:38 1.114
+++ src/gdb/objfiles.h 2013/10/09 13:22:36 1.115
@@ -429,6 +429,11 @@
#define OBJF_MAINLINE (1 << 5)
+/* ORIGINAL_NAME and OBFD->FILENAME correspond to text description unrelated to
+ filesystem names. It can be for example "<image in memory>". */
+
+#define OBJF_NOT_FILENAME (1 << 6)
+
/* Declarations for functions defined in objfiles.c */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);