Repository navigation
DeBugging
📜 This page is about the original ViewTouch (X Window System,
vtpos). For ViewTouch Modern, see Home.
Some Linux versions require configuration changes to allow gdb to attach. Try changing ptrace_scope to "0" in /etc/sysctl.d/10-ptrace.conf
-
Normal operation: Attach to
vt_mainorvt_term -
Startup issues: More complex since
vt_mainis started by thevtposloader
Bypass the vtpos startup and run vt_main in a separate gdb window:
gdb vtpos
b 455 # Breakpoint where loader/loader_main.cc calls system() to start vt_main
rungdb vt_main
b [wherever] # Set your breakpointjump 456 # Skip over system() callrun /tmp/vtmain # Run within a few seconds of the previous step🎯 Key Insight: Launching
vt_mainfrom GDB in a second terminal and skipping the system call invtposis the proper way to debug ViewTouch. If you're not doing it this way, you're doing it the hard way!
Over the years, Jack Morrison (who had nothing to do with creating ViewTouch) has been able to dive into the code and fix bugs that not even the original engineers could find. I ascribe his success to:
- Raw talent
- Vast knowledge and experience with C++
- Mastery of debugging
Thanks, Jack. You're a real pro and you have my utmost respect!
gdb vtpos
b 153 # Breakpoint where loader calls vt_main
rungdb vt_main
b xxx # Any line number you want to break atjump 154 # Skip over calling vt_mainrun /tmp/vt_main # Run within a few seconds of previous stepGDB will run vt_main, stopping at your specified breakpoint.
ViewTouch Modern
- Home
- Getting Started
- Food Trucks and Retail
- Screens and Hardware
- Updates and Releases
- Help and Troubleshooting
- Announcements
- User manual (PDF)
The original ViewTouch
- Original ViewTouch
- Android & Chrome Devices make great Mobile PoS terminals
- Artificial Intelligence
- Building the Binary
- Building your Custom Menu
- CUPS printing
- DeBugging
- DeskTop
- Documentation
- GitHub Tricks
- Hardware
- IDE & Debugging
- Kitchen and Bar Video (K-BV)
- Navigating the Interface: Point of Sale Mode versus Edit Mode
- Pushing changes to ViewTouch
- Rapid Prototyping and Top Down Development
- Recent Enhancements and The Roadmap
- Starting ViewTouch: runonce, vtpos, Directories & Files
- The ViewTouch graphical interface: Pages
- The X Window System