Skip to content

Emitaux: also emit column location#212

Closed
let-def wants to merge 1 commit intoocaml:trunkfrom
let-def:debug-info
Closed

Emitaux: also emit column location#212
let-def wants to merge 1 commit intoocaml:trunkfrom
let-def:debug-info

Conversation

@let-def
Copy link
Copy Markdown
Contributor

@let-def let-def commented Jul 3, 2015

GNU AS supports taking the column as an optional third argument in .loc directives.
This branch transmits the column to location emitter, and generate the directive on X86 GAS (although it should be supported on other platforms, the generic Emitaux.emit_debug_info could be updated too).

This result in a minor improvement of DWARF debugging information.

@gasche
Copy link
Copy Markdown
Member

gasche commented Jul 3, 2015

The code looks good.

@xavierleroy
Copy link
Copy Markdown
Contributor

The patch does two things. One is the addition of the column as 3rd argument, as described. The other, as far as I can see, replaces a file number by a file name (literal string) in some places. Why is it correct to do so? Why is it necessary to do so?

@let-def
Copy link
Copy Markdown
Contributor Author

let-def commented Jul 30, 2015

The diff makes it hard to see what's going on, the labelled arguments are a bit confusing.
If we reorder lines from the patch to make it more explicit, the only change is adding labels:

 let emit_debug_info dbg =
-  emit_debug_info_gen dbg (fun file_num file_name ->
-    emit_string "\t.file\t";
-    emit_int file_num; emit_char '\t';
-    emit_string_literal file_name; emit_char '\n';
-  )
+  emit_debug_info_gen dbg (fun ~file_num ~file_name ->
+      emit_string "\t.file\t";
+      emit_int file_num; emit_char '\t';
+      emit_string_literal file_name; emit_char '\n';
+    )
-    (fun file_num line ->
-      emit_string "\t.loc\t";
-      emit_int file_num; emit_char '\t';
-      emit_int line; emit_char '\n')
+    (fun ~file_num ~line ~col:_ ->
+       emit_string "\t.loc\t";
+       emit_int file_num; emit_char '\t';
+       emit_int line; emit_char '\n')

The .file directive is only used to associate an id to a file name, the output don't change for "old-style" emitters.

@gasche
Copy link
Copy Markdown
Member

gasche commented Aug 2, 2015

Merged in trunk. Thanks for the patch.

@gasche gasche closed this Aug 2, 2015
@gasche
Copy link
Copy Markdown
Member

gasche commented Apr 13, 2016

PR#7226 indicates that this breaks build under clang when Location.none is used, with a negative column value.

@let-def let-def deleted the debug-info branch August 3, 2016 16:52
mshinwell added a commit to mshinwell/ocaml that referenced this pull request Jul 20, 2020
lthls pushed a commit to lthls/ocaml that referenced this pull request Sep 23, 2020
lthls pushed a commit to lthls/ocaml that referenced this pull request Sep 23, 2020
lthls pushed a commit to lthls/ocaml that referenced this pull request Sep 24, 2020
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
* update "Industrial Users" header to exactly match the Tailwind Playground implementation
* also: fix hidden menu issue
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Co-authored-by: Thibaut Mattio <thibaut.mattio@gmail.com>
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.

3 participants