Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006267OCamlOCaml tools (ocaml{lex,yacc,dep,browser,debug})public2013-12-12 21:582014-01-23 18:55
Reporterjwatzmanfb 
Assigned Toxclerc 
PrioritynormalSeverityminorReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.01.1+dev 
Summary0006267: [PATCH] Include more useful information in ocamldebug "bt"
DescriptionBacktraces in ocamldebug currently include only the program counter, module name, and character offset in the file of the frame. While perhaps useful for tools, this isn't terribly useful for humans, who typically think in terms of at least line numbers if not file names.

This patch adds the filename and line number into the backtrace information, for the benefit of human users. I, at least, find this format much more useful when debugging.

(PS: This is my first time filing a Mantis ticket or sending a patch for ocaml. I wasn't able to find any documentation on your preferred format for receiving patches, so I hope this is acceptable. If you prefer something else, please let me know and I'd be happy to oblige!)
Tagspatch
Attached Filespatch file icon ocamldebug-line.patch [^] (689 bytes) 2013-12-12 21:58 [Show Content]
patch file icon ocamldebug-line-v2.patch [^] (4,116 bytes) 2014-01-20 20:54 [Show Content]

- Relationships

-  Notes
(0010795)
xclerc (developer)
2014-01-13 15:18

Seems good; I am only afraid of external tools
relying on the current formatting. Would it be
OK to trigger the proposed behavior through a
command-line option?
(0010796)
gasche (developer)
2014-01-13 15:24

If/when we decide we want this, could we add (one of the) column number(s) as well?
(0010798)
jwatzmanfb (reporter)
2014-01-13 19:04
edited on: 2014-01-13 19:05

> Seems good; I am only afraid of external tools relying on the current formatting. Would it be OK to trigger the proposed behavior through a command-line option?

Sure, though it seems unfortunate to me to have reasonable behavior need to be explicitly turned on via an option instead of the default :) On the other hand, the option might also be able to turn *off* the pc and char, which aren't so useful for human operators. I'll muse on it (and let me know if you feel strongly).

EDIT: forgot to add -- do you think this is a serious danger? I deliberately appended the data so any tools using a regex on the front of the output wouldn't be affected. (Though that doesn't save us if they insist on matching the whole line.)

> If/when we decide we want this, could we add (one of the) column number(s) as well?

Easy enough to do if there's demand? I personally wouldn't use it and it would just clutter things, but particularly if this becomes a "human-readable backtrace" mode then the clutter is much much less of an issue.

(0010799)
gasche (developer)
2014-01-13 19:14

I think disabling this with an optional command switch (--no-readable-trace?) would be fine. Re. column numbers: if the information is there, we can teach Emacs/vi to parse it jump to the right position in the file, which is substantially more helpful than going there by hand. "sourcefile:lineno:column" is (part of) a standardized format for GNU tools error location reporting ( http://www.gnu.org/prep/standards/standards.html#Errors [^] ).
(0010800)
jwatzmanfb (reporter)
2014-01-13 19:21

Sold. I'll fix this up when I get some free time.
(0010819)
jwatzmanfb (reporter)
2014-01-20 20:55

New version of patch updated. I went with "-machine-readable" to allow it to potentially apply to other things in the future as well, and made "-emacs" imply it. Let me know what you think, and feel free to bikeshead about the name, I just picked something and don't feel strongly ;)
(0010834)
xclerc (developer)
2014-01-23 10:08

Patch applied in both trunk (revision 14416) and 4.01 (revision 14417) branches.
(0010838)
jwatzmanfb (reporter)
2014-01-23 18:55

> Patch applied in both trunk (revision 14416) and 4.01 (revision 14417) branches.

Yay! Thanks so much. Interested in taking a look at http://caml.inria.fr/mantis/view.php?id=6270 [^] as well? ;)

- Issue History
Date Modified Username Field Change
2013-12-12 21:58 jwatzmanfb New Issue
2013-12-12 21:58 jwatzmanfb File Added: ocamldebug-line.patch
2014-01-13 11:07 yallop Tag Attached: patch
2014-01-13 15:18 xclerc Note Added: 0010795
2014-01-13 15:24 gasche Note Added: 0010796
2014-01-13 19:04 jwatzmanfb Note Added: 0010798
2014-01-13 19:05 jwatzmanfb Note Edited: 0010798 View Revisions
2014-01-13 19:14 gasche Note Added: 0010799
2014-01-13 19:21 jwatzmanfb Note Added: 0010800
2014-01-20 20:54 jwatzmanfb File Added: ocamldebug-line-v2.patch
2014-01-20 20:55 jwatzmanfb Note Added: 0010819
2014-01-23 10:08 xclerc Note Added: 0010834
2014-01-23 10:08 xclerc Status new => resolved
2014-01-23 10:08 xclerc Fixed in Version => 4.01.1+dev
2014-01-23 10:08 xclerc Resolution open => fixed
2014-01-23 10:08 xclerc Assigned To => xclerc
2014-01-23 18:55 jwatzmanfb Note Added: 0010838


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker