[Dwarf-discuss] dwarf ver3.0: prologue_end and epilogue_begin bits
Tue May 22 14:22:41 GMT 2007
Quoting Ramanaiah Nalamothu <ramana.venkat83 at gmail.com>:
> But for epilogue_begin, in my case the next line number is .dbgline 0, this
> will be generated always, please check the sample code snippet below with my
> comments in between # #, which is also an invalid source line.
Why not generate a valid line number?
It's not good practice to use a pseudo op like .dbline to indicate two
(or more) incompatible pieces of information: the source line number and
the start of the epilogue (and, evidently, the end of the function). In
this case, you want to know both pieces of information at the same time.
It would be better to create a new pseudo op like .epilogue to indicate
the start of the epilogue.
> If the line number for epilogue_begin is the end of function body, if i
> understood correctly, then we will be setting the line - address pair after
> the end of epilogue operations, at least in my case i.e .dbgline 0
> (func_end). Is this acceptable?
It depends on what you mean by acceptable. It probably means that if your
debugger has an operation which sets a breakpoint at the epilogue, perhaps
to display the return value of a function, then it will not display the
correct source line. If that's OK with you and your users, then it's OK
with me. :-)
> Is it ok if I say the debugger that at 'address' epilogue_begin occurs and
> not associating that with any valid source line??
It depends on what you want your debugger to display. Random lines tend
to give users a poor view of the debugger's quality, even if it was the
compiler at fault.
> Am I missing anything? I am a newbie to DWARF. And i have no experience with
> debugger. Sorry if i am wasting your time with silly doubts.
These are certainly reasonable questions.
> Please tell me if there is any online document, apart from dwarf standard
> document itself, about dwarf or dwarf generator - debugger inter working
> which should clarify my basic doubts.
There's a tutorial on the DWARF website, dwarfstd.org, but I don't
think it will shed much light on these technical questions.
Michael Eager Eager Consulting eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Dwarf-discuss