Re: [OpenOCD-devel] ARM Disassembly for PLD commands

2018-06-13 Thread James Marshall
Hi folks,

I've submitted a new patch set for http://openocd.zylin.com/#/c/4348/

I've addressed the line pointed out by Andreas (thinaks!) and have fixed
it: the original code missed PLDW instructions, and my initial patch had
the mask wrong as well.

I've tested the latest with the literal, register, and immediate forms of
PLD and PLDW. The test code uses inline assembly / gcc / objdump to
generate the assembly instructions to test (surely there is a better
way...). The code is available here:
https://github.com/jcmarsh/Research_Notes/tree/master/openocd_misc/openocd_pld_disassemble

Thanks,
James

On Wed, Jun 6, 2018 at 11:28 AM, James Marshall 
wrote:

> Hi Folks,
>
> Any chance that this patch could get pulled? http://openocd.zylin.
> com/#/c/4348/
>
> I took a look into using GDB for disassembly, but ran into issues with it:
> GDB is doing something in the background that is impacting the L2 cache
> controller counters. This makes OpenOCD the best solution I've found so far
> for disassembly.
>
> Thanks,
> James
>
> On Wed, Apr 11, 2018 at 10:16 AM, James Marshall 
> wrote:
>
>> Hi Folks,
>>
>> This was a pretty small patch adding PLD support to the arm disasembler (
>> http://openocd.zylin.com/#/c/4348/), and it would be nice to either:
>> a) Get it pulled into the main repo so people using the dissasembler
>> don't get a "TODO" message
>> -or-
>> b) Have the disassembly feature cut so people know to seek out different
>> solutions for disassembly
>>
>> Thanks,
>> James
>>
>>
>>
>>
>>
>> On Tue, Jan 16, 2018 at 8:47 PM, James Marshall 
>> wrote:
>>
>>> We looked at GDB, but didn't end up having a need for it... because we
>>> were already using OpenOCD which has an integrated disassembler. :)
>>>
>>>
>>>
>>> On Tue, Jan 16, 2018 at 8:20 AM, Marc Schink 
>>> wrote:
>>>
>>>> So it's a pretty odd use-case, and maybe not worth maintaining (I would
>>>>> obviously vote for keeping it... if I have a vote that is). And maybe 
>>>>> there
>>>>> is a smarter / better way to do it. We did investigate using the RPC
>>>>> interface and decided against it (I don't recall the specifics). And maybe
>>>>> there is a way to use Capstone...
>>>>>
>>>>
>>>> What about GDB - have you tried it? It has an integrated disassembler.
>>>>
>>>> Marc
>>>>
>>>> 
>>>> --
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> ___
>>>> OpenOCD-devel mailing list
>>>> OpenOCD-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/openocd-devel
>>>>
>>>
>>>
>>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] ARM Disassembly for PLD commands

2018-06-06 Thread James Marshall
Hi Folks,

Any chance that this patch could get pulled?
http://openocd.zylin.com/#/c/4348/

I took a look into using GDB for disassembly, but ran into issues with it:
GDB is doing something in the background that is impacting the L2 cache
controller counters. This makes OpenOCD the best solution I've found so far
for disassembly.

Thanks,
James

On Wed, Apr 11, 2018 at 10:16 AM, James Marshall 
wrote:

> Hi Folks,
>
> This was a pretty small patch adding PLD support to the arm disasembler (
> http://openocd.zylin.com/#/c/4348/), and it would be nice to either:
> a) Get it pulled into the main repo so people using the dissasembler don't
> get a "TODO" message
> -or-
> b) Have the disassembly feature cut so people know to seek out different
> solutions for disassembly
>
> Thanks,
> James
>
>
>
>
>
> On Tue, Jan 16, 2018 at 8:47 PM, James Marshall 
> wrote:
>
>> We looked at GDB, but didn't end up having a need for it... because we
>> were already using OpenOCD which has an integrated disassembler. :)
>>
>>
>>
>> On Tue, Jan 16, 2018 at 8:20 AM, Marc Schink 
>> wrote:
>>
>>> So it's a pretty odd use-case, and maybe not worth maintaining (I would
>>>> obviously vote for keeping it... if I have a vote that is). And maybe there
>>>> is a smarter / better way to do it. We did investigate using the RPC
>>>> interface and decided against it (I don't recall the specifics). And maybe
>>>> there is a way to use Capstone...
>>>>
>>>
>>> What about GDB - have you tried it? It has an integrated disassembler.
>>>
>>> Marc
>>>
>>> 
>>> --
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> ___
>>> OpenOCD-devel mailing list
>>> OpenOCD-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/openocd-devel
>>>
>>
>>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] ARM Disassembly for PLD commands

2018-04-11 Thread James Marshall
Hi Folks,

