@@ -601,138 +601,6 @@ inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf,
601
601
return false ;
602
602
}
603
603
604
-
605
-
606
- #ifdef UNW_REMOTE
607
-
608
- // / RemoteAddressSpace is used as a template parameter to UnwindCursor when
609
- // / unwinding a thread in the another process. The other process can be a
610
- // / different endianness and a different pointer size which is handled by
611
- // / the P template parameter.
612
- template <typename P>
613
- class RemoteAddressSpace {
614
- public:
615
- RemoteAddressSpace (task_t task) : fTask (task) {}
616
-
617
- typedef typename P::uint_t pint_t ;
618
-
619
- uint8_t get8 (pint_t addr);
620
- uint16_t get16 (pint_t addr);
621
- uint32_t get32 (pint_t addr);
622
- uint64_t get64 (pint_t addr);
623
- pint_t getP (pint_t addr);
624
- uint64_t getRegister (pint_t addr);
625
- uint64_t getULEB128 (pint_t &addr, pint_t end);
626
- int64_t getSLEB128 (pint_t &addr, pint_t end);
627
- pint_t getEncodedP (pint_t &addr, pint_t end, uint8_t encoding,
628
- pint_t datarelBase = 0 );
629
- bool findFunctionName (pint_t addr, char *buf, size_t bufLen,
630
- unw_word_t *offset);
631
- bool findUnwindSections (pint_t targetAddr, UnwindInfoSections &info);
632
- bool findOtherFDE (pint_t targetAddr, pint_t &fde);
633
- private:
634
- void *localCopy (pint_t addr);
635
-
636
- task_t fTask ;
637
- };
638
-
639
- template <typename P> uint8_t RemoteAddressSpace<P>::get8(pint_t addr) {
640
- return *((uint8_t *)localCopy (addr));
641
- }
642
-
643
- template <typename P> uint16_t RemoteAddressSpace<P>::get16(pint_t addr) {
644
- return P::E::get16 (*(uint16_t *)localCopy (addr));
645
- }
646
-
647
- template <typename P> uint32_t RemoteAddressSpace<P>::get32(pint_t addr) {
648
- return P::E::get32 (*(uint32_t *)localCopy (addr));
649
- }
650
-
651
- template <typename P> uint64_t RemoteAddressSpace<P>::get64(pint_t addr) {
652
- return P::E::get64 (*(uint64_t *)localCopy (addr));
653
- }
654
-
655
- template <typename P>
656
- typename P::uint_t RemoteAddressSpace<P>::getP(pint_t addr) {
657
- return P::getP (*(uint64_t *)localCopy (addr));
658
- }
659
-
660
- template <typename P>
661
- typename P::uint_t OtherAddressSpace<P>::getRegister(pint_t addr) {
662
- return P::getRegister (*(uint64_t *)localCopy (addr));
663
- }
664
-
665
- template <typename P>
666
- uint64_t OtherAddressSpace<P>::getULEB128(pint_t &addr, pint_t end) {
667
- uintptr_t size = (end - addr);
668
- LocalAddressSpace::pint_t laddr = (LocalAddressSpace::pint_t ) localCopy (addr);
669
- LocalAddressSpace::pint_t sladdr = laddr;
670
- uint64_t result = LocalAddressSpace::getULEB128 (laddr, laddr + size);
671
- addr += (laddr - sladdr);
672
- return result;
673
- }
674
-
675
- template <typename P>
676
- int64_t RemoteAddressSpace<P>::getSLEB128(pint_t &addr, pint_t end) {
677
- uintptr_t size = (end - addr);
678
- LocalAddressSpace::pint_t laddr = (LocalAddressSpace::pint_t ) localCopy (addr);
679
- LocalAddressSpace::pint_t sladdr = laddr;
680
- uint64_t result = LocalAddressSpace::getSLEB128 (laddr, laddr + size);
681
- addr += (laddr - sladdr);
682
- return result;
683
- }
684
-
685
- template <typename P> void *RemoteAddressSpace<P>::localCopy(pint_t addr) {
686
- // FIX ME
687
- }
688
-
689
- template <typename P>
690
- bool RemoteAddressSpace<P>::findFunctionName(pint_t addr, char *buf,
691
- size_t bufLen,
692
- unw_word_t *offset) {
693
- // FIX ME
694
- }
695
-
696
- // / unw_addr_space is the base class that abstract unw_addr_space_t type in
697
- // / libunwind.h points to.
698
- struct unw_addr_space {
699
- cpu_type_t cpuType;
700
- task_t taskPort;
701
- };
702
-
703
- // / unw_addr_space_i386 is the concrete instance that a unw_addr_space_t points
704
- // / to when examining
705
- // / a 32-bit intel process.
706
- struct unw_addr_space_i386 : public unw_addr_space {
707
- unw_addr_space_i386 (task_t task) : oas(task) {}
708
- RemoteAddressSpace<Pointer32<LittleEndian>> oas;
709
- };
710
-
711
- // / unw_addr_space_x86_64 is the concrete instance that a unw_addr_space_t
712
- // / points to when examining
713
- // / a 64-bit intel process.
714
- struct unw_addr_space_x86_64 : public unw_addr_space {
715
- unw_addr_space_x86_64 (task_t task) : oas(task) {}
716
- RemoteAddressSpace<Pointer64<LittleEndian>> oas;
717
- };
718
-
719
- // / unw_addr_space_ppc is the concrete instance that a unw_addr_space_t points
720
- // / to when examining
721
- // / a 32-bit PowerPC process.
722
- struct unw_addr_space_ppc : public unw_addr_space {
723
- unw_addr_space_ppc (task_t task) : oas(task) {}
724
- RemoteAddressSpace<Pointer32<BigEndian>> oas;
725
- };
726
-
727
- // / unw_addr_space_ppc is the concrete instance that a unw_addr_space_t points
728
- // / to when examining a 64-bit PowerPC process.
729
- struct unw_addr_space_ppc64 : public unw_addr_space {
730
- unw_addr_space_ppc64 (task_t task) : oas(task) {}
731
- RemoteAddressSpace<Pointer64<LittleEndian>> oas;
732
- };
733
-
734
- #endif // UNW_REMOTE
735
-
736
604
} // namespace libunwind
737
605
738
606
#endif // __ADDRESSSPACE_HPP__
0 commit comments