@@ -771,16 +771,19 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
771
771
const bool hardware = false ;
772
772
const LazyBool skip_prologue = eLazyBoolCalculate;
773
773
const lldb::addr_t offset = 0 ;
774
+ const bool offset_is_insn_count = false ;
774
775
if (module_name && module_name[0 ]) {
775
776
FileSpecList module_spec_list;
776
777
module_spec_list.Append (FileSpec (module_name));
777
778
sb_bp = target_sp->CreateBreakpoint (
778
779
&module_spec_list, nullptr , symbol_name, eFunctionNameTypeAuto,
779
- eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
780
+ eLanguageTypeUnknown, offset, offset_is_insn_count, skip_prologue,
781
+ internal, hardware);
780
782
} else {
781
783
sb_bp = target_sp->CreateBreakpoint (
782
784
nullptr , nullptr , symbol_name, eFunctionNameTypeAuto,
783
- eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
785
+ eLanguageTypeUnknown, offset, offset_is_insn_count, skip_prologue,
786
+ internal, hardware);
784
787
}
785
788
}
786
789
@@ -816,6 +819,17 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
816
819
const SBFileSpecList &comp_unit_list) {
817
820
LLDB_INSTRUMENT_VA (this , symbol_name, name_type_mask, symbol_language,
818
821
module_list, comp_unit_list);
822
+ return BreakpointCreateByName (symbol_name, name_type_mask, symbol_language, 0 ,
823
+ false , module_list, comp_unit_list);
824
+ }
825
+
826
+ lldb::SBBreakpoint SBTarget::BreakpointCreateByName (
827
+ const char *symbol_name, uint32_t name_type_mask,
828
+ LanguageType symbol_language, lldb::addr_t offset,
829
+ bool offset_is_insn_count, const SBFileSpecList &module_list,
830
+ const SBFileSpecList &comp_unit_list) {
831
+ LLDB_INSTRUMENT_VA (this , symbol_name, name_type_mask, symbol_language, offset,
832
+ offset_is_insn_count, module_list, comp_unit_list);
819
833
820
834
SBBreakpoint sb_bp;
821
835
if (TargetSP target_sp = GetSP ();
@@ -826,7 +840,8 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
826
840
std::lock_guard<std::recursive_mutex> guard (target_sp->GetAPIMutex ());
827
841
FunctionNameType mask = static_cast <FunctionNameType>(name_type_mask);
828
842
sb_bp = target_sp->CreateBreakpoint (module_list.get (), comp_unit_list.get (),
829
- symbol_name, mask, symbol_language, 0 ,
843
+ symbol_name, mask, symbol_language,
844
+ offset, offset_is_insn_count,
830
845
skip_prologue, internal, hardware);
831
846
}
832
847
@@ -2013,29 +2028,10 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
2013
2028
2014
2029
if (TargetSP target_sp = GetSP ()) {
2015
2030
if (Address *addr_ptr = base_addr.get ()) {
2016
- DataBufferHeap data (
2017
- target_sp->GetArchitecture ().GetMaximumOpcodeByteSize () * count, 0 );
2018
- bool force_live_memory = true ;
2019
- lldb_private::Status error;
2020
- lldb::addr_t load_addr = LLDB_INVALID_ADDRESS;
2021
- const size_t bytes_read =
2022
- target_sp->ReadMemory (*addr_ptr, data.GetBytes (), data.GetByteSize (),
2023
- error, force_live_memory, &load_addr);
2024
-
2025
- const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS;
2026
- if (!flavor_string || flavor_string[0 ] == ' \0 ' ) {
2027
- // FIXME - we don't have the mechanism in place to do per-architecture
2028
- // settings. But since we know that for now we only support flavors on
2029
- // x86 & x86_64,
2030
- const llvm::Triple::ArchType arch =
2031
- target_sp->GetArchitecture ().GetTriple ().getArch ();
2032
- if (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64)
2033
- flavor_string = target_sp->GetDisassemblyFlavor ();
2031
+ if (llvm::Expected<DisassemblerSP> disassembler =
2032
+ target_sp->ReadInstructions (*addr_ptr, count, flavor_string)) {
2033
+ sb_instructions.SetDisassembler (*disassembler);
2034
2034
}
2035
- sb_instructions.SetDisassembler (Disassembler::DisassembleBytes (
2036
- target_sp->GetArchitecture (), nullptr , flavor_string,
2037
- target_sp->GetDisassemblyCPU (), target_sp->GetDisassemblyFeatures (),
2038
- *addr_ptr, data.GetBytes (), bytes_read, count, data_from_file));
2039
2035
}
2040
2036
}
2041
2037
0 commit comments