Re: New warning in GDB 7.5

Eli Zaretskii
2012-08-19T16:53:21Z

> Date: Sat, 18 Aug 2012 21:36:52 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, gdb-patches@sourceware.org
>
> > I always thought lazy loading of symbols was a feature, not a bug.
>
> Shouldn't the commands work regardless of whether symbols have been
> fully loaded or not, though?

That would be nice, but I don't know of any way to do that. If you
look at Emacs's src/.gdbinit, you will see at its end that it needs
some symbols right at startup, when the program was not yet started.
If there are commands to control which symbols are loaded when GDB
starts, they might help. Otherwise, I will replace those two "set"
commands with something like

set $dummy = main + 8

which does the job, and suppresses the warning.

> Lazy psymtab-to-symtab conversion should be transparent to the user.

But what is its trigger? And will this transparent conversion kick in
when .gdbinit does the following?

# People get bothered when they see messages about non-existent functions...
xgetptr globals.f_Vsystem_type
# $ptr is NULL in temacs
if ($ptr != 0)
set $tem = (struct Lisp_Symbol *) $ptr
xgetptr $tem->name
set $tem = (struct Lisp_String *) $ptr
set $tem = (char *) $tem->data

# Don't let abort actually run, as it will make stdio stop working and
# therefore the `pr' command above as well.
if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd'
# The windows-nt build replaces abort with its own function.
break w32_abort
else
break abort
end
end

Here, GDB needs to know what is Lisp_String and Lisp_Symbol, and also
the various bit masks used by xgetptr (defined earlier in the file).