@@ -766,16 +766,19 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
766766 const bool hardware = false ;
767767 const LazyBool skip_prologue = eLazyBoolCalculate;
768768 const lldb::addr_t offset = 0 ;
769+ const bool offset_is_insn_count = false ;
769770 if (module_name && module_name[0 ]) {
770771 FileSpecList module_spec_list;
771772 module_spec_list.Append (FileSpec (module_name));
772773 sb_bp = target_sp->CreateBreakpoint (
773774 &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);
775777 } else {
776778 sb_bp = target_sp->CreateBreakpoint (
777779 nullptr , nullptr , symbol_name, eFunctionNameTypeAuto,
778- eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
780+ eLanguageTypeUnknown, offset, offset_is_insn_count, skip_prologue,
781+ internal, hardware);
779782 }
780783 }
781784
@@ -811,6 +814,17 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
811814 const SBFileSpecList &comp_unit_list) {
812815 LLDB_INSTRUMENT_VA (this , symbol_name, name_type_mask, symbol_language,
813816 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);
814828
815829 SBBreakpoint sb_bp;
816830 if (TargetSP target_sp = GetSP ();
@@ -821,7 +835,8 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
821835 std::lock_guard<std::recursive_mutex> guard (target_sp->GetAPIMutex ());
822836 FunctionNameType mask = static_cast <FunctionNameType>(name_type_mask);
823837 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,
825840 skip_prologue, internal, hardware);
826841 }
827842
@@ -1955,29 +1970,10 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
19551970
19561971 if (TargetSP target_sp = GetSP ()) {
19571972 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);
19761976 }
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));
19811977 }
19821978 }
19831979
0 commit comments