gdb/gdb-varobj-revalidate-prep.patch
Jan Kratochvil 6fcb74ef6e - Archer update to the snapshot: 000db8b7bfef8581ef099ccca8689cfddfea1be8
- Archer backport: b8d3bea36b137effc929e02c4dadf73716cb330b
- Ignore explicit die representing global scope '::' (gcc 4.1 bug).
- Archer backport: c2d5c4a39b10994d86d8f2f90dfed769e8f216f3
- Fix parsing DW_AT_const_value using DW_FORM_string
- Archer backport: 8d9ab68fc0955c9de6320bec2821a21e3244600d
db41e11ae0a3aec7120ad6ce86450d838af74dd6
- Fix Fortran modules/namespaces parsing (but no change was visible in
    F11).
- Archer backport: 000db8b7bfef8581ef099ccca8689cfddfea1be8
- Fix "some Python error when displaying some C++ objects" (BZ 504356).
- testsuite: Support new rpmbuild option: --with parallel
- testsuite: gdb-orphanripper.c: Fix uninitialized `termios.c_line'.
- Fix crashes due to (missing) varobj revalidation, for VLA (for BZ
    377541).
- Archer backport: 58dcda94ac5d6398f47382505e9d3d9d866d79bf
f3de7bbd655337fe6705aeaafcc970deff3dd5d5
- Implement Fortran modules namespaces (BZ 466118).
- Fix crash in the charset support.
2009-06-10 13:05:57 +00:00

87 lines
2.6 KiB
Diff

Re: [patch] Make a function for block->objfile lookups
http://sourceware.org/ml/gdb-patches/2009-04/msg00609.html
gdb/
2009-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* block.c (block_objfile): New function.
* block.h (block_objfile): New prototype.
* objfiles.c (matching_objfiles): New function.
* objfiles.h (matching_objfiles): New prototype.
* printcmd.c: Remove include solib.h.
(display_uses_solib_p): Rename to ...
(display_uses_objfile): ... a new function name. Change the SOLIB
parameter to OBJFILE parameter. Use now a matching_objfiles call.
(clear_dangling_display_expressions): Update the caller.
[ Cut the printcmd.c simplification/change. ]
--- ./gdb/block.c 3 Jan 2009 05:57:50 -0000 1.18
+++ ./gdb/block.c 22 Apr 2009 19:51:40 -0000
@@ -309,3 +309,21 @@ allocate_block (struct obstack *obstack)
return bl;
}
+
+/* Return OBJFILE in which BLOCK is located or NULL if we cannot find it for
+ whatever reason. */
+
+struct objfile *
+block_objfile (const struct block *block)
+{
+ struct symbol *func;
+
+ if (block == NULL)
+ return NULL;
+
+ func = block_linkage_function (block);
+ if (func == NULL)
+ return NULL;
+
+ return SYMBOL_SYMTAB (func)->objfile;
+}
--- ./gdb/block.h 3 Jan 2009 05:57:50 -0000 1.19
+++ ./gdb/block.h 22 Apr 2009 19:51:40 -0000
@@ -164,4 +164,6 @@ extern const struct block *block_global_
extern struct block *allocate_block (struct obstack *obstack);
+extern struct objfile *block_objfile (const struct block *block);
+
#endif /* BLOCK_H */
--- ./gdb/objfiles.c 11 Mar 2009 20:26:02 -0000 1.82
+++ ./gdb/objfiles.c 22 Apr 2009 19:51:40 -0000
@@ -891,3 +891,21 @@ objfile_data (struct objfile *objfile, c
gdb_assert (data->index < objfile->num_data);
return objfile->data[data->index];
}
+
+/* Return non-zero if A and B point to the same OBJFILE, ignoring any binary
+ vs. debuginfo variants of the pointers. If either A or B is NULL return
+ zero as not a match. */
+
+int
+matching_objfiles (struct objfile *a, struct objfile *b)
+{
+ if (a == NULL || b == NULL)
+ return 0;
+
+ if (a->separate_debug_objfile_backlink)
+ a = a->separate_debug_objfile_backlink;
+ if (b->separate_debug_objfile_backlink)
+ b = b->separate_debug_objfile_backlink;
+
+ return a == b;
+}
--- ./gdb/objfiles.h 15 Jan 2009 16:35:22 -0000 1.59
+++ ./gdb/objfiles.h 22 Apr 2009 19:51:40 -0000
@@ -497,6 +497,8 @@ extern struct obj_section *find_pc_secti
extern int in_plt_section (CORE_ADDR, char *);
+extern int matching_objfiles (struct objfile *a, struct objfile *b);
+
/* Keep a registry of per-objfile data-pointers required by other GDB
modules. */