-3

A piece of source code which was not written by me, my aim is to find a problem with this source code. I've narrowed it down to 20 lines of codes. In those 20 lines of codes a number of variables and functions are used. There are upwards of 20 header files and similar .c files that are used to compile this code. I don't want to manually search through all these files.

Is there a way I can find where the function or variable is created and track it from there?

P.S. I'm using notepad++

To build this program I would need my board which I don't have access to, currently (Clarification on the build: I need the board containing the intel-microprocessor to compile and test the code)

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Bia Khan
  • 1
  • 3
  • 2
    Your *compiler* is on a special PCB? It compiles *the board*? In `C`? You're sure you didn't want to tag this `verilog` or something like that? – EOF Aug 23 '16 at 12:10
  • I think what OP means is that he need the board containing the microprocessor to compile and test the code. Example of that are the development boards from Microchip (like the Explorer 16). – Syphirint Aug 23 '16 at 12:13
  • @Syphirint I think OP is quite confuse Indeed. Cross compiler can easily compile for whaterver target CPU, with a correct SDK. Maybe OP is not able to run/launch the program and debug it without target HW. – LPs Aug 23 '16 at 12:15
  • @Syphirint, You're correct i need the specific board, but i don't have access to that board currently so was wondering if there was that notepad++ would allow me to locate the variables – Bia Khan Aug 23 '16 at 12:17
  • 2
    Notepad++ 6.9.1 has a "Find in Files ..." (Ctrl+Shift+F) function. Try that – pmg Aug 23 '16 at 12:17
  • @LPs You are correct, my technical writing skills aren't very good (I'm trying to improve them) – Bia Khan Aug 23 '16 at 12:18
  • Possible duplicate of [Tools to get a pictorial function call graph of code](http://stackoverflow.com/questions/517589/tools-to-get-a-pictorial-function-call-graph-of-code) – m.s. Aug 23 '16 at 12:18
  • A not very simple way is to configure [QEMU](http://wiki.qemu.org/Main_Page) and run there your target code. – LPs Aug 23 '16 at 12:21
  • @pmg Thank you PMG, your solution is the best. Much appreciated – Bia Khan Aug 23 '16 at 13:09
  • @BiaKhan: comment copied to answer, – pmg Aug 23 '16 at 13:11

2 Answers2

0

You might try running ctags across the files and looking through the human readable cross-reference file to find where various variables and functions are defined.

FractalDoctor
  • 2,496
  • 23
  • 32
0

Notepad++ v6.9.2 has a "Find in Files ..." (Ctrl + Shift + F) function.
Try that.

pmg
  • 106,608
  • 13
  • 126
  • 198