Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mavproxy_link: add moddebug=4 for full stack trace #1212

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

peterbarker
Copy link
Contributor

this is like moddebug >1 but prints full stack trace rather than just two lines

In the following code a call to a "fail" method was inserted in mavproxy_wp.py in send_wp_requests. You can see that not limiting the stack trace depth a more useful debug message is produced.

with moddebug 3:

STABILIZE> Requesting 0 waypoints t=Fri Jul 28 18:19:44 2023 now=Fri Jul 28 18:19:44 2023 Traceback (most recent call last):
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_link.py", line 979, in master_callback
    mod.mavlink_packet(m)
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_wp.py", line 164, in mavlink_packet
    self.send_wp_requests()
NameError: name 'fail' is not defined

with moddebug 4:

STABILIZE> Requesting 0 waypoints t=Fri Jul 28 18:20:28 2023 now=Fri Jul 28 18:20:28 2023 Traceback (most recent call last):
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_link.py", line 979, in master_callback
    mod.mavlink_packet(m)
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_wp.py", line 164, in mavlink_packet
    self.send_wp_requests()
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_wp.py", line 127, in send_wp_requests
    fail()

this is like moddebug >1 but prints full stack trace rather than just two lines

In the following code a call to a "fail" method was inserted in mavproxy_wp.py in send_wp_requests.  You can see that not limiting the stack trace depth a more useful debug message is produced.

with moddebug 3:

STABILIZE> Requesting 0 waypoints t=Fri Jul 28 18:19:44 2023 now=Fri Jul 28 18:19:44 2023
Traceback (most recent call last):
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_link.py", line 979, in master_callback
    mod.mavlink_packet(m)
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_wp.py", line 164, in mavlink_packet
    self.send_wp_requests()
NameError: name 'fail' is not defined

with moddebug 4:

STABILIZE> Requesting 0 waypoints t=Fri Jul 28 18:20:28 2023 now=Fri Jul 28 18:20:28 2023
Traceback (most recent call last):
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_link.py", line 979, in master_callback
    mod.mavlink_packet(m)
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_wp.py", line 164, in mavlink_packet
    self.send_wp_requests()
  File "/home/pbarker/.local/lib/python3.10/site-packages/MAVProxy-1.8.65-py3.10.egg/MAVProxy/modules/mavproxy_wp.py", line 127, in send_wp_requests
    fail()
@tridge tridge merged commit 0c9f184 into ArduPilot:master Sep 28, 2023
1 check passed
@peterbarker peterbarker deleted the pr/moddebug-4 branch November 12, 2023 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants