Debugging framework for domain specific language

I want to know if there are any tools/tool-kits which aid in building
source level debuggers for domain specific languages ?
(I work on a proprietary DSL, which doesn’t have any tools
and sometimes debugging will become difficult, so, if in case
there are any such tool-kits, wanted to try)

1

This is an indirect answer to your question. In 1982 I wrote the first commercial C source-level debugger, CDB (also possibly the first remote debugger, kernel debugger, and multi-process/multi-thread debugger). I initially wrote it because I needed it (the only other option was sdb on a VAX, except I didn’t have a VAX, and sdb sucked planetoids). This situation was in perfect harmony with The Cathedral and the Bazaar‘s first rule: Every good work of software starts by scratching a developer’s personal itch.

Since you are the person with the itch, you are also quite possibly the best person to embark on this journey.

The following things are needed to create a source-level debugger:

  1. A way of starting & stopping execution without killing the target process. Given your environment this may be trivial or it might be a deal killer. ptrace(2) was the key in UN*X-land.
  2. A way of querying the current execution state of the target process. e.g Program Counter (PC) (or equivalent), Stack Pointer (SP), registers, and data/instruction memory. Like #1, trivial or deal killer.
  3. A way of mapping the PC => file:line and vice versa—file:line => PC. This is critical because it’s what differentiates a source-level debugger from an assembly-level debugger (or whatever the equivalent would be in your world). Compiled languages often generate additional symbols in the .o file that makes this mapping possible (although not always in a straightforward way).
  4. A way of inserting and removing a breakpoint. How this is accomplished can vary wildly across environments. It needs to be done in such a way as to be as non-disruptive of the execution state as possible so that you can avoid the debugger equivalent of the Heisenberg uncertainty principle—i.e. the bug reacts differently depending on where you set the break. Note: You can’t avoid this with timing-related bugs.

Once you have these things nailed down, your actual command processing should be pretty straightforward. For example, when you hit a breakpoint, you read the PC, map it to file:line and display that line (normally with +/-5 lines of context). For a stack trace, you get the SP and print each frame using the additional symbol info that gives local variable offset from the SP, etc., etc.

What commands make sense will be driven by how you (and your future users) think when using the language. Things that make sense for one language are nonsense when applied to another. For example, given the C declaration struct FOO *pfoo;, it’s nice if typing *pfoo at the command prompt gives you a formatted dump of the structure pointed to. This might not make sense when debugging something like SQL, but there are often analogues.

The Devil is in the Details on these 4 items, so let me know if you would like any more help offline. My email is in my profile.

0

It’s not 100% what you’re looking for, but you can have a look at Xtext and this thread. But obviously that might not help you if your in-house DSL isn’t Xtext-based…

10

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật