[Lldb-commits] [PATCH] D105741: [trace] Add `thread trace export` command for Intel PT trace visualization

Jakob Johnson via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 21 09:50:46 PDT 2021


jj10306 added inline comments.


================
Comment at: lldb/source/Target/TraceHTR.cpp:205-217
+  // Why does using `IHTRLayer &current_layer = m_instruction_layer;` not work?
+  HTRInstructionLayer instruction_layer = m_instruction_layer;
+  HTRBlockLayer current_layer = BasicSuperBlockMerge(instruction_layer);
+  if (instruction_layer.GetNumUnits() == current_layer.GetNumUnits())
+    return;
+  AddNewBlockLayer(current_layer);
+  while (true) {
----------------
Any idea why the "Edit" I made above does not work?
I tried this first but after using lldb to understand why it wasn't working, it appeared that `current_layer = new_block_layer` wasn't properly updating the value stored in `current_layer`. I thought that using a reference to an abstract class as the type for `current_layer` would allow this variable to bind to any value that implements the interface, but after changing the code to only use concrete types (the non-edited version of this code), the code behaves as expected. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105741/new/

https://reviews.llvm.org/D105741



More information about the lldb-commits mailing list