This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Handle LOC_COMPUTED variables in tracepoint actions


Tom Tromey wrote:
"Stan" == Stan Shebs <stan@codesourcery.com> writes:

Stan> The last time that anybody used tracepoints much, stabs was still Stan> the norm and Dwarf 2 the newbie, and so nobody thought much about Stan> handling variables with computed locations.

Stan> This patch doesn't handle every possible computed location, that's
Stan> a big project of its own (basically translating arbitrary dwarf2
Stan> bytecode sequences into equivalent agent expression bytecodes)

Fun project :-).  Let me suggest a feature request for this in
bugzilla...

Stan> Even the simplified version is a little arcane, so I'll leave it
Stan> up for comments for a few days before committing.

This patch looks pretty good to me.

Does this handle DW_OP_call_frame_cfa? I didn't see any explicit
support for it, but I could be missing something. IIUC, recent versions
of gcc tend to emit this for all local variables.
I don't think so - it's probably an accident waiting to happen. :-)
Stan> + 	  /* We don't know what to do with the frame base expression,
Stan> + 	     so we can't trace this variable; give up.  */
Stan> + 	  error (_("Cannot generate expression to collect symbol \"%s\"."),
Stan> + 		 SYMBOL_PRINT_NAME (symbol));

As a user I would appreciate it if this error told me more about what
was wrong. Like, maybe it could mention that the DWARF expression is
too complicated, or maybe ask me to file a bug report.
I tinkered with the wording a bit, but it's difficult to explain. In general the compiler is producing output that the bytecode compiler doesn't know how to handle, and there's not much the user can do about it. It's severe enough that we should give up on the tracing run, so we need it to be an error rather than a warning, but internal_error is a bit excessive, since regular debugging still works, and the debugger state hasn't been corrupted in any way.

Stan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]