This was a pretty small patch adding PLD support to the arm disasembler (
http://openocd.zylin.com/#/c/4348/), and it would be nice to either:
a) Get it pulled into the main repo so people using the dissasembler don't
get a "TODO" message
-or-
b) Have the disassembly feature cut so people know to seek out different
solutions for disassembly

Thanks,
James





On Tue, Jan 16, 2018 at 8:47 PM, James Marshall 
wrote:

> We looked at GDB, but didn't end up having a need for it... because we
> were already using OpenOCD which has an integrated disassembler. :)
>
>
>
> On Tue, Jan 16, 2018 at 8:20 AM, Marc Schink 
> wrote:
>
>> So it's a pretty odd use-case, and maybe not worth maintaining (I would
>>> obviously vote for keeping it... if I have a vote that is). And maybe there
>>> is a smarter / better way to do it. We did investigate using the RPC
>>> interface and decided against it (I don't recall the specifics). And maybe
>>> there is a way to use Capstone...
>>>
>>
>> What about GDB - have you tried it? It has an integrated disassembler.
>>
>> Marc
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> OpenOCD-devel mailing list
>> OpenOCD-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openocd-devel
>>
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] ARM Disassembly for PLD commands

2018-01-16 Thread James Marshall
We looked at GDB, but didn't end up having a need for it... because we were
already using OpenOCD which has an integrated disassembler. :)



On Tue, Jan 16, 2018 at 8:20 AM, Marc Schink 
wrote:

> So it's a pretty odd use-case, and maybe not worth maintaining (I would
>> obviously vote for keeping it... if I have a vote that is). And maybe there
>> is a smarter / better way to do it. We did investigate using the RPC
>> interface and decided against it (I don't recall the specifics). And maybe
>> there is a way to use Capstone...
>>
>
> What about GDB - have you tried it? It has an integrated disassembler.
>
> Marc
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> OpenOCD-devel mailing list
> OpenOCD-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openocd-devel
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] ARM Disassembly for PLD commands

2018-01-15 Thread James Marshall
Whoa, geez... ask about a feature and it gets cut?! Just kidding.

I'm working on a project to inject bit flips into caches. We're using
OpenOCD to run the target program one step at a time and build a database
of all memory accesses. For each line of code, we disassemble it, and if it
touches memory, we calculate the address and data which requires reading
values from other registers. We also time how long it takes load
instructions to run so that we can guess if it resulted in a cache hit or
miss.

The tricky part is that we want to run on the hardware we're testing, so
simulating caches isn't an option. This gives us "ground truth" about the
implementation, and we don't have to worry about simulator setups and
figuring out exactly how the cache is handling things.

So it's a pretty odd use-case, and maybe not worth maintaining (I would
obviously vote for keeping it... if I have a vote that is). And maybe there
is a smarter / better way to do it. We did investigate using the RPC
interface and decided against it (I don't recall the specifics). And maybe
there is a way to use Capstone...

But as it stands now, OpenOCD's disassembler has been working great with
the exception of the PLD instruction for ARM. I'm working on the code for
that now and will submit a patch when I've tested it.

Thank you to everyone that works on OpenOCD!

James

On Mon, Jan 15, 2018 at 7:11 AM, Marc Schink 
wrote:

> Hi,
>
> are there good reasons why we need (ARM) disassembly integrated in
> OpenOCD? As Paul already said, there are awesome external tools/libraries
> like Capstone.
> If there are no good reasons, I would vote to remove the disassembly
> features in near future rather than extending it because it seems out of
> scope for OpenOCD.
>
> Marc
>
> Am 14.01.2018 um 09:01 schrieb Paul Fertser:
>
>> Hello James,
>>
>> On Sat, Jan 13, 2018 at 06:20:05PM -0500, James Marshall wrote:
>>
>>> I found the "...TODO..." in srt/target/arm_disassembler.c.
>>> Do you know when this may be implemented? If I attempt to implement it,
>>> are
>>> there any pitfalls I should know about (I'm assuming that there is
>>> something
>>> tricky since it was left unfinished).
>>>
>>
>> Please just do it, there should be no hidden traps there, just lack of
>> time.
>>
>> BTW, OpenOCD has an RPC interface so you can instead fetch memory and
>> process it with any external tool/library (such as Capstone) in any
>> language you like.
>>
>> HTH
>>
>>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] ARM Disassembly for PLD commands

2018-01-13 Thread James Marshall
Hello OpenOCD Devs,

I'm using OpenOCD to disassemble some ARM code running on an embedded board
for a research project. I've noticed that the PLD instruction (PreLoad Data
with intent to write according to the ARM ARM) isn't fully implemented. I
get something like the following:

0x00101420 0xf5d4f000 PLD ...TODO...

I found the "...TODO..." in srt/target/arm_disassembler.c.

Do you know when this may be implemented? If I attempt to implement it, are
there any pitfalls I should know about (I'm assuming that there is
something tricky since it was left unfinished).

Thanks!
James
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel