| 3794 | } |
| 3795 | |
| 3796 | int debugmem_get_segment(uaecptr addr, bool *exact, bool *ext, TCHAR *out, size_t outsize, TCHAR *name, size_t namesize) |
| 3797 | { |
| 3798 | if (out) |
| 3799 | out[0] = 0; |
| 3800 | if (name) |
| 3801 | name[0] = 0; |
| 3802 | if (exact) |
| 3803 | *exact = false; |
| 3804 | struct debugmemallocs *alloc = ismysegment(addr); |
| 3805 | if (alloc) { |
| 3806 | if (exact && alloc->start + 8 + debugmem_bank.start == addr) |
| 3807 | *exact = true; |
| 3808 | if (out) |
| 3809 | _sntprintf(out, outsize, _T("[%06X]"), ((addr - debugmem_bank.start) - (alloc->start + 8)) & 0xffffff); |
| 3810 | if (name) |
| 3811 | _sntprintf(name, namesize, _T("Segment %d: %08x %08x-%08x"), |
| 3812 | alloc->id, alloc->idtype, alloc->start + debugmem_bank.start, alloc->start + alloc->size - 1 + debugmem_bank.start); |
| 3813 | if (ext) |
| 3814 | *ext = false; |
| 3815 | return alloc->id; |
| 3816 | } else { |
| 3817 | struct debugmemallocs *alloc; |
| 3818 | struct debugsegtracker *seg = findsegment(addr, &alloc); |
| 3819 | if (seg) { |
| 3820 | if (out) |
| 3821 | _sntprintf(out, outsize, _T("[%06X]"), ((addr - debugmem_bank.start) - (alloc->start + 8)) & 0xffffff); |
| 3822 | if (name) |
| 3823 | _sntprintf(name, namesize, _T("Segment %d ('%s') %08x %08x-%08x"), |
| 3824 | alloc->internalid, seg->name, alloc->idtype, alloc->start, alloc->start + alloc->size - 1); |
| 3825 | if (ext) |
| 3826 | *ext = true; |
| 3827 | return alloc->id; |
| 3828 | } |
| 3829 | } |
| 3830 | return 0; |
| 3831 | } |
| 3832 | |
| 3833 | bool debugmem_list_segment(int mode, uaecptr addr) |
| 3834 | { |
no test coverage detected