This is an archive of the discontinued LLVM Phabricator instance.

Add -data-info-line command (MI)
ClosedPublic

Authored by ki.stfu on Apr 25 2015, 3:25 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

ki.stfu updated this revision to Diff 24435.Apr 25 2015, 3:25 PM
ki.stfu retitled this revision from to Add -data-info-line command (MI).
ki.stfu updated this object.
ki.stfu edited the test plan for this revision. (Show Details)
ki.stfu added a reviewer: abidh.
ki.stfu added subscribers: abidh, Unknown Object (MLST).
abidh edited edge metadata.Apr 27 2015, 7:06 AM

Is it a standard GDB/MI command? If so, then can you point me to its documentation. If it is some extension, can you please document it with its options in the extensions file.

tools/lldb-mi/MICmdCmdData.h
378 ↗(On Diff #24435)

Please remove Author name.

ki.stfu planned changes to this revision.Apr 27 2015, 7:42 AM
ki.stfu updated this revision to Diff 24547.Apr 28 2015, 6:26 AM
ki.stfu edited edge metadata.

Remove Authors/Gotchas/Changes and add -data-info-line command specification into MIExtensions.txt

ki.stfu updated this revision to Diff 24548.Apr 28 2015, 6:31 AM

Add reference to MIExtensions.txt in header file

I can understand the usefulness of this thing. We use to have something similar internally where you can hover over a source line and the you will get information about it in tool tip. But my concern is that you are relying on the output of a CLI command. A small change in its format will break this command. Is it possible to get this information from API?

test/tools/lldb-mi/data/TestMiData.py
166 ↗(On Diff #24548)

It would be good to add a case which does not resolve too.

tools/lldb-mi/MICmdCmdData.cpp
1703 ↗(On Diff #24548)

It would be good to put some comment at this location telling that column can be optional and how you are handling that.

1742 ↗(On Diff #24548)

I think you need to give better error message in case when lldb can not find the location. On my system, I get the following.

-data-info-line *0x00000000001
^error,msg="Command 'data-info-line'. Error: unknown"

Which is not very helpful. I think it would be better to just print ^done without any data telling that location was not resolved instead of error.

tools/lldb-mi/MIExtensions.txt
20 ↗(On Diff #24548)

How about this.
Provides information about a source line. The input can be <address> like 0x12345678 or <file>:<line> where file is name of source file and line is the line number.

The output of this command contains the following fields:

24 ↗(On Diff #24548)

Please complete the line.

25 ↗(On Diff #24548)

I dont understand what the above line means.

ki.stfu added inline comments.Apr 28 2015, 12:14 PM
tools/lldb-mi/MIExtensions.txt
24 ↗(On Diff #24548)

ugh.. It was deleted because of some mysterious reason... very strange.

ki.stfu planned changes to this revision.Apr 28 2015, 12:23 PM
ki.stfu updated this revision to Diff 24609.Apr 29 2015, 3:48 AM

Fix a few comments, fix -data-info-line specification, improve test_lldbmi_data_info_line test, make an error message more helpful

ki.stfu updated this revision to Diff 24613.Apr 29 2015, 4:33 AM

Swap file & line fields

In D9276#162693, @abidh wrote:

I can understand the usefulness of this thing. We use to have something similar internally where you can hover over a source line and the you will get information about it in tool tip. But my concern is that you are relying on the output of a CLI command. A small change in its format will break this command. Is it possible to get this information from API?

Yep, I thought about this. Probably later I'll rework the -data-info-line command to use only LLDB API.

abidh accepted this revision.Apr 29 2015, 10:24 AM
abidh edited edge metadata.
This revision is now accepted and ready to land.Apr 29 2015, 10:24 AM
ki.stfu closed this revision.Apr 30 2015, 12:17 AM
This revision was automatically updated to reflect the committed changes.