[Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

Zachary Turner zturner at google.com
Wed Feb 11 22:08:28 PST 2015


Well, my underlying premise is that I think we should display as much information about the function as we can without getting in the way.  <+36> doesn't display any information (well, aside from the offset, as that's a given), so personally I think something like *always* choosing a display like <(this func)+36> is better than <+36>.  But then you have to wonder, if the actual name of this function is shorter than the length of the string "(this func)" why not just display it?  And from there, I start to question how long is too long.  One way to choose might perhaps be to choose the maximum length to which you are justifying the comments, to guarantee that you never have a function's name spill over into the comments section.  Then you have a deterministic, easy to understand rule about when the function name will be truncated to (this func).

BTW, do you have any thoughts on my suggestion regarding displaying the function name inline?  More specifically, comparing the following two formats:

; function name embedded.  Regular function vs. "too long" function
0x107915454 <+68>: jne CommandObjectBreakpointList::DoExecute + 113 (107915481)            ; [CommandObjectBreakpoint.cpp:1420]
0x107915454 <+68>: jne <(this func) + 113> (107915481)                                     ; [CommandObjectBreakpoint.cpp:1420]

; function name not embedded.  Regular function vs. "too long" function
0x107915454 <+68>: jne 0x107915481                                                         ; <+113> at CommandObjectBreakpoint.cpp:1420
0x107915454 <+68>: jne 0x107915481                                                         ; <(this func) +113> at CommandObjectBreakpoint.cpp:1420

Using the embedded approach, you could actually provide a debugger setting such as 'disassembly-comment-column' and since the algorithm for determining whether to truncate the name would be based on whether it spills into the comment column, changing the value of the setting would allow longer function names to be displayed in an easy to understand way.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list