@@ -766,16 +766,19 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
766
766
const bool hardware = false ;
767
767
const LazyBool skip_prologue = eLazyBoolCalculate;
768
768
const lldb::addr_t offset = 0 ;
769
+ const bool offset_is_insn_count = false ;
769
770
if (module_name && module_name[0 ]) {
770
771
FileSpecList module_spec_list;
771
772
module_spec_list.Append (FileSpec (module_name));
772
773
sb_bp = target_sp->CreateBreakpoint (
773
774
&module_spec_list, nullptr , symbol_name, eFunctionNameTypeAuto,
774
- eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
775
+ eLanguageTypeUnknown, offset, offset_is_insn_count, skip_prologue,
776
+ internal, hardware);
775
777
} else {
776
778
sb_bp = target_sp->CreateBreakpoint (
777
779
nullptr , nullptr , symbol_name, eFunctionNameTypeAuto,
778
- eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
780
+ eLanguageTypeUnknown, offset, offset_is_insn_count, skip_prologue,
781
+ internal, hardware);
779
782
}
780
783
}
781
784
@@ -811,6 +814,17 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
811
814
const SBFileSpecList &comp_unit_list) {
812
815
LLDB_INSTRUMENT_VA (this , symbol_name, name_type_mask, symbol_language,
813
816
module_list, comp_unit_list);
817
+ return BreakpointCreateByName (symbol_name, name_type_mask, symbol_language, 0 ,
818
+ false , module_list, comp_unit_list);
819
+ }
820
+
821
+ lldb::SBBreakpoint SBTarget::BreakpointCreateByName (
822
+ const char *symbol_name, uint32_t name_type_mask,
823
+ LanguageType symbol_language, lldb::addr_t offset,
824
+ bool offset_is_insn_count, const SBFileSpecList &module_list,
825
+ const SBFileSpecList &comp_unit_list) {
826
+ LLDB_INSTRUMENT_VA (this , symbol_name, name_type_mask, symbol_language, offset,
827
+ offset_is_insn_count, module_list, comp_unit_list);
814
828
815
829
SBBreakpoint sb_bp;
816
830
if (TargetSP target_sp = GetSP ();
@@ -821,7 +835,8 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
821
835
std::lock_guard<std::recursive_mutex> guard (target_sp->GetAPIMutex ());
822
836
FunctionNameType mask = static_cast <FunctionNameType>(name_type_mask);
823
837
sb_bp = target_sp->CreateBreakpoint (module_list.get (), comp_unit_list.get (),
824
- symbol_name, mask, symbol_language, 0 ,
838
+ symbol_name, mask, symbol_language,
839
+ offset, offset_is_insn_count,
825
840
skip_prologue, internal, hardware);
826
841
}
827
842
@@ -1955,29 +1970,10 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
1955
1970
1956
1971
if (TargetSP target_sp = GetSP ()) {
1957
1972
if (Address *addr_ptr = base_addr.get ()) {
1958
- DataBufferHeap data (
1959
- target_sp->GetArchitecture ().GetMaximumOpcodeByteSize () * count, 0 );
1960
- bool force_live_memory = true ;
1961
- lldb_private::Status error;
1962
- lldb::addr_t load_addr = LLDB_INVALID_ADDRESS;
1963
- const size_t bytes_read =
1964
- target_sp->ReadMemory (*addr_ptr, data.GetBytes (), data.GetByteSize (),
1965
- error, force_live_memory, &load_addr);
1966
-
1967
- const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS;
1968
- if (!flavor_string || flavor_string[0 ] == ' \0 ' ) {
1969
- // FIXME - we don't have the mechanism in place to do per-architecture
1970
- // settings. But since we know that for now we only support flavors on
1971
- // x86 & x86_64,
1972
- const llvm::Triple::ArchType arch =
1973
- target_sp->GetArchitecture ().GetTriple ().getArch ();
1974
- if (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64)
1975
- flavor_string = target_sp->GetDisassemblyFlavor ();
1973
+ if (llvm::Expected<DisassemblerSP> disassembler =
1974
+ target_sp->ReadInstructions (*addr_ptr, count, flavor_string)) {
1975
+ sb_instructions.SetDisassembler (*disassembler);
1976
1976
}
1977
- sb_instructions.SetDisassembler (Disassembler::DisassembleBytes (
1978
- target_sp->GetArchitecture (), nullptr , flavor_string,
1979
- target_sp->GetDisassemblyCPU (), target_sp->GetDisassemblyFeatures (),
1980
- *addr_ptr, data.GetBytes (), bytes_read, count, data_from_file));
1981
1977
}
1982
1978
}
1983
1979
0 commit comments